Registry / serialization / pytils

pytils

JSON →
library0.4.4pypypi✓ verified 86d ago

Python library for Russian-specific string utilities, including numeral, date, and transliteration helpers. Current version 0.4.4 (released June 2021), with infrequent updates; considered in maintenance mode.

pip install pytils
INSTALL
IMPORT
SIG · PYTILS
P
pytils
serializationpythonv0.4.4
Install
1.5s avg
Import
20ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.024s · 18.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.016s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

numeral
from pytils import numeral
import pytils.numeral
Correct import uses the module name directly, not as a subpackage of pytils.
dt
from pytils import dt
import pytils.dt
dt is a module, not a subpackage; import directly.
translit
from pytils import translit
from pytils.translit import to_latin
to_latin, to_cyrillic etc. are functions inside the module; import module then call.

Basic usage of numeral, dt, and translit modules.

from pytils import numeral, dt, translit # Numeral: sum in words (Russian) print(numeral.get_plural(21, "копейка", "копейки", "копеек")) # 21 копейка # Date: distance of time in Russian print(dt.distance_of_time_in_words(3600)) # около 1 часа # Transliteration: Russian to Latin print(translit.to_latin("Привет, мир!")) # Privet, mir! # Transliteration: Latin to Russian print(translit.to_cyrillic("Privet, mir!")) # Привет, мир!
Debug
Known issues
deprecatedpytils.numeral.choose_plural is deprecated; use get_plural instead.
fix
Replace numeral.choose_plural(...) with numeral.get_plural(...).
affects: >=0.4.0
gotchaImport paths are confusing: do NOT use pytils.numeral, pytils.dt, etc. as dotted subpackages. Import directly as 'from pytils import numeral'.
fix
Use 'from pytils import numeral' instead of 'import pytils.numeral'.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pytils.numeral'
Trying to import pytils.numeral as a subpackage instead of module.
fix
Use 'from pytils import numeral'.
AttributeError: module 'pytils' has no attribute 'numeral'
Using 'import pytils' then accessing 'pytils.numeral' but the module is not imported.
fix
Use 'from pytils import numeral' explicitly.
Upgrade
Version history
0.4.4latest on PyPI · released Jul 29, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pytils — pip install pytils · libregistry