Lib¶
iso¶
Functionality to gather information about iso-639-3 codes from sil.org.
-
clld.lib.iso.
get
(path)[source]¶ Retrieve a resource from the sil site and return it’s representation.
rdf¶
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)¶ -
extension
¶ Alias for field number 1
-
mimetype
¶ Alias for field number 2
-
name
¶ Alias for field number 0
-
uri
¶ Alias for field number 3
-
-
clld.lib.rdf.
expand_prefix
(p)[source]¶ Expand default prefixes if possible.
Parameters: p – a qualified name in prefix:localname notation or a URL. Returns: a string URL or a URIRef
bibtex¶
Functionality to handle bibligraphical data in the BibTeX format.
See also
-
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.
-
keymap
¶ Map bibtex record ids to list index.
-
classmethod
-
class
clld.lib.bibtex.
EntryType
[source]¶ Bibtext entry types.
- article
- An article from a journal or magazine. Required fields: author, title, journal, year Optional fields: volume, number, pages, month, note, key
- book
- A book with an explicit publisher. Required fields: author/editor, title, publisher, year Optional fields: volume/number, series, address, edition, month, note, key
- booklet
- 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
- conference
- The same as inproceedings, included for Scribe compatibility.
- inbook
- 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
- incollection
- 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
- inproceedings
- 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
- manual
- Technical documentation. Required fields: title Optional fields: author, organization, address, edition, month, year, note, key
- mastersthesis
- A Master’s thesis. Required fields: author, title, school, year Optional fields: type, address, month, note, key
- misc
- For use when nothing else fits. Required fields: none Optional fields: author, title, howpublished, month, year, note, key
- phdthesis
- A Ph.D. thesis. Required fields: author, title, school, year Optional fields: type, address, month, note, key
- proceedings
- The proceedings of a conference. Required fields: title, year Optional fields: editor, volume/number, series, address, month, publisher, organization, note, key
- techreport
- 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
- unpublished
- 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
Note
Unknown genres are converted to “misc”.