A package for determining what version a Unicode codepoint was added to the standard
Project description
unicode_age
A package for determining what version a Unicode codepoint was added to the standard
This package's version X.Y.Z.U tracks Unicode version X.Y.Z, with U reserved as
a release counter for updates unrelated to the Unicode version.
Example usage
>>> import unicode_age
>>> codept = ord("\N{SNAKE}") # added in Unicode 6.0
>>> print(unicode_age.version(codept))
(6, 0)
Rationale
Before writing this module, I was parsing DerivedAge.txt into a list[int | None],
but this approach consumes an atrocious amount of memory (10 MB) for
what it is. Using the representation here consumes three orders of magnitude
less memory (~30 KB), and it was kinda fun to write besides :)
Updating
The script makeunicode_age.py consumes DerivedAge.txt and produces the
unicode_age_db.py file that holds the backing data for this library. To make
a build for another version of the Unicode Character Database, you should be
able to replace DerivedAge.txt with the latest version and re-run this
script.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unicode_age-17.0.0.0.tar.gz.
File metadata
- Download URL: unicode_age-17.0.0.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c821452e097b8ce9d2c5d572cfd1fec6cf1c107c2cf57869c91ef06211486c0d
|
|
| MD5 |
4482b2d89227be2c61ea8f94918bd30a
|
|
| BLAKE2b-256 |
3131c61be962acf75c15c85bda8650b753d257455741b96413a6ba5c18486c25
|
File details
Details for the file unicode_age-17.0.0.0-py3-none-any.whl.
File metadata
- Download URL: unicode_age-17.0.0.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd4dbc6fa4ca16cea96b4fca2e615d147f04817b527a42a18b12f1bbfd156788
|
|
| MD5 |
7737c51734766fa8e416d475d8f7c64f
|
|
| BLAKE2b-256 |
14bcd671b09c502a200c351a4ac0a3dfceb2397e320f1d5d589ed8b5a473ba45
|