Skip to main content

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"))

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_countries_states_cities_database-2.2.13.tar.gz (26.9 MB view details)

Uploaded Source

File details

Details for the file py_countries_states_cities_database-2.2.13.tar.gz.

File metadata

File hashes

Hashes for py_countries_states_cities_database-2.2.13.tar.gz
Algorithm Hash digest
SHA256 7ad071d0cc976e88d641b4c20faae18f6908c56039cbfaa84c04b7e0b1dcd9d9
MD5 30c5090ff0b5d9375bdc30d300675760
BLAKE2b-256 b518d54bfe4c680cecb2abf69cbec199e5b048759235db4f85f4f67e2ff39a23

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.2.13 This release

1 file

2.2.12

1 file

2.2.11

1 file

2.2.10

1 file

2.2.9

1 file

2.2.8

1 file

2.2.7

1 file

2.2.6

1 file

2.2.5

1 file

2.2.4

1 file

2.2.3

1 file

2.2.2

1 file

2.2.1

1 file

0.7

1 file

0.6

1 file

0.5

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page