Languages package for YouVersion usage.
Project description
yv-languages
Requirements
This project recommends Python 3.11 or higher.
Installation
You need to connect to our private PyPi packages to install this library. See how in our API Getting Started docs.
Then:
pip install yv-languages
Or if you are working in a microservice with Maker setup,
add yv-languages to your requirements.in file and run:
make deps-compile && make deps-install
Usage
You can validate & make any language tag string canonical like:
import yv_languages
bcp = yv_languages.canonical("eng")
print(str(bcp)) # "en"
Development
This project was written and tested with Python 3.11.
We recommend using pyenv & pyenv-virtualenv which you can find instructions on installing in our Getting Started documentation.
setup the project env
make venv && make deps-install
create a .envrc file using this sample
export PYTHONPATH=`pwd`
Running tests
make test
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
Syncing Rules
The source of truth for the language rules is the locales service. Locales has a scheduled job that regularly checks for new or or updated languages from various language authorities. Overrides are also possible through the locales project. It then updates the locales in the repo with an MR, changing the rules. We are mirroring a similar process here, but we are deriving our rules from locales since locales is the source of truth. Every day we will check for changes. If there are any, an MR will automatically be made with changes to yv_languages/rules.json. This file should NEVER be edited manually in this project.
Merge the MR and create a new tag with an incremented patch version to update the library with the new rules.
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.0.4.tar.gz.
File metadata
- Download URL: yv-languages-1.0.4.tar.gz
- Upload date:
- Size: 39.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02ee219a5ea319915aa553a3a39b8e19c39c79dc362fd5313283d5fd7b0c40e2
|
|
| MD5 |
ea231cf3ac887197f7489e8ef85d6aea
|
|
| BLAKE2b-256 |
46216541129959f13a84730a2d0d29921509c52c9bd72c275694466ca3a54084
|
File details
Details for the file yv_languages-1.0.4-py3-none-any.whl.
File metadata
- Download URL: yv_languages-1.0.4-py3-none-any.whl
- Upload date:
- Size: 35.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f90153f8a26087cb901145bb1daea242a15568171dbfa1f24f82674f542ea1c
|
|
| MD5 |
adee05b169763f11ae1e7a76f45c2dfd
|
|
| BLAKE2b-256 |
b03fb9177406ee8ea1d10441531464b5b716f676de445ee89a88f889d506b108
|