countrystatecity Python packages provide access to countries, states, and cities data with full type hints, Pydantic models, and lazy loading. All data is bundled directly — no API key or network requests needed.
Always install using the suffixed package name (e.g.
countrystatecity-countries). There is no bare countrystatecity package on PyPI — pip install countrystatecity will not work.Available Packages
| Package | Status | Description |
|---|---|---|
countrystatecity-countries | Released | Countries, states, and cities with lazy loading |
countrystatecity-timezones | Coming soon | IANA timezone data and utilities |
countrystatecity-currencies | Coming soon | Currency codes, symbols, and formatting |
countrystatecity-languages | Coming soon | Language codes and metadata |
countrystatecity-phonecodes | Coming soon | International dialing codes and validation |
Installation
Usage
Countries
States
Cities
Country Details
Features
Type-safe
Full type hints with Pydantic models and mypy support.
Lazy loading
Data loads on first access and caches with LRU cache for minimal memory footprint.
Zero dependencies
Only requires Pydantic — no other external packages.
Full coverage
250+ countries, 5,299+ states, 153,765+ cities with coordinates and metadata.
Data Updates
To get the latest geographical data, update the package:Source
GitHub Repository
View source, open issues, or contribute.
PyPI
Browse the published package on PyPI.