Skip to main content

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

Metadata

Release files for yv-languages 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yv-languages 1.1.0
File Size Uploaded Provenance
yv_languages-1.1.0.tar.gz 38.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yv-languages 1.1.0
File Interpreter ABI Platform
yv_languages-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 73.6 kB

Release files / yv_languages-1.1.0.tar.gz

Download URL yv_languages-1.1.0.tar.gz
Size 38.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5879bcc389f5006869c9ad8b6aaf6648e04e42bfa634217fad13db939cba9f42
BLAKE2b-256 checksum
How to use checksums
db8b10c71ee38b6e508a6d1135e7c483928d0ee84c3158ce6487cc50c691667a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / yv_languages-1.1.0-py3-none-any.whl

Download URL yv_languages-1.1.0-py3-none-any.whl
Size 35.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72f03c15ca8cf3486dce95e2fde45710dca337cecabe623df0f1dd24c767e47c
BLAKE2b-256 checksum
How to use checksums
e1248a3babfc895cdd9b9c30538242002f0e052c34b9f9a0fb294869210c0a6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for yv-languages 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page