Skip to main content

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 EUR and 1237,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.6

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

Source distribution (sdist)

Source distribution for atciparotajs 0.1.6
File Size Uploaded Provenance
atciparotajs-0.1.6.tar.gz 29.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for atciparotajs 0.1.6
File Interpreter ABI Platform
atciparotajs-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 52.1 kB

Release files / atciparotajs-0.1.6.tar.gz

Download URL atciparotajs-0.1.6.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5364948ab797df03fa1a6d6bc3c0d77faeb6249e9c9da4dec379aaedca097d60
BLAKE2b-256 checksum
How to use checksums
91089987c18dfe3a5c282d3ccd221dad298b228a650db049d37de3de77da7d87
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 9, 2026.

Transparency log

Release files / atciparotajs-0.1.6-py3-none-any.whl

Download URL atciparotajs-0.1.6-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7537f403747adb1f17fab24a23740428c706bbc13b495eca93fcb722b8fd8156
BLAKE2b-256 checksum
How to use checksums
7153a87a7bc5e40a16bb51407350cb15e35b8774d798789629dacab68a21ae61
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 9, 2026.

Transparency log

Security for atciparotajs 0.1.6

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.

Select from 2 files

Attestation for atciparotajs-0.1.6.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 9, 2026.

Transparency log

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.

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