countrystatecity-translations
Official Python package for 4,724 country-name translations covering 250 countries across 19 languages. Part of the countrystatecity ecosystem.
From offline prototype to production
This package provides a versioned offline snapshot. For regularly updated data, server-side search and filtering, field-selected responses, or managed availability and support, use the Country State City API.
Get a free API key · API docs · Pricing · Migration guide
Keep API keys in server-side environment variables, never in client-side code or source control.
Installation
pip install countrystatecity-translations
Quick Start
from countrystatecity_translations import (
get_all_translations,
get_translations_by_country,
get_translations_by_language,
get_translation,
search_translations,
)
# Get all translation entries
translations = get_all_translations()
# [Translation(countryCode="AF", lang="fr", translation="Afghanistan", ...), ...]
# Get all translations for a country (all 19 languages)
de_translations = get_translations_by_country("DE")
# [Translation(countryCode="DE", lang="fr", translation="Allemagne", ...), ...]
# Get all countries translated into a specific language
french = get_translations_by_language("fr")
# [Translation(lang="fr", translation="Afghanistan", ...), ...]
# Lookup a single translation
t = get_translation("DE", "fr")
# Translation(countryCode="DE", countryName="Germany", lang="fr", translation="Allemagne")
# Search translated names
results = search_translations("Allemagne")
Data Model
class Translation(BaseModel):
countryCode: str # ISO2 country code (e.g., "DE")
countryName: str # English country name (e.g., "Germany")
lang: str # Language code (e.g., "fr")
translation: str # Translated country name (e.g., "Allemagne")
Supported Languages
| Code | Language | Code | Language |
|---|---|---|---|
ar |
Arabic | ko |
Korean |
br |
Breton | nl |
Dutch |
de |
German | pl |
Polish |
es |
Spanish | pt |
Portuguese |
fa |
Persian | pt-BR |
Portuguese (Brazil) |
fr |
French | ru |
Russian |
hi |
Hindi | tr |
Turkish |
hr |
Croatian | uk |
Ukrainian |
it |
Italian | zh-CN |
Chinese (Simplified) |
ja |
Japanese |
API Reference
| Function | Description |
|---|---|
get_all_translations() |
Get all translation entries |
get_translations_by_country(code) |
Get all language translations for a country |
get_translations_by_language(lang) |
Get all countries translated into a language |
get_translation(code, lang) |
Get a single country-language translation |
search_translations(query) |
Search by translated name or English country name |
License
ODbL-1.0 — see LICENSE.
Other Packages in this Ecosystem
| Package | Description |
|---|---|
| countrystatecity-countries | 250 countries, 5,308 states, 171,938 cities |
| countrystatecity-timezones | 432 IANA timezones with country associations and time conversion |
| countrystatecity-currencies | 249 country/currency associations |
| countrystatecity-phonecodes | International phone/dialing codes for 250 countries |
| countrystatecity-regions | Region and subregion associations for 250 countries |
| countrystatecity-postal-codes | Postal/ZIP records for 125 countries |
Data sourced from countries-states-cities-database.
Made with ❤️ by dr5hn
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file countrystatecity_translations-1.0.5.tar.gz.
File metadata
- Download URL: countrystatecity_translations-1.0.5.tar.gz
- Upload date:
- Size: 60.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02e5284deb6326e8d90b7aa3b9f18e473e3c65f4322d1440568af5efd5462f6d
|
|
| MD5 |
8b43a903c85ddf1ea1c2d71647833e1b
|
|
| BLAKE2b-256 |
bcbdbaa0d7e5e5453c0a23298adbd47c7aa304540e6560855972b2a866929fcd
|
File details
Details for the file countrystatecity_translations-1.0.5-py3-none-any.whl.
File metadata
- Download URL: countrystatecity_translations-1.0.5-py3-none-any.whl
- Upload date:
- Size: 59.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e03d0635a2f0eb438d86572c8b1e36e78d2eff2aedc9f48ce6adfecea9f68edb
|
|
| MD5 |
4c24a9d61adf2a5ce0912aeec6f78e1d
|
|
| BLAKE2b-256 |
15ae63c151c6ef9b95bbcb99e813e158e212e0c8da27be2d267ebe41a29df156
|