Skip to main content

India package

deployment

Version 1.1.5

Installation

Installation Using pip

pip install pyindia

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>

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 cities of india with there attributes and states they belong to.
  • Added attributes to state objects including population, area and language.
  • Added cities string access.
  • Added states string access.
  • Added uts string access.
  • Added Jammu and Kashmir and Ladhakh as Union territories.
  • Release files for pyindia 1.1.5

    For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

    Source distribution (sdist)

    Source distribution for pyindia 1.1.5
    File Size Uploaded
    pyindia-1.1.5.tar.gz 150.7 kB Details

    Built distribution (wheel)

    Table of built distributions (wheels) for pyindia 1.1.5
    File Interpreter ABI Platform
    pyindia-1.1.5-py3-none-any.whl Python 3 none any Details

    Total release size: 303.3 kB

    Release files / pyindia-1.1.5.tar.gz

    Download URL pyindia-1.1.5.tar.gz
    Size 150.7 kB
    Tags Source
    SHA-256 checksum
    How to use checksums
    5ea3faaafc2788313c3a6cbb12df8e4b4ec5ea8fadd7dcba149559353d2b374c
    BLAKE2b-256 checksum
    How to use checksums
    308fffd8f95ffddc8fb29a4e2db785c33b547d4ad2850d7a9cc4eac0d9f48ac3
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

    Release files / pyindia-1.1.5-py3-none-any.whl

    Download URL pyindia-1.1.5-py3-none-any.whl
    Size 152.7 kB
    Tags Python 3
    SHA-256 checksum
    How to use checksums
    1bcbcf786272e893cba21233698ec07df646b34f6092afc8a62ec501fea74a3e
    BLAKE2b-256 checksum
    How to use checksums
    c182e4e55c41b55475cc8ae307dbf239351ea0d034612bcfe651ac6346a7ac4b
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

    Release history Release notifications | RSS feed

    This release

    1.1.5 This release

    2 release files

    1.1.4

    2 release files

    1.1.3

    2 release files

    1.1.2

    2 release files

    1.1.1

    2 release files

    1.1.0

    2 release files

    1.0.0

    2 release files

    Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page