Skip to content

A simple API which will return the latitude and longitude for each request using FastAPI and Pgeocode Library

Notifications You must be signed in to change notification settings

azzan-amin-97/simple-geocoding-service-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Simple Geocoding Service

A simple API which will return the latitude and longitude for each request using FastAPI and Pgeocode Library

Introduction

This is a simple geocoding service API project using python. One of the library package used for this API is pgeocode. Pgeocode is a python package that provides postal geocoding service. The goal of this API is to mock the large geocoding microservice in order to understand how the API works.

About the API

The architecture of the API can be explained by referring to the diagram below.

Scenario: A client wanted to have latitude and longitude of a certain address. The client will post a request to the api with the raw address. When the API received the address, it will check the geocoding database if the address is already exists. If it is exists, the API will fetch the existing geocoded address and send the response to the client. Otherwise, the API will call the geocoding function to geocode the address. The new geocoded data will save into the database.Then, the API will send it as response to the client.

Running the API

Command: uvicorn main:app --reload

Run Test on the API

Command: pytest

Goodluck!

About

A simple API which will return the latitude and longitude for each request using FastAPI and Pgeocode Library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages