Languages package for YouVersion usage.
Project description
yv-languages
Requirements
This project recommends Python 3.11 or higher.
Installation
pip install yv-languages
Usage
You can make any language tag string canonical like:
import yv_languages
bcp = yv_languages.canonical("eng")
print(str(bcp)) # "en"
or with validation:
import yv_languages
bcp = yv_languages.canonical("eng", should_validate=True)
print(str(bcp)) # "en"
You can also maximize a language tag using langcodes' likely subtags:
import yv_languages
bcp = yv_languages.maximize("zh")
print(str(bcp)) # "zh-Hans-CN"
Development
This project is tested with Python 3.13.
Running tests
pytest tests/
Before committing any code
We have a pre-commit hook which should be setup. You can symlink it to run before each commit by changing directory to the repo and running
make githooks
Project details
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 yv_languages-1.1.0.tar.gz.
File metadata
- Download URL: yv_languages-1.1.0.tar.gz
- Upload date:
- Size: 38.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5879bcc389f5006869c9ad8b6aaf6648e04e42bfa634217fad13db939cba9f42
|
|
| MD5 |
de51944904c71a4357c47b274d21f94d
|
|
| BLAKE2b-256 |
db8b10c71ee38b6e508a6d1135e7c483928d0ee84c3158ce6487cc50c691667a
|
File details
Details for the file yv_languages-1.1.0-py3-none-any.whl.
File metadata
- Download URL: yv_languages-1.1.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72f03c15ca8cf3486dce95e2fde45710dca337cecabe623df0f1dd24c767e47c
|
|
| MD5 |
cf23b6bc2b3f96e694717b5f30807469
|
|
| BLAKE2b-256 |
e1248a3babfc895cdd9b9c30538242002f0e052c34b9f9a0fb294869210c0a6e
|