Configuration data

The config subdirectory of Glottolog data contains machine readable metadata like the list of macroareas. This information can be accessed via an instance of pyglottolog.Glottolog, too, using the stem of the filename as attribute name:

>>> for ma in Glottolog().macroareas.values():
...     print(ma.name)
...
South America
Eurasia
Africa
Papunesia
North America
Australia

Below are the details of the API to access configuration data.

Glottolog config data, i.e. controlled vocabularies of several kinds.

class pyglottolog.config.AES(ordinal, id, name, egids, unesco, elcat, reference_id, icon=None)[source]

AES status values

Parameters:
  • ordinal (int) –

  • id (str) –

  • name (str) –

  • egids (str) –

  • unesco (str) –

  • elcat (str) –

  • reference_id (str) –

  • icon (str) –

ordinal: int

Sequential numeric value

id: str

unique identifier (suitable as Python name, see https://docs.python.org/3/reference/lexical_analysis.html#identifiers)

name: str

unique human-readable name

egids: str

corresponding status in the EGIDS scala

unesco: str

corresponding status in the UNESCO scala

elcat: str

corresponding status in ElCat

reference_id: str

Glottolog reference ID linking to further information

class pyglottolog.config.AESSource(id, name, url, reference_id, pages=None)[source]

Reference information for AES sources

Parameters:
  • id (str) –

  • name (typing.Optional[str]) –

  • url (typing.Optional[str]) –

  • reference_id (str) –

  • pages (str) –

reference_id: str

Glottolog reference ID linking to further information

class pyglottolog.config.Macroarea(id, name, description, reference_id)[source]

Glottolog macroareas (see https://glottolog.org/meta/glossary#macroarea)

Parameters:
  • id (str) –

  • name (str) –

  • description (str) –

  • reference_id (str) –

reference_id: str

Glottolog reference ID linking to further information

property geojson: dict[str, Any] | None

Get the GeoJSON representation of the geographic extent of the macroarea.

class pyglottolog.config.DocumentType(rank, id, name, description, abbv, bibabbv, webabbr, triggers)[source]

Document types categorize Glottolog references

Parameters:
  • rank (int) –

  • id (str) –

  • name (str) –

  • description (str) –

  • abbv (str) –

  • bibabbv (str) –

  • webabbr (str) –

  • triggers (list[str]) –

class pyglottolog.config.LanguageType(id, pseudo_family_id, category, description)[source]

Language types categorize languages.

Parameters:
  • id (str) –

  • pseudo_family_id (str) –

  • category (str) –

  • description (str) –

pseudo_family_id: str

Glottocode of the pseudo-family that languages of this type are grouped in.

category: str

category name for languages of this type

class pyglottolog.config.LanguoidLevel(ordinal, id, description)[source]

Languoid levels describe the position of languoid nodes in the classification.

Variables:

name – alias for id

Parameters:
  • ordinal (int) –

  • id (str) –

  • description (str) –

property name: str

Just a mnemonic shortcut.

class pyglottolog.config.Config[source]

More convenient access to objects stored as sections in INI files

This class makes objects (i.e. INI sections) accessible as values of a dict, keyed by an id attribute, which is infered from the id or name option of the section and, additonally, under as attribute named after id.

classmethod from_ini(fname, object_class)[source]

Initialize from a file.

Parameters:
  • fname (typing.Union[str, pathlib.Path]) –

  • object_class (type) –

Return type:

pyglottolog.config.Config

get(item, default=None)[source]

Flexible getter for config data.

Parameters:

item (typing.Union[str, pyglottolog.config.ConfigObject]) –

Return type:

typing.Any