Skip to main content

indian-pincode (core)

Offline-first Indian pincode validation and pincode → state/district lookup for Python. No runtime network calls. For post offices, coordinates, and geospatial search, install the geo extra: pip install "indian-pincode[geo]".

Requires Python >=3.10.

Which package do I need?

You need… Install
Validation, pincode → state/district(s), lists indian-pincode (this package)
Post offices, coordinates, nearby search, reverse lookup indian-pincode[geo]

Usage

import indian_pincode as pincode

print(pincode.validate("110001"))         # True
print(pincode.is_well_formed("999999"))   # True
print(pincode.get_state("560001"))        # KARNATAKA
print(pincode.get_districts("110001"))    # ['NEW DELHI']

get_details(pin) returns {pincode, state, states, state_source, districts} — state is the primary state (most post offices; ties alphabetical) and states lists every state the pincode touches (more than one only for ~52 cross-state pincodes). Also: list_states(), list_districts(state), get_pincodes(state=..., district=...), is_well_formed(pin) (format only) vs validate(pin) (exists in the dataset), and preload() to load eagerly. Keys are snake_case.

Data freshness

DATA_VERSION is the India Post snapshot date (currently 2025.10.03, from the dataset's updated_date). Upstream content has not changed since October 2025; releases are content-gated, so the data updates when India Post actually revises it — not on a fixed monthly cadence.

License

  • Code: MIT.
  • Data: derived from India Post / data.gov.in under GODL-India (attribution required) — see DATA_LICENSE.md.

Metadata

Release files for indian-pincode 2.0.0

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

Source distribution (sdist)

Source distribution for indian-pincode 2.0.0
File Size Uploaded
indian_pincode-2.0.0.tar.gz 33.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for indian-pincode 2.0.0
File Interpreter ABI Platform
indian_pincode-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.8 kB

Release files / indian_pincode-2.0.0.tar.gz

Download URL indian_pincode-2.0.0.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd7c4b8f6c3f23bedd7e7ba1ab8a4a483c9c9f8452401a19c272bbfb906c4e64
BLAKE2b-256 checksum
How to use checksums
d9e5ef3fa2f6cd13c99f8e83ff3d777c873f0f545f4d8645db47a7e6f048a28a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / indian_pincode-2.0.0-py3-none-any.whl

Download URL indian_pincode-2.0.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3a80f057386b2ae6bd387182e6e88168f5d2482aa5555be39601e308cfd65c7
BLAKE2b-256 checksum
How to use checksums
9c58c9ca2fa3b43c4cd8a9e81af11689da2da1b9d82c8c88ca02b05f2bba51c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

2.1.0

2 release files

2.0.1

2 release files

This release

2.0.0 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

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