A Python package to get countries, states and cities information
Project description
API 🚀
🎉 Introducing API for Countries States Cities Database.
📦 Installation
pip install py-countries-states-cities-database
📚 Usage
from py_countries_states_cities_database import (
get_all_cities,
get_all_states,
get_all_countries,
get_all_sub_regions,
get_all_regions,
get_all_states_and_cities_nested,
get_all_countries_and_states_nested,
get_all_countries_and_cities_nested,
get_file_path
)
# All functions return a list of dictionaries
print(get_all_cities())
print(get_all_states())
print(get_all_countries())
print(get_all_sub_regions())
print(get_all_regions())
print(get_all_states_and_cities_nested())
print(get_all_countries_and_states_nested())
print(get_all_countries_and_cities_nested())
# File name options
| "cities.json"
| "states.json"
| "countries.json"
| "subregions.json"
| "regions.json"
| "countries+cities.json"
| "countries+states.json"
| "states+cities.json"
| "countries+states+cities.json",
# Get the file path
print(get_file_path("cities.json"))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for py_countries_states_cities_database-2.2.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f46eab0907ee939200f2e89e0cd40feae385a3e13aac2e200fc1f89e548ade69 |
|
MD5 | 490000b8a120b9e0b16fb24aa4a38713 |
|
BLAKE2b-256 | 9c7005e5dd66c282331cd7d8b57d46d34b6357c9657f886875f0cd87aa020676 |