Functionality to gather information about iso-639-3 codes from


Retrieve a resource from the sil site and return it’s representation.


Scrape information about a iso 639-3 code from the documentation page.


Generator for entries in a tab file specified by name.


Retrieve the current (date-stamped) file names for download files from sil.


This module provides functionality for handling our data as rdf.

class clld.lib.rdf.ClldGraph(*args, **kw)[source]

Augmented rdflib.Graph.

Augment the standard rdflib.Graph by making sure our standard ns prefixes are always bound.

class clld.lib.rdf.Notation(name, extension, mimetype, uri)

Alias for field number 1


Alias for field number 2


Alias for field number 0


Alias for field number 3


Expand default prefixes if possible.

Parameters:p – a qualified name in prefix:localname notation or a URL.
Returns:a string URL or a URIRef
clld.lib.rdf.properties_as_xml_snippet(subject, props)[source]

Serialize props of subject as RDF-XML snippet.


Expand qname to full URL respecting our default prefixes.


Functionality to handle bibligraphical data in the BibTeX format.

class clld.lib.bibtex.Database(records)[source]

Represents a bibtex databases, i.e. a container class for Record instances.

classmethod from_file(bibFile, encoding=u'utf8', lowercase=False)[source]

Create bibtex database from a bib-file.

@param bibFile: path of the bibtex-database-file to be read.


Map bibtex record ids to list index.

class clld.lib.bibtex.EntryType[source]

Bibtext entry types.

An article from a journal or magazine. Required fields: author, title, journal, year Optional fields: volume, number, pages, month, note, key
A book with an explicit publisher. Required fields: author/editor, title, publisher, year Optional fields: volume/number, series, address, edition, month, note, key
A work that is printed and bound, but without a named publisher or sponsoring institution. Required fields: title Optional fields: author, howpublished, address, month, year, note, key
The same as inproceedings, included for Scribe compatibility.
A part of a book, usually untitled. May be a chapter (or section or whatever) and/or a range of pages. Required fields: author/editor, title, chapter/pages, publisher, year Optional fields: volume/number, series, type, address, edition, month, note, key
A part of a book having its own title. Required fields: author, title, booktitle, publisher, year Optional fields: editor, volume/number, series, type, chapter, pages, address, edition, month, note, key
An article in a conference proceedings. Required fields: author, title, booktitle, year Optional fields: editor, volume/number, series, pages, address, month, organization, publisher, note, key
Technical documentation. Required fields: title Optional fields: author, organization, address, edition, month, year, note, key
A Master’s thesis. Required fields: author, title, school, year Optional fields: type, address, month, note, key
For use when nothing else fits. Required fields: none Optional fields: author, title, howpublished, month, year, note, key
A Ph.D. thesis. Required fields: author, title, school, year Optional fields: type, address, month, note, key
The proceedings of a conference. Required fields: title, year Optional fields: editor, volume/number, series, address, month, publisher, organization, note, key
A report published by a school or other institution, usually numbered within a series. Required fields: author, title, institution, year Optional fields: type, number, address, month, note, key
A document having an author and title, but not formally published. Required fields: author, title, note Optional fields: month, year, key
class clld.lib.bibtex.Record(genre, id_, *args, **kw)[source]

A BibTeX record is an ordered dict with two special properties - id and genre.

To overcome the limitation of single values per field in BibTeX, we allow fields, i.e. values of the dict to be iterables of strings as well. Note that to support this use case comprehensively, various methods of retrieving values will behave differently. I.e. values will be

  • joined to a string in __getitem__,
  • retrievable as assigned with get (i.e. only use get if you know how a value was assigned),
  • retrievable as list with getall


Unknown genres are converted to “misc”.


Get list of all values for key.

Returns:list of strings representing the values of the record for field ‘key’.

Unencode Unicode escape sequences.

Match all 3-5-digit sequences with unicode character replace all ‘?[u....]’ with corresponding unicode

There are some decimal/octal mismatches in unicode encodings in bibtex


Transform latex escape sequences of type `e into unicode.

Parameters:string – six.text_type or six.binary_type (which will be decoded using latex+latin1)


Functionality to create Coins, i.e. context objects in spans.

class clld.lib.coins.ContextObject(sid, mtx, *data)[source]

A Context Object which knows how to render it’s metadata as HTML span tags.


Functionality to retrieve data from a FileMaker server.

We use the FileMaker Custom Web Publishing with XML protocol.

class clld.lib.fmpxml.Client(host, db, user, password, limit=1000, cache=None, verbose=True)[source]

Client for FileMaker’s ‘Custom Web Publishing with XML’ feature.


Retrieve data from the server.

Parameters:what – Name of the layout from which to retrieve data.
Returns:list of dict representing the data of the layout.
class clld.lib.fmpxml.Result(content)[source]

Represents a filemaker pro xml result.


normalize markup in filemaker data.