transliteration-ua
Ukrainian transliteration by official rules
https://zakon.rada.gov.ua/laws/show/55-2010-п
Installation
pip install transliteration-ua
Example
To use transliteration-ua, import the transliterate_ua function and pass a Ukrainian string to
it:
from transliteration_ua import transliterate_ua
# Basic usage
print(transliterate_ua("Привіт, Світ!"))
# Pryvit, Svit!
# Names are transliterated correctly
print(transliterate_ua("Андрій"))
# Andrii
# Words with an apostrophe are also handled
print(transliterate_ua("Короп'є"))
# Koropie
Custom transliteration function
If you need to create your own transliteration function with custom rules, you can use
the make_transliterate_func factory. It accepts two mapping arguments: replacements for
general character mappings and first_char_replacements for special mappings that apply only
to the first letter of a word.
Here's how you can create a simplified transliterator:
from transliteration_ua import make_transliterate_func
# Define custom replacement rules
simple_replacements = {
"а": "a",
"б": "b",
"в": "v",
# ...
# all the Ukrainian alphabet need to be defined here
}
# No special first character rules for this example
first_char_replacements = {}
# Create the custom function
simple_transliterate = make_transliterate_func(
simple_replacements,
first_char_replacements,
)
# Use it
print(simple_transliterate("баба"))
# baba
Development
Making Changes
-
List available
makecommands:make help
-
Check code style with:
make lint -
Run tests using:
make test
-
Manage dependencies via Poetry:
make poetry args="<poetry-args>"
- For example:
make poetry args="add picodi"
- For example:
-
For local CI debugging:
make run-ci
Pre-commit Hooks
We use pre-commit for linting and formatting:
- It runs inside a Docker container by default.
- Optionally, set up hooks locally:
pre-commit install
Mypy
We use mypy for static type checking.
It is configured for strictly typed code, so you may need to add type hints to your code.
But don't be very strict, sometimes it's better to use Any type.
License
Credits
This project was generated with
yakimka/cookiecutter-pyproject.
Metadata
Release files for transliteration-ua 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| transliteration_ua-0.2.0.tar.gz | 4.9 kB | Without provenance | Details for transliteration_ua-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| transliteration_ua-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for transliteration_ua-0.2.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / transliteration_ua-0.2.0.tar.gz
| Download URL | transliteration_ua-0.2.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3afc81910b6b466ff5b8b3e10d97c77bc641e59bf696a7eb21933b6fb639a779
|
|
BLAKE2b-256 checksum How to use checksums |
8d3e1e3c93a7b072c2a610313c00ed0c04b5d6fcd5a489b6845ed39592e9f86c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.0 CPython/3.12.10 Linux/6.11.0-1018-azure
|
Release files / transliteration_ua-0.2.0-py3-none-any.whl
| Download URL | transliteration_ua-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5d2edcf69396149541249b7505a90866d8ad51aba0c6a7cd2e8ef17da51c5dc
|
|
BLAKE2b-256 checksum How to use checksums |
5dedaac57dc7bb8000c80a01e6d913d29668a1810eda0092d84b2e3362362f92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.0.0 CPython/3.12.10 Linux/6.11.0-1018-azure
|
Security for transliteration-ua 0.2.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.