A Telegram bot that encodes and decodes DIGIPIN โ an open-source, geo-coded addressing system developed by India Post in collaboration with IIT Hyderabad and NRSC, ISRO.
DIGIPIN enables Address-as-a-Service (AaaS) by linking precise geographic locations to a unique 10-character digital identifier. This bot provides a simple chat interface for encoding and decoding DIGIPINs.
DIGIPIN is a 10-digit alphanumeric code that represents a geographic point (latitude & longitude). Unlike traditional postal codes or addresses, DIGIPIN is location-precise, digital-first, and unambiguous.
Feature | Description |
---|---|
๐ก Geo-Precision | Based on latitude & longitude grid division |
๐ Bidirectional | Encode coordinates โ DIGIPIN, Decode DIGIPIN โ coordinates |
๐ Open & Offline | No need for network lookup or third-party services |
๐ฐ Backed by | India Post, IIT Hyderabad, and NRSC, ISRO |
๐ Learn more: India Post - DIGIPIN
Command | Description |
---|---|
/encode <lat> <lon> |
Encode coordinates to DIGIPIN |
/decode <digipin> |
Decode DIGIPIN into latitude/longitude |
๐ Location Share | Send GPS location, get back a DIGIPIN |
git clone https://github.com/srajasimman/digipin-telegram-bot.git
cd digipin-telegram-bot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# .env
BOT_TOKEN=your_telegram_bot_token_here
python digipin_bot.py
A minimal image built from python:3.11-slim
.
docker build -t digipin-bot .
docker run -d --env-file .env --name digipin_bot digipin-bot
.env
is used to inject the bot token securely:
BOT_TOKEN=your_bot_token
/encode 28.6139 77.2090
๐ Output:
DIGIPIN: J5C-K3F-PM8
/decode J5C-K3F-PM8
๐ Output:
Latitude: 28.613875
Longitude: 77.209375
Just drop your ๐ location in chat โ the bot returns your DIGIPIN.
.
โโโ digipin_bot.py # Main bot logic
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Docker container setup
โโโ .env # Bot secret token (not checked in)
This project is licensed under the MIT License.
- ๐ฎ๐ณ India Post for DIGIPIN concept and implementation
- ๐ฐ IIT Hyderabad & NRSC, ISRO for geospatial tech support
- ๐ฌ Built using
python-telegram-bot