Skip to main content

India's states and cities

Project description

India package

deployment

Version 1.1

Installation

Installation Using pip

pip install indian-states

Running Tests

python -m unittest discover -s tests

Usage

This repository makes it easy to access metadata of states and union territories of India.

>>> import india
>>> india.states.AR
OUT: <State: Arunachal Pradesh>

You can also lookup whether your input is state or not.

>>> import india
>>> india.states.lookup('arunachal pradesh')
OUT: <State: Arunachal Pradesh>

New release enables you to access districts/cities across india with several attributes

>>> import india
>>> india.cities.KA_BLR
OUT: <City: Bangalore>

New release enables you to track post offices based on pincode

>>> from india import pincodes
>>> pincodes.lookup('691522')
OUT: ['Panthaplavu B.O', 'Pattazhy S.O', 'Thekketheri B.O']

Lookup for cities

>>> import india
>>> india.cities.lookup('Bangalore')
OUT: <City: Bangalore>

Check whether the city is capital

>>> import india
>>> india.cities.lookup('Bangalore').iscapital()
OUT: True

Attributes

Attributes of state object

state.name       # name of the state
state.capital    # returns the capital of that state
state.population # returns the population of the state
state.area       # returns the area of state in km^2
state.density    # returns population density per km^2 of state
state.language   # primary official language of the state

Attributes of Cities object

city.name       # name of the city
city.state      # returns the state of city
city.population # returns the population of the city
city.area       # returns the area of the district
city.density    # returns population density per km^2 of the city
city.url        # returns official webpage of the city

Release Notes

  • Added option to list all post offices under given pincode
  • Project details


    Download files

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

    Source Distribution

    indian-states-1.1.tar.gz (1.6 MB view details)

    Uploaded Source

    File details

    Details for the file indian-states-1.1.tar.gz.

    File metadata

    • Download URL: indian-states-1.1.tar.gz
    • Upload date:
    • Size: 1.6 MB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/4.0.2 CPython/3.8.7

    File hashes

    Hashes for indian-states-1.1.tar.gz
    Algorithm Hash digest
    SHA256 d0509bf94958ad708ec12de3be3204821df44813f733561f5adf69cadf4ecaf1
    MD5 6cbadaac5eada35fa4d477648aeaa860
    BLAKE2b-256 4e2a1e136a8f5d048dd9fe7b5cc9bcdb84e05504c6a89ea0ed14b5b6245678ba

    See more details on using hashes here.

    Supported by

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