python-iso639 2025.11.11__tar.gz → 2026.1.31__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/CHANGELOG.md +13 -0
- {python_iso639-2025.11.11/src/python_iso639.egg-info → python_iso639-2026.1.31}/PKG-INFO +20 -17
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/README.md +15 -11
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/pyproject.toml +5 -6
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/__init__.py +1 -2
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3.tab +4 -2
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3_Name_Index.tab +4 -2
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/language.py +2 -26
- {python_iso639-2025.11.11 → python_iso639-2026.1.31/src/python_iso639.egg-info}/PKG-INFO +20 -17
- python_iso639-2026.1.31/src/python_iso639.egg-info/requires.txt +8 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/tests/test_language.py +2 -2
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/tests/test_version_number.py +0 -1
- python_iso639-2025.11.11/src/python_iso639.egg-info/requires.txt +0 -9
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/LICENSE.txt +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/MANIFEST.in +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/setup.cfg +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/__init__.py +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3-macrolanguages.tab +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3_Retirements.tab +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/py.typed +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/SOURCES.txt +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/dependency_links.txt +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/not-zip-safe +0 -0
- {python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/top_level.txt +0 -0
|
@@ -17,6 +17,17 @@ major/minor/micro version numbers like `05` (it'd have to be just `5`).
|
|
|
17
17
|
### Fixed
|
|
18
18
|
### Security
|
|
19
19
|
|
|
20
|
+
## [2026.1.31]
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
* Updated the ISO 639 data from SIL to the latest 2026-01-15 release.
|
|
24
|
+
|
|
25
|
+
## [2025.11.16]
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
* Fixed README.md (shown on the PyPI page) for the change from `exact` to `strict_case`
|
|
29
|
+
in `Language.match`.
|
|
30
|
+
|
|
20
31
|
## [2025.11.11]
|
|
21
32
|
|
|
22
33
|
### Added
|
|
@@ -29,6 +40,8 @@ major/minor/micro version numbers like `05` (it'd have to be just `5`).
|
|
|
29
40
|
defaulting to `True`.
|
|
30
41
|
|
|
31
42
|
### Removed
|
|
43
|
+
* In `Language.match`, removed the keyword argument `exact`
|
|
44
|
+
(replaced by `strict_case`, defaulting to `True`).
|
|
32
45
|
* Dropped support for Python 3.9.
|
|
33
46
|
|
|
34
47
|
## [2025.2.18]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-iso639
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2026.1.31
|
|
4
4
|
Summary: ISO 639 language codes, names, and other associated information
|
|
5
5
|
Author-email: "Jackson L. Lee" <jacksonlunlee@gmail.com>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -28,12 +28,11 @@ Requires-Python: >=3.10
|
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE.txt
|
|
30
30
|
Provides-Extra: dev
|
|
31
|
-
Requires-Dist: black==
|
|
32
|
-
Requires-Dist: build==1.
|
|
31
|
+
Requires-Dist: black==26.1.0; extra == "dev"
|
|
32
|
+
Requires-Dist: build==1.4.0; extra == "dev"
|
|
33
33
|
Requires-Dist: flake8==7.3.0; extra == "dev"
|
|
34
|
-
Requires-Dist: mypy==1.
|
|
35
|
-
Requires-Dist: pytest==9.0.
|
|
36
|
-
Requires-Dist: requests==2.32.5; extra == "dev"
|
|
34
|
+
Requires-Dist: mypy==1.19.1; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
37
36
|
Requires-Dist: twine==6.2.0; extra == "dev"
|
|
38
37
|
Dynamic: license-file
|
|
39
38
|
|
|
@@ -155,22 +154,26 @@ Use the `match` classmethod:
|
|
|
155
154
|
True
|
|
156
155
|
```
|
|
157
156
|
|
|
158
|
-
By default, the classmethod `match`
|
|
159
|
-
|
|
160
|
-
To enforce exact matching instead, pass in `exact=True`:
|
|
157
|
+
By default, the classmethod `match` is case-sensitive.
|
|
158
|
+
To ignore case instead, pass in `strict_case=False`:
|
|
161
159
|
|
|
162
160
|
```python
|
|
163
|
-
>>> lang5 = iso639.Language.match('FRA')
|
|
164
|
-
>>> lang6 = iso639.Language.match('
|
|
165
|
-
>>>
|
|
166
|
-
>>> lang4 == lang5 == lang6 == lang7
|
|
161
|
+
>>> lang5 = iso639.Language.match('FRA', strict_case=False)
|
|
162
|
+
>>> lang6 = iso639.Language.match('french', strict_case=False)
|
|
163
|
+
>>> lang4 == lang5 == lang6
|
|
167
164
|
True
|
|
168
|
-
>>> iso639.Language.match("french"
|
|
165
|
+
>>> iso639.Language.match("french")
|
|
169
166
|
Traceback (most recent call last):
|
|
170
167
|
File "<stdin>", line 1, in <module>
|
|
171
168
|
LanguageNotFoundError: 'french' isn't an ISO language code or name
|
|
172
169
|
```
|
|
173
170
|
|
|
171
|
+
> [!NOTE]
|
|
172
|
+
> Depending on your use case, ignoring case could potentially lead to matching issues,
|
|
173
|
+
where a language code might match an unintended language name (or vice versa),
|
|
174
|
+
e.g., conflating "igo" and "Igo", while there exist the ISO 639-3 code `ahl` for Igo and
|
|
175
|
+
the ISO 639-3 code `igo` for Isebe.
|
|
176
|
+
|
|
174
177
|
The classmethod `match` is particularly useful for consistently
|
|
175
178
|
accessing a specific attribute from unknown inputs, e.g., the ISO 639-3 code.
|
|
176
179
|
|
|
@@ -244,7 +247,7 @@ A `Language` instance has the following attributes:
|
|
|
244
247
|
| `status` | `str` | ✗ | One of {(A)ctive, (R)etired}, describing the ISO 639-3 code |
|
|
245
248
|
| `name` | `str` | ✗ | Reference language name in ISO 639-3 |
|
|
246
249
|
| `comment` | `str` | ✓ | Comment from ISO 639-3 |
|
|
247
|
-
| `other_names` | `
|
|
250
|
+
| `other_names` | `list[Name]` | ✓ | Other print and inverted names [2] |
|
|
248
251
|
| `macrolanguage` | `str` | ✓ | Macrolanguage |
|
|
249
252
|
| `retire_reason` | `str` | ✓ | Retirement reason, one of {(C)hange, (D)uplicate, (N)on-existent, (S)plit, (M)erge} |
|
|
250
253
|
| `retire_change_to` | `str` | ✓ | ISO 639-3 code to which this language can be changed, if retirement reason is one of {(C)hange, (D)uplicate, (M)erge} |
|
|
@@ -303,7 +306,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
|
|
|
303
306
|
```python
|
|
304
307
|
>>> import iso639
|
|
305
308
|
>>> iso639.DATA_LAST_UPDATED
|
|
306
|
-
datetime.date(
|
|
309
|
+
datetime.date(2026, 1, 15)
|
|
307
310
|
```
|
|
308
311
|
|
|
309
312
|
* `ALL_LANGUAGES`: The list of all `Language` objects based on the included language code data
|
|
@@ -313,7 +316,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
|
|
|
313
316
|
>>> type(iso639.ALL_LANGUAGES)
|
|
314
317
|
<class 'set'>
|
|
315
318
|
>>> len(iso639.ALL_LANGUAGES)
|
|
316
|
-
|
|
319
|
+
8313
|
|
317
320
|
```
|
|
318
321
|
|
|
319
322
|
## Links
|
|
@@ -116,22 +116,26 @@ Use the `match` classmethod:
|
|
|
116
116
|
True
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
By default, the classmethod `match`
|
|
120
|
-
|
|
121
|
-
To enforce exact matching instead, pass in `exact=True`:
|
|
119
|
+
By default, the classmethod `match` is case-sensitive.
|
|
120
|
+
To ignore case instead, pass in `strict_case=False`:
|
|
122
121
|
|
|
123
122
|
```python
|
|
124
|
-
>>> lang5 = iso639.Language.match('FRA')
|
|
125
|
-
>>> lang6 = iso639.Language.match('
|
|
126
|
-
>>>
|
|
127
|
-
>>> lang4 == lang5 == lang6 == lang7
|
|
123
|
+
>>> lang5 = iso639.Language.match('FRA', strict_case=False)
|
|
124
|
+
>>> lang6 = iso639.Language.match('french', strict_case=False)
|
|
125
|
+
>>> lang4 == lang5 == lang6
|
|
128
126
|
True
|
|
129
|
-
>>> iso639.Language.match("french"
|
|
127
|
+
>>> iso639.Language.match("french")
|
|
130
128
|
Traceback (most recent call last):
|
|
131
129
|
File "<stdin>", line 1, in <module>
|
|
132
130
|
LanguageNotFoundError: 'french' isn't an ISO language code or name
|
|
133
131
|
```
|
|
134
132
|
|
|
133
|
+
> [!NOTE]
|
|
134
|
+
> Depending on your use case, ignoring case could potentially lead to matching issues,
|
|
135
|
+
where a language code might match an unintended language name (or vice versa),
|
|
136
|
+
e.g., conflating "igo" and "Igo", while there exist the ISO 639-3 code `ahl` for Igo and
|
|
137
|
+
the ISO 639-3 code `igo` for Isebe.
|
|
138
|
+
|
|
135
139
|
The classmethod `match` is particularly useful for consistently
|
|
136
140
|
accessing a specific attribute from unknown inputs, e.g., the ISO 639-3 code.
|
|
137
141
|
|
|
@@ -205,7 +209,7 @@ A `Language` instance has the following attributes:
|
|
|
205
209
|
| `status` | `str` | ✗ | One of {(A)ctive, (R)etired}, describing the ISO 639-3 code |
|
|
206
210
|
| `name` | `str` | ✗ | Reference language name in ISO 639-3 |
|
|
207
211
|
| `comment` | `str` | ✓ | Comment from ISO 639-3 |
|
|
208
|
-
| `other_names` | `
|
|
212
|
+
| `other_names` | `list[Name]` | ✓ | Other print and inverted names [2] |
|
|
209
213
|
| `macrolanguage` | `str` | ✓ | Macrolanguage |
|
|
210
214
|
| `retire_reason` | `str` | ✓ | Retirement reason, one of {(C)hange, (D)uplicate, (N)on-existent, (S)plit, (M)erge} |
|
|
211
215
|
| `retire_change_to` | `str` | ✓ | ISO 639-3 code to which this language can be changed, if retirement reason is one of {(C)hange, (D)uplicate, (M)erge} |
|
|
@@ -264,7 +268,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
|
|
|
264
268
|
```python
|
|
265
269
|
>>> import iso639
|
|
266
270
|
>>> iso639.DATA_LAST_UPDATED
|
|
267
|
-
datetime.date(
|
|
271
|
+
datetime.date(2026, 1, 15)
|
|
268
272
|
```
|
|
269
273
|
|
|
270
274
|
* `ALL_LANGUAGES`: The list of all `Language` objects based on the included language code data
|
|
@@ -274,7 +278,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
|
|
|
274
278
|
>>> type(iso639.ALL_LANGUAGES)
|
|
275
279
|
<class 'set'>
|
|
276
280
|
>>> len(iso639.ALL_LANGUAGES)
|
|
277
|
-
|
|
281
|
+
8313
|
|
278
282
|
```
|
|
279
283
|
|
|
280
284
|
## Links
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-iso639"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2026.1.31"
|
|
8
8
|
description = "ISO 639 language codes, names, and other associated information"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">= 3.10"
|
|
@@ -34,12 +34,11 @@ classifiers = [
|
|
|
34
34
|
|
|
35
35
|
[project.optional-dependencies]
|
|
36
36
|
dev = [
|
|
37
|
-
"black ==
|
|
38
|
-
"build == 1.
|
|
37
|
+
"black == 26.1.0",
|
|
38
|
+
"build == 1.4.0",
|
|
39
39
|
"flake8 == 7.3.0",
|
|
40
|
-
"mypy == 1.
|
|
41
|
-
"pytest == 9.0.
|
|
42
|
-
"requests == 2.32.5",
|
|
40
|
+
"mypy == 1.19.1",
|
|
41
|
+
"pytest == 9.0.2",
|
|
43
42
|
"twine == 6.2.0",
|
|
44
43
|
]
|
|
45
44
|
|
|
@@ -3,13 +3,12 @@ from importlib.metadata import version
|
|
|
3
3
|
|
|
4
4
|
from .language import ALL_LANGUAGES, Language, LanguageNotFoundError
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
# __version__ is based on calendar versioning (https://calver.org/).
|
|
8
7
|
# __version__ and DATA_LAST_UPDATED are intentionally kept separate.
|
|
9
8
|
# While DATA_LAST_UPDATED is strictly the date for the ISO 639-3 data release,
|
|
10
9
|
# __version__ can be bumped for changes other than data updates.
|
|
11
10
|
__version__ = version("python-iso639")
|
|
12
|
-
DATA_LAST_UPDATED = datetime.date(
|
|
11
|
+
DATA_LAST_UPDATED = datetime.date(2026, 1, 15)
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
__all__ = [
|
|
@@ -850,7 +850,7 @@ bnz I L Beezen
|
|
|
850
850
|
boa I L Bora
|
|
851
851
|
bob I L Aweer
|
|
852
852
|
bod tib bod bo I L Tibetan
|
|
853
|
-
boe I L Mundabli
|
|
853
|
+
boe I L Mundabli-Mufu
|
|
854
854
|
bof I L Bolon
|
|
855
855
|
bog I L Bamako Sign Language
|
|
856
856
|
boh I L Boma
|
|
@@ -1751,6 +1751,7 @@ dyb I E Dyaberdyaber
|
|
|
1751
1751
|
dyd I E Dyugun
|
|
1752
1752
|
dyg I E Villa Viciosa Agta
|
|
1753
1753
|
dyi I L Djimini Senoufo
|
|
1754
|
+
dyl I L Bhutanese Sign Language
|
|
1754
1755
|
dym I L Yanda Dom Dogon
|
|
1755
1756
|
dyn I L Dyangadi
|
|
1756
1757
|
dyo I L Jola-Fonyi
|
|
@@ -3573,6 +3574,7 @@ lex I L Luang
|
|
|
3573
3574
|
ley I L Lemolang
|
|
3574
3575
|
lez lez lez I L Lezghian
|
|
3575
3576
|
lfa I L Lefa
|
|
3577
|
+
lfb I L Buu (Cameroon)
|
|
3576
3578
|
lfn I C Lingua Franca Nova
|
|
3577
3579
|
lga I L Lungga
|
|
3578
3580
|
lgb I L Laghu
|
|
@@ -3784,7 +3786,7 @@ lue I L Luvale
|
|
|
3784
3786
|
luf I L Laua
|
|
3785
3787
|
lug lug lug lg I L Ganda
|
|
3786
3788
|
luh I L Leizhou Chinese
|
|
3787
|
-
lui lui lui I E
|
|
3789
|
+
lui lui lui I E Luiseño
|
|
3788
3790
|
luj I L Luna
|
|
3789
3791
|
luk I L Lunanakha
|
|
3790
3792
|
lul I L Olu'bo
|
{python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3_Name_Index.tab
RENAMED
|
@@ -880,7 +880,7 @@ bnz Beezen Beezen
|
|
|
880
880
|
boa Bora Bora
|
|
881
881
|
bob Aweer Aweer
|
|
882
882
|
bod Tibetan Tibetan
|
|
883
|
-
boe Mundabli Mundabli
|
|
883
|
+
boe Mundabli-Mufu Mundabli-Mufu
|
|
884
884
|
bof Bolon Bolon
|
|
885
885
|
bog Bamako Sign Language Bamako Sign Language
|
|
886
886
|
boh Boma Boma
|
|
@@ -1837,6 +1837,7 @@ dyb Dyaberdyaber Dyaberdyaber
|
|
|
1837
1837
|
dyd Dyugun Dyugun
|
|
1838
1838
|
dyg Villa Viciosa Agta Agta, Villa Viciosa
|
|
1839
1839
|
dyi Djimini Senoufo Senoufo, Djimini
|
|
1840
|
+
dyl Bhutanese Sign Language Bhutanese Sign Language
|
|
1840
1841
|
dym Yanda Dom Dogon Dogon, Yanda Dom
|
|
1841
1842
|
dyn Dhanggatti Dhanggatti
|
|
1842
1843
|
dyn Dyangadi Dyangadi
|
|
@@ -3758,6 +3759,7 @@ lex Luang Luang
|
|
|
3758
3759
|
ley Lemolang Lemolang
|
|
3759
3760
|
lez Lezghian Lezghian
|
|
3760
3761
|
lfa Lefa Lefa
|
|
3762
|
+
lfb Buu (Cameroon) Buu (Cameroon)
|
|
3761
3763
|
lfn Lingua Franca Nova Lingua Franca Nova
|
|
3762
3764
|
lga Lungga Lungga
|
|
3763
3765
|
lgb Laghu Laghu
|
|
@@ -3991,7 +3993,7 @@ lue Luvale Luvale
|
|
|
3991
3993
|
luf Laua Laua
|
|
3992
3994
|
lug Ganda Ganda
|
|
3993
3995
|
luh Leizhou Chinese Chinese, Leizhou
|
|
3994
|
-
lui
|
|
3996
|
+
lui Luiseño Luiseño
|
|
3995
3997
|
luj Luna Luna
|
|
3996
3998
|
luk Lunanakha Lunanakha
|
|
3997
3999
|
lul Olu'bo Olu'bo
|
|
@@ -25,7 +25,6 @@ from ._data import (
|
|
|
25
25
|
_COLUMN_TYPE,
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
|
|
29
28
|
_STRING_CLEANING_FUNCS = [lambda x: x.lower(), lambda x: x.title()]
|
|
30
29
|
|
|
31
30
|
|
|
@@ -33,41 +32,18 @@ class LanguageNotFoundError(Exception):
|
|
|
33
32
|
pass
|
|
34
33
|
|
|
35
34
|
|
|
36
|
-
@dataclass(frozen=True)
|
|
35
|
+
@dataclass(frozen=True, slots=True)
|
|
37
36
|
class Name:
|
|
38
37
|
"""Represents an alternative name of a language."""
|
|
39
38
|
|
|
40
|
-
__slots__ = ("print", "inverted")
|
|
41
39
|
print: str
|
|
42
40
|
inverted: str
|
|
43
41
|
|
|
44
42
|
|
|
45
|
-
@dataclass(frozen=True)
|
|
43
|
+
@dataclass(frozen=True, slots=True)
|
|
46
44
|
class Language:
|
|
47
45
|
"""Represents a language in the ISO 639-3 charts."""
|
|
48
46
|
|
|
49
|
-
__slots__ = (
|
|
50
|
-
# From the "codes" table
|
|
51
|
-
"part3",
|
|
52
|
-
"part2b",
|
|
53
|
-
"part2t",
|
|
54
|
-
"part1",
|
|
55
|
-
"scope",
|
|
56
|
-
"type",
|
|
57
|
-
"status",
|
|
58
|
-
"name",
|
|
59
|
-
"comment",
|
|
60
|
-
# From the "name_index" table
|
|
61
|
-
"other_names",
|
|
62
|
-
# From the "macrolanguages" table
|
|
63
|
-
"macrolanguage",
|
|
64
|
-
# From the "retirements" table
|
|
65
|
-
"retire_reason",
|
|
66
|
-
"retire_change_to",
|
|
67
|
-
"retire_remedy",
|
|
68
|
-
"retire_date",
|
|
69
|
-
)
|
|
70
|
-
|
|
71
47
|
# From the "codes" table
|
|
72
48
|
part3: str
|
|
73
49
|
part2b: str | None
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-iso639
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2026.1.31
|
|
4
4
|
Summary: ISO 639 language codes, names, and other associated information
|
|
5
5
|
Author-email: "Jackson L. Lee" <jacksonlunlee@gmail.com>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -28,12 +28,11 @@ Requires-Python: >=3.10
|
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE.txt
|
|
30
30
|
Provides-Extra: dev
|
|
31
|
-
Requires-Dist: black==
|
|
32
|
-
Requires-Dist: build==1.
|
|
31
|
+
Requires-Dist: black==26.1.0; extra == "dev"
|
|
32
|
+
Requires-Dist: build==1.4.0; extra == "dev"
|
|
33
33
|
Requires-Dist: flake8==7.3.0; extra == "dev"
|
|
34
|
-
Requires-Dist: mypy==1.
|
|
35
|
-
Requires-Dist: pytest==9.0.
|
|
36
|
-
Requires-Dist: requests==2.32.5; extra == "dev"
|
|
34
|
+
Requires-Dist: mypy==1.19.1; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
37
36
|
Requires-Dist: twine==6.2.0; extra == "dev"
|
|
38
37
|
Dynamic: license-file
|
|
39
38
|
|
|
@@ -155,22 +154,26 @@ Use the `match` classmethod:
|
|
|
155
154
|
True
|
|
156
155
|
```
|
|
157
156
|
|
|
158
|
-
By default, the classmethod `match`
|
|
159
|
-
|
|
160
|
-
To enforce exact matching instead, pass in `exact=True`:
|
|
157
|
+
By default, the classmethod `match` is case-sensitive.
|
|
158
|
+
To ignore case instead, pass in `strict_case=False`:
|
|
161
159
|
|
|
162
160
|
```python
|
|
163
|
-
>>> lang5 = iso639.Language.match('FRA')
|
|
164
|
-
>>> lang6 = iso639.Language.match('
|
|
165
|
-
>>>
|
|
166
|
-
>>> lang4 == lang5 == lang6 == lang7
|
|
161
|
+
>>> lang5 = iso639.Language.match('FRA', strict_case=False)
|
|
162
|
+
>>> lang6 = iso639.Language.match('french', strict_case=False)
|
|
163
|
+
>>> lang4 == lang5 == lang6
|
|
167
164
|
True
|
|
168
|
-
>>> iso639.Language.match("french"
|
|
165
|
+
>>> iso639.Language.match("french")
|
|
169
166
|
Traceback (most recent call last):
|
|
170
167
|
File "<stdin>", line 1, in <module>
|
|
171
168
|
LanguageNotFoundError: 'french' isn't an ISO language code or name
|
|
172
169
|
```
|
|
173
170
|
|
|
171
|
+
> [!NOTE]
|
|
172
|
+
> Depending on your use case, ignoring case could potentially lead to matching issues,
|
|
173
|
+
where a language code might match an unintended language name (or vice versa),
|
|
174
|
+
e.g., conflating "igo" and "Igo", while there exist the ISO 639-3 code `ahl` for Igo and
|
|
175
|
+
the ISO 639-3 code `igo` for Isebe.
|
|
176
|
+
|
|
174
177
|
The classmethod `match` is particularly useful for consistently
|
|
175
178
|
accessing a specific attribute from unknown inputs, e.g., the ISO 639-3 code.
|
|
176
179
|
|
|
@@ -244,7 +247,7 @@ A `Language` instance has the following attributes:
|
|
|
244
247
|
| `status` | `str` | ✗ | One of {(A)ctive, (R)etired}, describing the ISO 639-3 code |
|
|
245
248
|
| `name` | `str` | ✗ | Reference language name in ISO 639-3 |
|
|
246
249
|
| `comment` | `str` | ✓ | Comment from ISO 639-3 |
|
|
247
|
-
| `other_names` | `
|
|
250
|
+
| `other_names` | `list[Name]` | ✓ | Other print and inverted names [2] |
|
|
248
251
|
| `macrolanguage` | `str` | ✓ | Macrolanguage |
|
|
249
252
|
| `retire_reason` | `str` | ✓ | Retirement reason, one of {(C)hange, (D)uplicate, (N)on-existent, (S)plit, (M)erge} |
|
|
250
253
|
| `retire_change_to` | `str` | ✓ | ISO 639-3 code to which this language can be changed, if retirement reason is one of {(C)hange, (D)uplicate, (M)erge} |
|
|
@@ -303,7 +306,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
|
|
|
303
306
|
```python
|
|
304
307
|
>>> import iso639
|
|
305
308
|
>>> iso639.DATA_LAST_UPDATED
|
|
306
|
-
datetime.date(
|
|
309
|
+
datetime.date(2026, 1, 15)
|
|
307
310
|
```
|
|
308
311
|
|
|
309
312
|
* `ALL_LANGUAGES`: The list of all `Language` objects based on the included language code data
|
|
@@ -313,7 +316,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
|
|
|
313
316
|
>>> type(iso639.ALL_LANGUAGES)
|
|
314
317
|
<class 'set'>
|
|
315
318
|
>>> len(iso639.ALL_LANGUAGES)
|
|
316
|
-
|
|
319
|
+
8313
|
|
317
320
|
```
|
|
318
321
|
|
|
319
322
|
## Links
|
|
@@ -132,7 +132,7 @@ def test_invalid_inputs():
|
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
def test_data_last_updated():
|
|
135
|
-
assert DATA_LAST_UPDATED == datetime.date(
|
|
135
|
+
assert DATA_LAST_UPDATED == datetime.date(2026, 1, 15), "Need to update README.md"
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
def test_all_languages():
|
|
@@ -140,7 +140,7 @@ def test_all_languages():
|
|
|
140
140
|
# Defining `len_all_languages` so that when the assertion fails,
|
|
141
141
|
# the error message is more informative.
|
|
142
142
|
len_all_languages = len(ALL_LANGUAGES)
|
|
143
|
-
assert len_all_languages ==
|
|
143
|
+
assert len_all_languages == 8313, "Need to update README.md"
|
|
144
144
|
lang = list(ALL_LANGUAGES)[0]
|
|
145
145
|
assert type(lang) is Language
|
|
146
146
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3-macrolanguages.tab
RENAMED
|
File without changes
|
{python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/iso639/_data/iso-639-3_Retirements.tab
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{python_iso639-2025.11.11 → python_iso639-2026.1.31}/src/python_iso639.egg-info/top_level.txt
RENAMED
|
File without changes
|