Contents

vamsii777/digipin

🌍 πŸ“ A Swift library for handling India Post's DIGIPIN (Digital Postal Index Number) system - encode any location in India into a simple 10-character code.

πŸ—ΊοΈ Geographic Encoding

The DIGIPIN framework provides tools to generate and decode DIGIPIN codes - India Post's revolutionary geographic encoding system. It enables precise location representation through a simple 10-character alphanumeric code, covering all of India's territory with high precision.

Add the DIGIPIN product to your target's dependencies:

.target(
    name: "YourTarget",
    dependencies: [
        .product(name: "DIGIPIN", package: "digipin")
    ]
)

Quick Example

import DIGIPIN

// Generate a DIGIPIN code
let digipin = DIGIPIN()
let coordinate = Coordinate(latitude: 28.622788, longitude: 77.213033) // Dak Bhawan (official example)

let code = try digipin.generateDIGIPIN(for: coordinate)
print(code) // "39J-49L-L8T4"

// Convert back to coordinates
let location = try digipin.coordinate(from: "39J-49L-L8T4")
print("Lat: \(location.latitude), Long: \(location.longitude)")

See the framework's documentation for detailed information and guides.

πŸ“ Geographic Coverage

The system covers India's entire territory:

  • Latitude: 2.5Β°N to 38.5Β°N
  • Longitude: 63.5Β°E to 99.5Β°E

Including:

  • Mainland India
  • Andaman and Nicobar Islands
  • Lakshadweep Islands
  • Buffer zones

For technical details about the DIGIPIN system, see:

🀝 Contributing

We appreciate your contributions to make DIGIPIN better! Please read our Contributing Guidelines before submitting a pull request.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • India Post for developing the DIGIPIN system
  • The Swift community

Package Metadata

Repository: vamsii777/digipin

Default branch: main

README: README.md