Readers¶
Jangle provides readers for commonly-used resources such as SIL ISO 639-3 tables and IANA registries. A record-jar parser is also available for the latter.
- class jangle.readers.Record[source]¶
Used for working with record-jar records.
- jangle.readers.parse_record_jar(lines: Iterable[str], indent='\t', multiline_separator='\r\n') Generator[Record, None, None][source]¶
Yields records from a set of lines. See https://datatracker.ietf.org/doc/pdf/draft-phillips-record-jar-02.
- class jangle.readers.SilTableReader(fn: str, zf: Optional[ZipFile] = None)[source]¶
Uses csv.DictReader to read tab-delimited data from https://iso639-3.sil.org/sites/iso639-3/files/downloads/, or a ZipFile to minimize requests.
More information is available at https://iso639-3.sil.org/code_tables/download_tables.
- chunk_size = 512¶
- class jangle.readers.IANARegistryReader(fn: str)[source]¶
Provides a file date and an iterable of records from an IANA registry.
- chunk_size = 512¶
- file_date: str¶
- class jangle.readers.IANASubtagRegistryReader[source]¶
Reads https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.