Skip to content

๐Ÿค– 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.

License

Notifications You must be signed in to change notification settings

srajasimman/digipin-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ DIGIPIN Telegram Bot

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.

๐Ÿง  What is DIGIPIN?

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

๐Ÿงญ Bot Features

โœ… Supported Commands

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

๐Ÿ“ฆ Local Setup (Python)

1. Clone & Setup

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

2. Create .env

# .env
BOT_TOKEN=your_telegram_bot_token_here

3. Run the bot

python digipin_bot.py

๐Ÿณ Dockerized Deployment

๐Ÿ“ Dockerfile

A minimal image built from python:3.11-slim.

๐Ÿ”จ Build and Run

docker build -t digipin-bot .
docker run -d --env-file .env --name digipin_bot digipin-bot

๐Ÿ”’ Environment

.env is used to inject the bot token securely:

BOT_TOKEN=your_bot_token

๐Ÿ“ก Example Usage

Encoding a location:

/encode 28.6139 77.2090

๐Ÿ” Output:

DIGIPIN: J5C-K3F-PM8

Decoding a DIGIPIN:

/decode J5C-K3F-PM8

๐Ÿ” Output:

Latitude: 28.613875
Longitude: 77.209375

Shared Location:

Just drop your ๐Ÿ“ location in chat โ€” the bot returns your DIGIPIN.

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ digipin_bot.py       # Main bot logic
โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”œโ”€โ”€ Dockerfile           # Docker container setup
โ””โ”€โ”€ .env                 # Bot secret token (not checked in)

โš–๏ธ License

This project is licensed under the MIT License.

๐Ÿ™ Acknowledgements

  • ๐Ÿ‡ฎ๐Ÿ‡ณ India Post for DIGIPIN concept and implementation
  • ๐Ÿ›ฐ IIT Hyderabad & NRSC, ISRO for geospatial tech support
  • ๐Ÿ’ฌ Built using python-telegram-bot

About

๐Ÿค– 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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published