Git Product home page Git Product logo

address-formatting's Introduction

Address-Formatting

Steps to Access

FastAPI Server

  • Clone the repo in your local machine and setup python environment. Create .env file with API_KEY of Opencage.
  • Install all the required packages in python virtual enviroment pip install requirements.txt
  • Run python main.py in the root directory of the project.

Architecture

image

Introduction

Address Formatter is built from the ground-up with a JSON API that makes it easy for developers and sysadmins to optimize the uneven complex residential address.

Use Cases

Address Formatter Api incorporates various use cases related to address formatting. The most common use case is to update the address for Aadhar Card, if there is some big typo or errors in the address. It supports 15 regional languages because in India apart from English lot of other languages are also spoken.

Authorization

All API requests require the use OpenCage API key. You can create your own API key, by navigating to the OpenCage docs.

Requests

1. Formatting the English Address

POST /https://addressformatteruidai.herokuapp.com/docs#/Address-Formatting/addressformattereng_addressformatter__post
Parameter Type
address json

Request Body

{
  "building": "string",
  "street": "string",
  "landmark": "string",
  "locality": "string",
  "vtc": "string",
  "district": "string",
  "state": "string"
}

Response

Many API endpoints return the JSON representation of the resources created or edited. Address Formatter returns a JSON response in the following format:

{
  "status": 200,
  "data": {
    "Formatted address": "string",
    "address": {
      "suburb": "string",
      "city": "string",
      "county": "string",
      "state_district": "string",
      "state": "string",
      "postcode": "string",
      "country": "string",
      "country_code": "string",
      "house no.": "string"
    }
  }
}

The Formatted address attribute contains the optimized address in a pretty format

The address attribute contains all the details related to address like zipcode, city_district, city, country, state in a JSON format.

2. Formatting the Regional Address

POST /https://addressformatteruidai.herokuapp.com/docs#/Address-Formatting/addressformatterregional_addressformatterregionallanguages__post
Parameter Type
text(in regional language) string

Response

Address Formatter for regional language returns a JSON response in the following format:

{
  "status": 200,
  "data": {
    "Formatted address": "string",
    "address": {
      "address": {
        "amenity": "string",
        "road": "string",
        "neighbourhood": "string",
        "suburb": "string",
        "city_district": "string",
        "city": "string",
        "county": "string",
        "state_district": "string",
        "state": "string",
        "postcode": "string",
        "country": "string",
        "country_id": "string"
      }
    }
  }
}

The Formatted address attribute contains the optimized address in a pretty format

The address attribute contains all the details related to address like road ,neighbourhood ,suburb ,zipcode, city_district, city, country, amenity in a JSON format.

Status Codes

Gophish returns the following status codes in its API:

Status Code Description
200 OK
400 BAD REQUEST
422 VALIDATION ERROR

address-formatting's People

Contributors

ankithans avatar aryamaan23 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

uidaitc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.