Skip to content
/ GUNB_API Public

🗺️ API created for getting info about given building permissions by territorial unit

Notifications You must be signed in to change notification settings

AJSTO/GUNB_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👨‍💻 Built with

🗺️Descripction about project

In this project, I focused on implementing an API that allows communication with the bigquery database created in my GUNB_building_permissions project, which contains information from the GUNB (Main Building Supervision Office) website in the form of aggregates collecting information on building permits issued in the last: 1 month, 2 months and 3 months months, divided by building category and type of building permission. Aggregates are collected for territorial units: voivodships, poviats and registration units.

🚪Endpoints

  • @api.get("/") - homepage of GUNB API
  • @api.get("/info") - endpoint created to get all available unit id (voivodships, poviats and registration units)
  • @api.get("/aggregates/{unit_id}") -endpoint created to get aggregates for given unit id (mandatory) and month (optional - if you dont pass value you will receive aggregates for the current month

🌲 Project tree

├── Dockerfile # Docker file to build container
├── README.md # Description about project
├── credentials.json # Your google cloud JSON key to authenticate access to cloud services in the project
├── .env # enviromental variables
├── home.html # HTML file for homepage
├── main.py # Python scrip with FastAPI
└── requirements.txt # All needed requirements to run container properly

🔑 Setup

To run properly this project you should change variables in .env-sample file and rename it to .env:

# BIGQUERY INFO ABOUT MY PROJECT, DATASET AND TABLE
PROJECT_ID=your_project_id
DATASET_NAME=your_dataset_name
TABLE_AGG=your_aggregates_table_name
TABLE_UNIT_INFO=your_unit_info_table_name
JSON_KEY_BQ=your_json_key_filename

⚙️Deploying FastAPI on Cloudrun

Check github repo: FastAPI-on-Google-Cloud-Run

⏩ Demo version

GUNB-API IMG_API

To get into Swagger UI click on the API home page: API Documentation IMG_SWAGGER

About

🗺️ API created for getting info about given building permissions by territorial unit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published