A Python module for encoding and decoding DIGIPIN, an alphanumeric representation of latitude and longitude as per final specification of DIGIPIN.
Project description
DIGIPIN Python Implementation - Unofficial Version
DIGIPIN is a geocoding system developed by India Post in collaboration with IIT Hyderabad. It divides India's geographical territory into uniform 4-meter by 4-meter units, assigning each a unique 10-character alphanumeric code derived from latitude and longitude coordinates. This system enhances address precision, facilitating efficient delivery of public and private services across India.
Features
- Generate DIGIPIN: Compute the DIGIPIN based on latitude and longitude inputs.
- Input Validation: Ensures latitude and longitude are within acceptable ranges.
- Precision Levels: Supports up to 10 levels of precision for detailed location encoding.
Requirements
- Python 3.1 or later.
Installation from PYPI
You can install this package directly from GitHub using pip:
pip install digipin
Installation from GitHub
You can install this package directly from GitHub using pip:
pip install git+https://github.com/goki75/digipin.git
Usage
Encoding
Import the encode and/or decode function from the module and pass the latitude and longitude as arguments:
from digipin import encode
try:
dpin = encode(8.2006, 77.4646)
print(f"DIGIPIN: {digipin}")
except ValueError as e:
print(e)
Output
DIGIPIN: M2J-T3L-747J
Decoding
from digipin import decode
try:
latlon = decode('M2J-T3L-747J')
print(f"(Lat,Long): {latlon}")
except Error as e:
print(e)
Output
(Lat,Long): (8.200617, 77.464602)
Input Constraints
- Latitude Range: 1.50 to 39.00
- Longitude Range: 63.50 to 99.00
If the inputs are out of range, the function raises a ValueError with an appropriate message.
What is DIGIPIN?
The Department of Posts also know as India Post is undertaking a project to establish a standardized, nationwide geo-coded addressing system by developing a National level Grid known as DIGIPIN. The implementation of this Digital Addressing system would ensure simplified addressing solutions for citizen centric delivery of public and private services. A standardized geo-coded addressing system would enhance India’s geo-spatial structure. It would add to the geospatial knowledge stack of the country in line with the National Geospatial Policy 2022, which seeks to strengthen the geospatial sector to support national development, economic prosperity and a thriving information economy.
Understanding DIGIPIN
DIGIPIN is an alphanumeric offline grid system that divides India's geographical territory into uniform 4-meter by 4-meter units. Each unit is assigned a unique 10-character alphanumeric code derived from its latitude and longitude coordinates. This system provides precise location-based identification, especially useful in areas with unstructured or changing addresses.
Contributing
Feel free to fork the repository and submit pull requests for enhancements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
For more information about DIGIPIN, read Technical document DIGIPIN . and visit India Post DIGIPIN
This expanded documentation provides a detailed overview of DIGIPIN, its purpose, and how to use the Python implementation.
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 digipin-2.0.1.tar.gz.
File metadata
- Download URL: digipin-2.0.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27b06bd218d1dfe5f7afb3fc8b25c2c08ff4bd4879986f50ef02f58ac9e4d4a8
|
|
| MD5 |
4253b686d9148989d28a4ca33bfa1ac8
|
|
| BLAKE2b-256 |
87748482eaa1dc074e077ec091bbbf8b421edba45701f4b79210a2a5dae729c6
|
File details
Details for the file digipin-2.0.1-py3-none-any.whl.
File metadata
- Download URL: digipin-2.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bca4011af8844e1fb1e775c49f9c96b80ec1b21a0620bbfc335804bd30826448
|
|
| MD5 |
1ed641757726f613cb4d165e01407a3b
|
|
| BLAKE2b-256 |
720d4b65183e435972ad20d03aa44fa7dd80dadc6afc3e839342b6df53893541
|