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
Codeinstances, 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]) –
- by_type(type_)[source]
Return codes by type.
- Return type:
list[clldutils.iso_639_3.Code]
- property living: list[clldutils.iso_639_3.Code]
All codes categorized as “Living”
- property extinct: list[clldutils.iso_639_3.Code]
All codes categorized as “Extinct”
- property ancient: list[clldutils.iso_639_3.Code]
All codes categorized as “Ancient”
- property historical: list[clldutils.iso_639_3.Code]
All codes categorized as “Historical”
- property constructed: list[clldutils.iso_639_3.Code]
All codes categorized as “Constructed”
- property special: list[clldutils.iso_639_3.Code]
All codes categorized as “Special”
- property retirements: list[clldutils.iso_639_3.Code]
All retired codes
- property macrolanguages: list[clldutils.iso_639_3.Code]
All macrolanguage codes
- property languages: list[clldutils.iso_639_3.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
- Parameters:
item (
dict[str,str]) –tablename (
str) –registry (
clldutils.iso_639_3.ISO) –
- 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[clldutils.iso_639_3.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[clldutils.iso_639_3.Code]
The codes subsumed by a macrolanguage code.