{"id":6274,"library":"transliterate","title":"Transliterate","description":"Transliterate is a bi-directional transliterator for Python (version 1.10.2) that converts Unicode strings according to rules defined in various language packs. It supports languages such as Armenian, Bulgarian, Georgian, Greek, Macedonian, Mongolian, Russian, Serbian, and Ukrainian. The library also includes utility functions like a lorem ipsum generator, basic language detection, and a slugify function. While the last significant release was in 2018, the library remains active and functional, providing a stable solution for transliteration needs.","status":"active","version":"1.10.2","language":"en","source_language":"en","source_url":"https://github.com/barseghyanartur/transliterate","tags":["transliteration","nlp","i18n","unicode","language"],"install":[{"cmd":"pip install transliterate","lang":"bash","label":"Install latest stable version from PyPI"}],"dependencies":[],"imports":[{"symbol":"translit","correct":"from transliterate import translit"},{"symbol":"get_available_language_codes","correct":"from transliterate import get_available_language_codes"},{"note":"Required before registering custom language packs if bundled packs are also to be used.","symbol":"autodiscover","correct":"from transliterate import autodiscover"},{"symbol":"transliterate_function","correct":"from transliterate.decorators import transliterate_function"}],"quickstart":{"code":"from transliterate import translit, get_available_language_codes\n\ntext = \"Hello, world! Привет, мир!\"\n\n# Transliterate to Russian\nru_text = translit(text, 'ru')\nprint(f\"English to Russian: {ru_text}\")\n\n# Transliterate from Russian back to Latin (reversed)\nlatin_text = translit(ru_text, 'ru', reversed=True)\nprint(f\"Russian to Latin (reversed): {latin_text}\")\n\n# Get available language codes\navailable_languages = get_available_language_codes()\nprint(f\"Available languages: {available_languages}\")","lang":"python","description":"This quickstart demonstrates basic bi-directional transliteration between English (Latin script) and Russian (Cyrillic script), and how to list all available language packs."},"warnings":[{"fix":"Be aware that lorem ipsum generation might behave differently on Python 3 compared to Python 2, with potentially reduced features from the original `lorem-ipsum-generator`.","message":"The bundled 'lorem ipsum generator' has compatibility issues with Python 3, so `transliterate` uses a simplified fallback generator in Python 3 environments.","severity":"gotcha","affected_versions":"All Python 3 versions"},{"fix":"For critical applications requiring accurate language detection, consider using dedicated, more sophisticated NLP libraries for language identification.","message":"The library's language detection is described as 'very basic' and relies solely on character sets. It may not be robust for complex scenarios or subtle language distinctions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always specify `language_code` for reversed transliterations if performance is a concern: `translit(value, language_code='xx', reversed=True)`.","message":"When performing reversed transliterations (e.g., from Cyrillic to Latin), omitting the `language_code` parameter is possible, but explicitly providing it will result in faster execution.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Call `autodiscover()` early in your application lifecycle if you rely on bundled language packs. Carefully manage custom language pack registration, especially with the `force` argument.","message":"When defining and registering custom language packs, `autodiscover()` must be called before custom packs are registered if you intend to use the library's bundled language packs alongside your own. Additionally, language packs registered with `force=True` cannot be replaced or unregistered later.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}