Access info of the ISO 639-3 standard

This module provides an API to the information of the ISO-639-3 standard. ISO-639-3 data is not distributed with this package. Instead, an ISO instance can either be passed the path to a local copy of the zipped ISO tables or it will download them from https://iso639-3.sil.org/code_tables/download_tables

class clldutils.iso_639_3.ISO(zippath=None)[source]

Provides access to the content of ISO 639-3’s downloadable code table.

An ISO instance maps three-letter codes to Code instances, and provides a couple of convenience methods.

Usage:

>>> from clldutils.iso_639_3 import ISO
>>> iso = ISO('iso-639-3_Code_Tables_20220311.zip')
>>> iso.retirements[0]
<ISO-639-3 [fri] Retirement/change>
>>> iso.retirements[0].change_to
[<ISO-639-3 [fry] Individual/Living>]
Parameters:

zippath (typing.Union[str, pathlib.Path, None]) –

property living: List[Code]

All codes categorized as “Living”

property extinct: List[Code]

All codes categorized as “Extinct”

property ancient: List[Code]

All codes categorized as “Ancient”

property historical: List[Code]

All codes categorized as “Historical”

property constructed: List[Code]

All codes categorized as “Constructed”

property special: List[Code]

All codes categorized as “Special”

property retirements: List[Code]

All retired codes

property macrolanguages: List[Code]

All macrolanguage codes

property languages: List[Code]

All active language codes

class clldutils.iso_639_3.Code(item, tablename, registry)[source]

Represents one ISO 639-3 code and its associated metadata.

Variables:
  • code (str) – The three-letter code

  • name (str) – The language name

property type: str

The type of the code formatted as pair “scope/type”

property is_retired: bool

Flag signaling whether the code is retired.

property change_to: List[Code]

List of codes that supersede a retired code.

property is_local: bool

Flag signaling whether the code is in the private use area.

property extension: List[Code]

The codes subsumed by a macrolanguage code.

clldutils.iso_639_3.download_tables(outdir=None)[source]

Download the zipped ISO tables to outdir or cwd.

Return type:

pathlib.Path