Skip to main content

pk-address-checker

Lenient, deterministic Pakistan business-address checker. The registry database (CSVs) ships inside this package — install and check offline, no downloads, no update run required.

pip install .        # or a release wheel
from pk_address_checker import check_address, is_valid_address

result = check_address("Shop 12, Tehsil Mankera, Rahim Yar Khan")
print(result["valid"])          # False
print(result["reason_codes"])   # ['tehsil_city_conflict']

is_valid_address("Street 5, Gulistan-e-Johar, Karachi")  # True
  • Stdlib only for checking addresses (re, csv, difflib); Python 3.8+. pdfplumber (installed automatically as a dependency) powers the data-update pipeline's PDF parsers.
  • Ambiguity never causes rejection — only stated contradictions reject.
  • Refresh the bundled data later with python -m pk_address_checker update. Set PK_ADMIN_DATA_DIR to point the data folder somewhere writable if needed.

Using a different data folder

Set the PK_ADMIN_DATA_DIR environment variable before importing pk_address_checker. It is read once, at import time. You only need it if the installed data folder is not writable for update, or to share data between projects — when set, both address checking and update use that folder.

  • PowerShell: $env:PK_ADMIN_DATA_DIR = "C:\pkdata"
  • Python, before the import: os.environ["PK_ADMIN_DATA_DIR"] = r"C:\pkdata"

Metadata

Release files for pk-address-checker 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pk-address-checker 1.0.0
File Size Uploaded
pk_address_checker-1.0.0.tar.gz 116.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pk-address-checker 1.0.0
File Interpreter ABI Platform
pk_address_checker-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 233.3 kB

Release files / pk_address_checker-1.0.0.tar.gz

Download URL pk_address_checker-1.0.0.tar.gz
Size 116.2 kB
Tags Source
SHA-256 checksum
How to use checksums
57505ad8b82c51d3af567419ac772727c84175f824db080eb0d1da3e1a0cd86d
BLAKE2b-256 checksum
How to use checksums
46894055d49a0e8a8a9fe7ed025164e1db37f78f12c0d5a6fe2f74a13a1be0d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pk_address_checker-1.0.0-py3-none-any.whl

Download URL pk_address_checker-1.0.0-py3-none-any.whl
Size 117.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60b2061cd3410923ef0fcea5618a81b908fad5f8f4974547b617387c8dd2c4b4
BLAKE2b-256 checksum
How to use checksums
8eb59e386e5ac2fd3482dc14b7d5d1cbedfdcfca1dcdbaba0a2e7031e2413909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page