https://github.com/integeralex/indiapincodefinder
IndiaPincodeFinder is a versatile module that helps you find detailed Indian address information by using a valid 6-digit PIN code.
https://github.com/integeralex/indiapincodefinder
india nodejs npm-package pincode pincode-finder pypi-package python
Last synced: about 1 month ago
JSON representation
IndiaPincodeFinder is a versatile module that helps you find detailed Indian address information by using a valid 6-digit PIN code.
- Host: GitHub
- URL: https://github.com/integeralex/indiapincodefinder
- Owner: IntegerAlex
- License: gpl-3.0
- Created: 2025-06-06T08:05:28.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-06-20T10:39:50.000Z (8 months ago)
- Last Synced: 2025-06-22T23:48:52.590Z (8 months ago)
- Topics: india, nodejs, npm-package, pincode, pincode-finder, pypi-package, python
- Language: Python
- Homepage:
- Size: 1000 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฎ๐ณ IndiaPincodeFinder
[](https://pepy.tech/projects/indiapincodefinder)

**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.
---
## ๐ฆ Features
- ๐ 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
---
## Python Package
### ๐ Installation (Python)
Install via `pip`:
```bash
pip install indiapincodefinder
```
### ๐ Usage (Python)
```python
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)
```
---
## JavaScript Package (Node.js)
### ๐ Installation (JavaScript)
Install via `npm`:
```bash
npm install india-pincode-finder
```
### ๐ Usage (JavaScript)
```javascript
// 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();
```
### API (JavaScript)
### pinToAddress(pincode: number): object | null
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.
### pinToState(pincode: number): string | null
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.
### pinToDistrict(pincode: number): string | null
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.
### pinToTaluka(pincode: number): string | null
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.
### clearCache(): void
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
### Caching Mechanism (JavaScript)
The package uses a two-level caching strategy for optimal performance:
1. **In-memory cache**: Provides the fastest access for frequently used data
2. **Disk cache**: Persists between application runs, improving startup performance
The cache is automatically invalidated when the source data file is modified.
## ๐ License
This project is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for details.
For commercial use without GPL compliance, please contact the authors for licensing options.
## Copyright
[@IntegerAlex](https://github.com/IntegerAlex)
[@AniketDhumal](https://github.com/Aniket-Dhumal)
## ๐ Disclaimer
This project is for educational purposes only. The data is sourced from public databases.
## ๐ Contact
For any questions or feedback, please contact [@IntegerAlex](mailto:inquiry.akshatkotpalliwar@gmail.com) or [@AniketDhumal](mailto:anikethd1410@gmail.com).