Skip to content

Commit

Permalink
ENH update data to latest SIL 2023-12-20 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonllee committed Jan 3, 2024
1 parent 00e2cf4 commit 4e7b10a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ major/minor/micro version numbers like `05` (it'd have to be just `5`).
### Fixed
### Security

## [2024.1.2]

### Changed
* Updated the ISO 639 data from SIL to the latest 2023-12-20 release.

## [2023.12.11]

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
```python
>>> import iso639
>>> iso639.DATA_LAST_UPDATED
datetime.date(2023, 1, 23)
datetime.date(2023, 12, 20)
```

* `ALL_LANGUAGES`: The list of all `Language` objects based on the included language code data
Expand All @@ -249,7 +249,7 @@ e.g., [`dataclasses.asdict`](https://docs.python.org/3/library/dataclasses.html#
>>> type(iso639.ALL_LANGUAGES)
<class 'list'>
>>> len(iso639.ALL_LANGUAGES)
7916
7920
>>> iso639.ALL_LANGUAGES[0]
Language(part3='aaa', scope='I', type='L', status='A', name='Ghotuo', ...)
```
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "python-iso639"
version = "2023.12.11"
version = "2024.1.2"
description = "Look-up utilities for ISO 639 language codes and names"
readme = "README.md"
requires-python = ">= 3.8"
Expand Down Expand Up @@ -34,16 +34,15 @@ classifiers = [

[project.optional-dependencies]
dev = [
"black == 23.11.0",
"black == 23.12.1",
"build == 1.0.3",
"flake8 == 6.1.0",
"pytest == 7.4.3",
"pytest == 7.4.4",
"twine == 4.0.2",
]

[project.urls]
source = "https://github.com/jacksonllee/iso639"
tracker = "https://github.com/jacksonllee/iso639/issues"
Source = "https://github.com/jacksonllee/iso639"

[tool.setuptools.packages.find]
where = [ "src" ]
Expand Down
10 changes: 5 additions & 5 deletions scripts/create_languages_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import os
import sqlite3

# These default filenames are exactly those from SIL as of May 2022.
# These default filenames are exactly those from SIL as of Jan 2023.
_DEFAULT_FILENAMES = {
"codes": "iso-639-3_20230123.tab",
"name_index": "iso-639-3_Name_Index_20230123.tab",
"macrolanguages": "iso-639-3-macrolanguages_20230123.tab",
"retirements": "iso-639-3_Retirements_20230123.tab",
"codes": "iso-639-3_20231220.tab",
"name_index": "iso-639-3_Name_Index_20231220.tab",
"macrolanguages": "iso-639-3-macrolanguages_20231220.tab",
"retirements": "iso-639-3-Retirements_20231220.tab",
}

_THIS_DIR = os.path.dirname(os.path.realpath(__file__))
Expand Down
2 changes: 1 addition & 1 deletion src/iso639/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"LanguageNotFoundError",
]

DATA_LAST_UPDATED = datetime.date(2023, 1, 23)
DATA_LAST_UPDATED = datetime.date(2023, 12, 20)


def __getattr__(name):
Expand Down
Binary file modified src/iso639/languages.db
Binary file not shown.
4 changes: 2 additions & 2 deletions tests/test_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def test_invalid_inputs():


def test_data_last_updated():
assert DATA_LAST_UPDATED == datetime.date(2023, 1, 23), "Need to update README.md"
assert DATA_LAST_UPDATED == datetime.date(2023, 12, 20), "Need to update README.md"


def test_all_languages():
assert type(ALL_LANGUAGES) is list
assert type(ALL_LANGUAGES[0]) is Language
assert len(ALL_LANGUAGES) == 7916, "Need to update README.md"
assert len(ALL_LANGUAGES) == 7920, "Need to update README.md"

lang = ALL_LANGUAGES[0]
assert lang.part3 == "aaa", "Need to update README.md"
Expand Down

0 comments on commit 4e7b10a

Please sign in to comment.