Pending Tasks
- Writing Development Docs/Guide
- Pushing to PIP
- Language Specefic Development
IndiaPincodeFinder is a versatile module available in both Python and JavaScript (Node.js) that helps you find detailed Indian address information by using a valid 6-digit PIN code. It's ideal for use in logistics, address validation, fintech onboarding (KYC), e-commerce, and mapping services.
- ๐ Lookup addresses by PIN code (Postal Index Number)
- ๐งพ Returns location metadata: state, district, taluka.
- โก Fast lookup with offline JSON dataset (no API call needed)
- ๐งฉ Plug-and-play for both Python and Node.js applications
Install via pip
:
pip install indiapincodefinder
import indiapincodefinder
# Get address by Pincode
address = indiapincodefinder.pin_to_address(pincode=400001)
# Get state by Pincode
state = indiapincodefinder.pin_to_state(pincode=400001)
# Get district by Pincode
district = indiapincodefinder.pin_to_district(pincode=400001)
# Get taluka by Pincode
taluka = indiapincodefinder.pin_to_taluka(pincode=400001)
Install via npm
:
npm install india-pincode-finder
// CommonJS
const {
pinToAddress,
pinToState,
pinToDistrict,
pinToTaluka,
clearCache
} = require('india-pincode-finder');
// ES Modules
import {
pinToAddress,
pinToState,
pinToDistrict,
pinToTaluka,
clearCache
} from 'india-pincode-finder';
// Get the full address details for a pincode
console.log(pinToAddress(411001));
// Output: { district: 'Pune', block: 'Pune City', state: 'Maharashtra' }
// Get the state for a pincode
console.log(pinToState(411001));
// Output: 'Maharashtra'
// Get the district for a pincode
console.log(pinToDistrict(411001));
// Output: 'Pune'
// Get the taluka/block for a pincode
console.log(pinToTaluka(411001));
// Output: 'Pune City'
// Clear the cache (useful if your application needs to refresh data)
clearCache();
Get full address details for a pincode.
- pincode: 6-digit PIN code (number)
-
Returns:
-
object
: An object like{ district: string; block: string; state: string; }
if found. -
null
: If no data is found for the given pincode.
-
Get state for a pincode.
- pincode: 6-digit PIN code (number)
-
Returns:
-
string
: The name of the state if found. -
null
: If no data is found for the given pincode.
-
Get district for a pincode.
- pincode: 6-digit PIN code (number)
-
Returns:
-
string
: The name of the district if found. -
null
: If no data is found for the given pincode.
-
Get taluka/block for a pincode.
- pincode: 6-digit PIN code (number)
-
Returns:
-
string
: The name of the taluka/block if found. -
null
: If no data is found for the given pincode.
-
Clears both the in-memory and disk cache.
- Returns: Nothing (void)
- Use case: Call this method if you want to force a fresh load of data from the source JSON file
The package uses a two-level caching strategy for optimal performance:
- In-memory cache: Provides the fastest access for frequently used data
- Disk cache: Persists between application runs, improving startup performance
The cache is automatically invalidated when the source data file is modified.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For commercial use without GPL compliance, please contact the authors for licensing options.
This project is for educational purposes only. The data is sourced from public databases.
For any questions or feedback, please contact @IntegerAlex or @AniketDhumal.