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
  • 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.5

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.5
File Size Uploaded Provenance
atciparotajs-0.1.5.tar.gz 25.6 kB With provenance Details

Built distribution (wheel)

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

Total release size: 45.2 kB

Release files / atciparotajs-0.1.5.tar.gz

Download URL atciparotajs-0.1.5.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ae6c491db76ca6f8ce7c785a51fff9d34006c41c2c3a3f7f48e45af2eb242876
BLAKE2b-256 checksum
How to use checksums
59441b07ffac512ea23dab36b0f325082e5e90dc7f6df5807714668bea630b10
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 Aug 28, 2026.

Transparency log

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

Download URL atciparotajs-0.1.5-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2364aab10136fdd0a48096e61c18604f3b5b476e44e1e5f2c458f214afd31cc
BLAKE2b-256 checksum
How to use checksums
1336fd28065195dae82fc1f383afe6a13c2cf5c840f86f7fefab39364b59025d
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 Aug 28, 2026.

Transparency log

Security for atciparotajs 0.1.5

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.5.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 Aug 28, 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