Atciparotājs
Latvian text preprocessor for TTS engines. Converts digits, numbers, and abbreviations to spoken Latvian words.
Numbers are inflected to agree in gender and grammatical case with the following noun.
Features
- Cardinal numbers —
5 grami→pieci grami - Ordinal numbers —
5. maijs→piektais maijs - Roman numerals —
XIV gs.→četrpadsmitais gadsimts - Decimals/fractions —
21,5 grami→divdesmit viens komats pieci grami - Currency —
1237,06 EURand1237,06 €→tūkstoš divsimt trīsdesmit septiņi eiro un seši centi - Temperature —
+14…+15 °C→plus četrpadsmit līdz plus piecpadsmit grādi - Abbreviation expansion —
gs.→gadsimts,km.→kilometrs, and more - Phone numbers — spelled out digit by digit
{phone:67030638}→seši septiņi nulle trīs nulle seši trīs astoņi
Installation
pip install atciparotajs
Usage
Python API
from atciparotajs import convert
convert("5. maijs") # → "piektais maijs"
convert("2 draugiem") # → "diviem draugiem"
convert("XIV gs.") # → "četrpadsmitais gadsimts"
convert("21,5 grami") # → "divdesmit viens komats pieci grami"
# Disable abbreviation expansion
convert("14. gs.", expand_abbr=False) # → "četrpadsmitais gs."
# Disable Roman numeral expansion
convert("XIV gs.", no_roman=True) # → "XIV gadsimts"
Command line
# Direct argument
atciparotajs "5. maijs"
# Piped input
echo "2 draugiem" | atciparotajs
# Disable abbreviation expansion
atciparotajs --no-expand-abbr "14. gs."
# Disable Roman numeral expansion
atciparotajs --no-roman "XIV gs."
# Print the version
atciparotajs --version
Phone numbers
Phone numbers are detected automatically and read digit by digit:
atciparotajs "tel. 67 030 638" # → "seši septiņi nulle trīs nulle seši trīs astoņi"
atciparotajs "mob: 67030638" # → "seši septiņi nulle trīs nulle seši trīs astoņi"
atciparotajs "+371 67 030 638" # → "seši septiņi nulle trīs nulle seši trīs astoņi"
Recognized prefixes: tel, tel., tel:, mob, mob., mob:, and +371.
For plain digit strings that should be read as phone numbers rather than as a number,
use the explicit {phone:…} markup:
atciparotajs "{phone:67030638}" # → "seši septiņi nulle trīs nulle seši trīs astoņi"
Without the markup, a bare 67030638 would be read as the cardinal number.
Use {phone:…} whenever you want digit-by-digit pronunciation for a number that has
no recognizable phone prefix.
Running tests
pytest tests/test_numbers.py -v
For test cases covered see test list
Testing with TTS
For real life TTS testing go to Latvian-Piper-TTS
License
MIT
Metadata
Release files for atciparotajs 0.1.7
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 | |
|---|---|---|---|---|
| atciparotajs-0.1.7.tar.gz | 34.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| atciparotajs-0.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.7 kB
Release files / atciparotajs-0.1.7.tar.gz
| Download URL | atciparotajs-0.1.7.tar.gz |
|---|---|
| Size | 34.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8c4c7882682fd4c907ac1da4f212af3615d67f8f5cad75fdb38460f524f16d8
|
|
BLAKE2b-256 checksum How to use checksums |
56cb50144297eaed7cc03abccf99124019bf84ebc8a668974c7b31b44fdf2f8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logRelease files / atciparotajs-0.1.7-py3-none-any.whl
| Download URL | atciparotajs-0.1.7-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54ca086a9db7cf2eb2bd9718be4d5f71f333812e89d425bfe67e5d95a64b93f5
|
|
BLAKE2b-256 checksum How to use checksums |
fe19e235419beecae5431a023df705aaf6fe2a7db5fbfd8078cbbeaaee39fda5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logSecurity for atciparotajs 0.1.7
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for atciparotajs-0.1.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 10, 2026.
Transparency logA 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.