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."

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.4

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.4
File Size Uploaded Provenance
atciparotajs-0.1.4.tar.gz 25.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 44.9 kB

Release files / atciparotajs-0.1.4.tar.gz

Download URL atciparotajs-0.1.4.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
16b6fff4b17958efb42b41cba7aace0f00ababae9651aa0552cab0fb6b0bbde7
BLAKE2b-256 checksum
How to use checksums
41ab0313dacb222558030f4596ebacaf046667ff062895b5e7557dfbe65be3a3
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.4-py3-none-any.whl

Download URL atciparotajs-0.1.4-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03a295f973920828dbd14bfd90f5973309c1c8b1ea1bd748567186a53881f6bb
BLAKE2b-256 checksum
How to use checksums
78aefb1c2bbf3250ebdfcafce89c05acfffdaa3696a3f341ac38762f75e013d3
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.4

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.4.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