Skip to content

Commit ae00a0f

Browse files
committed
Release version 2.6.0
Changed: - Updated package data following the release of version 2025-01-15 of the ISO 639-3 tables by SIL. Removed: - Support for Python 3.8.
1 parent 2a1cacc commit ae00a0f

File tree

2 files changed

+22
-29
lines changed

2 files changed

+22
-29
lines changed

README.md

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ You can use the `asdict` method to return ISO 639 values as a Python dictionary
8585
{'name': 'French', 'pt1': 'fr', 'pt2b': 'fre', 'pt2t': 'fra', 'pt3': 'fra', 'pt5': ''}
8686
```
8787

88+
Lists of `Lang` instances are sortable by name.
89+
```python
90+
>>> [lg.name for lg in sorted([Lang("deu"), Lang("rus"), Lang("eng")])]
91+
['English', 'German', 'Russian']
92+
```
93+
8894
### Other Language Names
8995

9096
In addition to their reference name, some language identifiers may be associated with other names. You can list them using the `other_names` method.
@@ -96,7 +102,7 @@ In addition to their reference name, some language identifiers may be associated
96102
['Asturleonese', 'Bable', 'Leonese']
97103
```
98104

99-
### Language Types
105+
### Language Type
100106

101107
The type of a language is accessible thanks to the `type` method.
102108
```python
@@ -105,7 +111,7 @@ The type of a language is accessible thanks to the `type` method.
105111
'Historical'
106112
```
107113

108-
### Macrolanguages
114+
### Macrolanguage & Individual Languages
109115

110116
You can easily determine whether a language is a macrolanguage or an individual language.
111117
```python
@@ -129,30 +135,6 @@ Conversely, you can also list all the individual languages that share a common m
129135
Lang(name='Dari', pt1='', pt2b='', pt2t='', pt3='prs', pt5='')]
130136
```
131137

132-
### In Data Structures
133-
134-
As `Lang` is hashable, `Lang` instances can be added to a set or used as dictionary keys.
135-
```python
136-
>>> {Lang("de"): "foo", Lang("fr"): "bar"}
137-
{Lang(name='German', pt1='de', pt2b='ger', pt2t='deu', pt3='deu', pt5=''): 'foo', Lang(name='French', pt1='fr', pt2b='fre', pt2t='fra', pt3='fra', pt5=''): 'bar'}
138-
```
139-
140-
Lists of `Lang` instances are sortable by name.
141-
```python
142-
>>> [lg.name for lg in sorted([Lang("deu"), Lang("rus"), Lang("eng")])]
143-
['English', 'German', 'Russian']
144-
```
145-
146-
### Iterator
147-
148-
`iter_langs()` iterates through all possible `Lang` instances, ordered alphabetically by name.
149-
150-
```python
151-
>>> from iso639 import iter_langs
152-
>>> [lg.name for lg in iter_langs()]
153-
["'Are'are", "'Auhelawa", "A'ou", ... , 'ǂHua', 'ǂUngkue', 'ǃXóõ']
154-
```
155-
156138
### Exceptions
157139

158140
When an invalid language value is passed to `Lang`, an `InvalidLanguageValue` exception is raised.
@@ -200,9 +182,20 @@ False
200182
True
201183
```
202184

185+
### Iterator
186+
187+
`iter_langs()` iterates through all possible `Lang` instances, ordered alphabetically by name.
188+
189+
```python
190+
>>> from iso639 import iter_langs
191+
>>> [lg.name for lg in iter_langs()]
192+
["'Are'are", "'Auhelawa", "A'ou", ... , 'ǂHua', 'ǂUngkue', 'ǃXóõ']
193+
```
194+
195+
203196
## Speed
204197

205-
`iso639-lang` loads its mappings into memory to process calls much [faster](https://github.com/LBeaudoux/benchmark-iso639) than Python libraries that rely on an embedded database.
198+
`iso639-lang` loads its mappings into memory to process calls much faster than Python libraries that rely on an embedded database.
206199

207200

208201
## Sources

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "iso639-lang"
7-
version = "2.5.1"
8-
description = "A fast, simple ISO 639 library."
7+
version = "2.6.0"
8+
description = "A simpler, faster ISO 639 library."
99
keywords = ["ISO 639", "ISO 639-1", "ISO 639-2", "ISO 639-3", "ISO 639-5", "language code"]
1010
readme = "README.md"
1111
authors = [

0 commit comments

Comments
 (0)