A comprehensive library for Indian Identity and Financial data validation.
Project description
indpy 🇮🇳
indpy is a Python library for validating and generating Indian government documents and financial identifiers. It implements official checksum algorithms (where applicable) to ensure data integrity.
🚀 Features
✅ Validation
- PAN Card: structure validation.
- GSTIN: structure + Modulo-36 checksum verification.
- Mobile Number: Indian 10-digit format (starts with 6–9).
- IFSC Code: bank branch code validation.
- Vehicle (RC) Number: standard RTO formats (e.g., DL01CA1234).
- UPI ID: standard handle validation.
🎲 Data generation (mock data)
- Generate valid PAN numbers for testing.
- Generate valid mobile numbers.
- Generate random vehicle registration numbers.
📦 Installation
Install from PyPI:
pip install indpy
Install for local development:
git clone https://github.com/YOUR_USERNAME/indpy.git
cd indpy
pip install -e .
💻 Usage
1) Python — Validation
from indpy import is_pan, is_gstin, is_vehicle
# Validate PAN
if is_pan("ABCDE1234F"):
print("Valid PAN")
# Validate GSTIN (includes checksum)
if is_gstin("29ABCDE1234F1Z5"):
print("Valid GSTIN")
else:
print("Invalid GSTIN or checksum mismatch")
# Validate Vehicle registration
print(is_vehicle("UP16Z5555")) # True or False
2) Python — Generating mock data
from indpy import Generate
# Random PAN
print(Generate.pan()) # e.g. "BPLPZ5821K"
# Random Mobile
print(Generate.mobile()) # e.g. "9876123450"
# Random Vehicle
print(Generate.vehicle()) # e.g. "DL04CA9921"
3) Command line interface
Check version:
indpy --version
Validate a document:
indpy check pan ABCDE1234F
# Output: ✅ PAN Validation Result: True
Generate fake data:
indpy gen pan
# Output: ABCDE1234F
indpy gen vehicle
# Output: DL04CA9921
🛠️ Supported documents
| Document | Regex / Logic (approx.) | Checksum implemented? |
|---|---|---|
| PAN | [A-Z]{5}[0-9]{4}[A-Z]{1} |
❌ (structure only; checksum planned v1.1) |
| GSTIN | \d{2}[A-Z]{5}[0-9A-Z]{9} (Modulo-36 checksum) |
✅ |
| Mobile | [6-9]\d{9} |
N/A |
| IFSC | [A-Z]{4}0[A-Z0-9]{6} |
N/A |
| Vehicle (RC) | [A-Z]{2}\d{1,2}[A-Z]{1,2}\d{1,4} (varies by state) |
N/A |
Note: Regex shown are illustrative and may be refined in code. GSTIN validation includes official Modulo-36 checksum verification.
🤝 Contributing
Contributions welcome. Typical workflow:
- Fork the repository.
- Create a feature branch: git checkout -b feature/NewValidation
- Commit your changes: git commit -m "Add Aadhaar support"
- Push and open a pull request.
Please follow the existing code style and include tests for new validations.
📄 License
Distributed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file indpy_core-0.1.1.tar.gz.
File metadata
- Download URL: indpy_core-0.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
318c5f8eb46824ddedc4f7e52400de6fd9ffd5aae1f34ae6dd7c042c2ef85a6f
|
|
| MD5 |
422bf5786b12da77cb68cda166e007c1
|
|
| BLAKE2b-256 |
cc9f0ff82bb70a0de6dbf96bfb850fba459f5a0ca71b6d9026cc77da1585881f
|
File details
Details for the file indpy_core-0.1.1-py3-none-any.whl.
File metadata
- Download URL: indpy_core-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bb3f98306fa015d4d3e10953b69334b2cb3534c069c5dbc3c154a0022a5c470
|
|
| MD5 |
6298cf2c1057ba1b20853e0bca518dbf
|
|
| BLAKE2b-256 |
7d29513bcafa7c467ec2a98f990c431b62379b4cac12604621a906bb5462a22b
|