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.
- @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
├── 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
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
Check github repo: FastAPI-on-Google-Cloud-Run
To get into Swagger UI click on the API home page: API Documentation