Skip to main content

A comprehensive library for Indian Identity and Financial data validation.

Project description

indpy 🇮🇳

Python Version License Status

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-core

Note: The package name on PyPI is indpy-core, but you import it in Python as indpy.

Install for local development:

# Clone the repository (replace YOUR_USERNAME with your GitHub username if needed)
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")
else:
    print("Invalid 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
  1. 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"
  1. 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]$ No (Structure only; checksum planned v1.1)
GSTIN ^\d{2}[A-Z]{5}[0-9A-Z]{9}$ Yes (Modulo-36 checksum)
Mobile ^[6-9]\d{9}$ N/A
IFSC ^[A-Z]{4}0[A-Z0-9]{6}$ N/A
Vehicle ^[A-Z]{2}\d{1,2}[A-Z]{1,2}\d{1,4}$ N/A

Note: Regex shown are illustrative and may be refined in code. GSTIN validation includes official Modulo-36 checksum verification.

🤝 Contributing

Contributions are welcome! Typical workflow:

  1. Fork the repository.
  2. Create a feature branch:
    git checkout -b feature/NewValidation
    
  3. Commit your changes:
    git commit -m "Add Aadhaar support"
    
  4. 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.


⚠️ Don't forget

  1. Replace YOUR_USERNAME in the git clone link with your actual GitHub username.
  2. Push this change to GitHub so the front page updates immediately:
git add README.md
git commit -m "Update README formatting"
git push origin main

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

indpy_core-0.1.3.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

indpy_core-0.1.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file indpy_core-0.1.3.tar.gz.

File metadata

  • Download URL: indpy_core-0.1.3.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for indpy_core-0.1.3.tar.gz
Algorithm Hash digest
SHA256 184b04cab094dfa2366289fca8478d89fa00c44c0244a3bca65655e343bc61be
MD5 49f8ee4f461a09f2e6708d7f088fee24
BLAKE2b-256 654c3489c057efc5bcbcb2858fba2332abb2b138a14b0c7b5f20f09cc9021b56

See more details on using hashes here.

File details

Details for the file indpy_core-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: indpy_core-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for indpy_core-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2d478e971748843b8a76578d7578436b83dac2c1e0425d90128ab9e07c6462e1
MD5 93ffa6cceb8b8636f117b1420073cc16
BLAKE2b-256 bb8e1b39a9388dea5d9c3581128096d95fcdad26fe306f9f78785e3cd995a408

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page