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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

indpy_core-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: indpy_core-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 95addca77eed9c2b687d151ac7d18dcb3c2b9cb625e095743d1fa197c9e998c2
MD5 d03a0ffa37b3169226a9946e307778dd
BLAKE2b-256 fdb41ed4e6fa614822dad76adb602e333bbb74dbfce5fd3e141c75039d0d4bfe

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