An API built to format given addresses using Python and Flask.

Overview

An API built to format given addresses using Python and Flask.


About

The API returns properly formatted data, i.e. removing duplicate fields, distinguish missing fields etc.

Project (solution) submission for Aadhaar Hackathon 2021, conducted by UIDAI.

Documentation

The API comes with two endpoints, v1 & v2.

v1 API is designed to handle just a single key-value pair, while the v2 API can handle a split field key-value JSON POST request.

Examples:

v1 API: Requires a single field JSON input, i.e. "raw" (key), followed by a string (value) which is the unformatted address.

Input:

{
	"raw":"41, 1st Cross, Sv Rd, Bonny Plaza Shpg Ctr, Andheri,, Mumbai, Maharashtra, 400058"
}

Output:

{
    "building": "41",
    "district": "Mumbai",
    "landmark": "Bonny Plaza Shpg Ctr",
    "locality": "Sv Rd",
    "pincode": "400058",
    "state": "Maharashtra",
    "street": "1st Cross",
    "sub_district": "NA",
    "vtc": "Andheri"
}

v2 API: Requires multiple split field JSON input.

Input:

{
    "building": "41",
    "street": "1st Cross",
    "landmark": "Bonny Plaza Shpg Ctr",
    "locality": "Sv Rd",
    "vtc": "Andheri",
    "district": "Mumbai",
    "state": "Maharashtra"
 }

Output:

{
    "building": "41",
    "district": "Mumbai",
    "landmark": "Bonny Plaza Shpg Ctr",
    "locality": "Sv Rd",
    "pincode": "NA",
    "state": "Maharashtra",
    "street": "1st Cross",
    "sub_district": "NA",
    "vtc": "Andheri"
}
  • The API will return NA for missing or any blank fields.
  • Multiple languages are supported.

It's recommended to use v2 API as it performs better. v1 is just kept for legacy purposes.

Demo

The API (v2) is available here. Snapshots of the working code output are here.

It can be tested using Postman or any other relaible API testing application such as httpie or arc-electron.

Credits

Projects used in the making:

Other:

  • Repo logo created by rawpixel.com, obtained from freepik
You might also like...
Python module to access the OpenCage geocoding API
Python module to access the OpenCage geocoding API

OpenCage Geocoding Module for Python A Python module to access the OpenCage Geocoder. Build Status / Code Quality / etc Usage Supports Python 3.6 or n

Tile Map Service and OGC Tiles API for QGIS Server

Tiles API Add tiles API to QGIS Server Tiles Map Service API OGC Tiles API Tile Map Service API - TMS The TMS API provides these URLs: /tms/? to get i

This is a simple python code to get IP address and its location using python

IP address & Location finder @DEV/ED : Pavan Ananth Sharma Dependencies: ip2geotools Note: use pip install ip2geotools to install this in your termin

Download and process satellite imagery in Python using Sentinel Hub services.

Description The sentinelhub Python package allows users to make OGC (WMS and WCS) web requests to download and process satellite images within your Py

Read and write rasters in parallel using Rasterio and Dask

dask-rasterio dask-rasterio provides some methods for reading and writing rasters in parallel using Rasterio and Dask arrays. Usage Read a multiband r

A short term landscape evolution using a path sampling method to solve water and sediment flow continuity equations and model mass flows over complex topographies.
A short term landscape evolution using a path sampling method to solve water and sediment flow continuity equations and model mass flows over complex topographies.

r.sim.terrain A short-term landscape evolution model that simulates topographic change for both steady state and dynamic flow regimes across a range o

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.
Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Using Global fishing watch's data to build a machine learning model that can identify illegal fishing and poaching activities through satellite and geo-location data.

Hapi is a Python library for building Conceptual Distributed Model using HBV96 lumped model & Muskingum routing method
Hapi is a Python library for building Conceptual Distributed Model using HBV96 lumped model & Muskingum routing method

Current build status All platforms: Current release info Name Downloads Version Platforms Hapi - Hydrological library for Python Hapi is an open-sourc

Pandas Network Analysis: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:

Pandana Pandana is a Python library for network analysis that uses contraction hierarchies to calculate super-fast travel accessibility metrics and sh

Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API

Zora Zora is a python program that searches for GeoLocation info for given CIDR networks , with options to search with API or without API Installing a

z3r0day 1 Oct 26, 2021
A simple python script that, given a location and a date, uses the Nasa Earth API to show a photo taken by the Landsat 8 satellite. The script must be executed on the command-line.

What does it do? Given a location and a date, it uses the Nasa Earth API to show a photo taken by the Landsat 8 satellite. The script must be executed

Caio 42 Nov 26, 2022
Program that shows all the details of the given IP address. Build with Python and ipinfo.io API

ip-details This is a program that shows all the details of the given IP address. Build with Python and ipinfo.io API Usage To use this program, run th

null 4 Mar 1, 2022
A light-weight, versatile XYZ tile server, built with Flask and Rasterio :earth_africa:

Terracotta is a pure Python tile server that runs as a WSGI app on a dedicated webserver or as a serverless app on AWS Lambda. It is built on a modern

DHI GRAS 531 Dec 28, 2022
Spatial Interpolation Toolbox is a Python-based GUI that is able to interpolate spatial data in vector format.

Spatial Interpolation Toolbox This is the home to Spatial Interpolation Toolbox, a graphical user interface (GUI) for interpolating geographic vector

Michael Ward 2 Nov 1, 2021
A package built to support working with spatial data using open source python

EarthPy EarthPy makes it easier to plot and manipulate spatial data in Python. Why EarthPy? Python is a generic programming language designed to suppo

Earth Lab 414 Dec 23, 2022
glTF to 3d Tiles Converter. Convert glTF model to Glb, b3dm or 3d tiles format.

gltf-to-3d-tiles glTF to 3d Tiles Converter. Convert glTF model to Glb, b3dm or 3d tiles format. Usage λ python main.py --help Usage: main.py [OPTION

null 58 Dec 27, 2022
Implementation of Trajectory classes and functions built on top of GeoPandas

MovingPandas MovingPandas implements a Trajectory class and corresponding methods based on GeoPandas. Visit movingpandas.org for details! You can run

Anita Graser 897 Jan 1, 2023
Documentation and samples for ArcGIS API for Python

ArcGIS API for Python ArcGIS API for Python is a Python library for working with maps and geospatial data, powered by web GIS. It provides simple and

Esri 1.4k Dec 30, 2022
GeoIP Legacy Python API

MaxMind GeoIP Legacy Python Extension API Requirements Python 2.5+ or 3.3+ GeoIP Legacy C Library 1.4.7 or greater Installation With pip: $ pip instal

MaxMind 230 Nov 10, 2022