Logo Lanfrica

Ibrahist/e-mtaa

Domain:

digital infrastructure

Record type:

software
Creator:
Ibr
Host:
Pincode lookup API for autofill regions and districts from Tanzania during checkout. # πŸ‡ΉπŸ‡Ώ Tanzania Pincode Lookup API > ## 🟩 **This project is 100% complete** πŸŽ‰ > > `β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ 100%` A lightweight **FastAPI** service for looking up Tanzanian regions, cities, and districts from a 6-digit pincode. The API is designed for applications such as **e-commerce checkout forms**, where a customer enters a pincode and the corresponding location information can be automatically populated. ## ✨ Features * πŸ”Ž Look up a location using a 6-digit pincode * πŸ“¦ Perform bulk pincode lookups * πŸ‡ΉπŸ‡Ώ Tanzania-focused location data * βœ… Automatic pincode validation using Pydantic * ⚑ Fast API powered by FastAPI * πŸ›‘οΈ Custom error handling for invalid and unknown pincodes * πŸ“š Interactive API documentation through FastAPI * 🧩 Easy to integrate with checkout and address forms ## πŸ› οΈ Tech Stack * **Python** * **FastAPI** * **Pydantic** * **Uvicorn** ## πŸ“ Project Structure ```text πŸ‡ΉπŸ‡Ώ EMTAA β€” Tanzania Pincode Lookup API β”‚ β”œβ”€β”€ πŸ“ Scripts/ β”‚ └── βš™οΈ Supporting / utility scripts β”‚ β”œβ”€β”€ πŸ“„ main.py β”‚ └── πŸš€ FastAPI application entry point β”‚ β”œβ”€β”€ API routes β”‚ β”œβ”€β”€ Pincode lookup β”‚ β”œβ”€β”€ Bulk lookup β”‚ └── Request / response handling β”‚ β”œβ”€β”€ πŸ“„ models.py β”‚ └── 🧩 Pydantic data models β”‚ β”œβ”€β”€ Request schemas β”‚ β”œβ”€β”€ Response schemas β”‚ └── Data validation β”‚ β”œβ”€β”€ πŸ“„ data.py β”‚ └── πŸ‡ΉπŸ‡Ώ Tanzania pincode/location dataset β”‚ β”œβ”€β”€ Regions β”‚ β”œβ”€β”€ Cities β”‚ └── Districts β”‚ β”œβ”€β”€ πŸ“„ exceptions.py β”‚ └── ⚠️ Custom API exceptions β”‚ β”œβ”€β”€ Invalid pincode β”‚ β”œβ”€β”€ Pincode not found β”‚ └── Validation errors β”‚ β”œβ”€β”€ πŸ“„ requirements.txt β”‚ └── πŸ“¦ Python dependencies β”‚ β”œβ”€β”€ FastAPI β”‚ β”œβ”€β”€ Pydantic β”‚ └── Uvicorn β”‚ β”œβ”€β”€ πŸ“„ README.md β”‚ └── πŸ“š Project documentation β”‚ β”œβ”€β”€ Features β”‚ β”œβ”€β”€ Installation β”‚ β”œβ”€β”€ API usage β”‚ └── Examples β”‚ β”œβ”€β”€ πŸ“„ .gitignore β”‚ └── 🚫 Ignored files / directories β”‚ └── πŸ“„ pyvenv.cfg └── 🐍 Python virtual-environment configuration β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Cli …