first commit

This commit is contained in:
debu-2 2026-10-02 11:22:40 +05:30
commit efa5080897
127 changed files with 18610 additions and 0 deletions

View file

@ -0,0 +1,26 @@
import re
PAN_PATTERN = re.compile(r"^[A-Z]{5}[0-9]{4}[A-Z]$")
GST_PATTERN = re.compile(r"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][1-9A-Z]Z[0-9A-Z]$")
def normalize_pan(value: str) -> str:
return value.strip().upper()
def normalize_gst(value: str) -> str:
return value.strip().upper()
def validate_pan(value: str) -> str:
pan = normalize_pan(value)
if not PAN_PATTERN.match(pan):
raise ValueError("PAN must match format ABCDE1234F")
return pan
def validate_gst(value: str) -> str:
gst = normalize_gst(value)
if not GST_PATTERN.match(gst):
raise ValueError("GST must be a valid 15-character Indian GSTIN")
return gst