Skip to content

This API was implemented as a part of a test case for one of German consultancies

Notifications You must be signed in to change notification settings

Pavel216989/api-test-case

Repository files navigation

Test Case solution

This project was developed as a part of a test case created by one of German consultancies.

Task

The objective was to implement an API that would handle POST requests with json-data attached to them. The API is supposed to store the raw data using an appropriate storing solution, apply data transformations, calculate some statistics and store the results in a database.

Solution description

API

The API was implemented in Python using Flask.

It has one endpoint called /upload, which accepts JSON-files and uploads them to a data lake and a data warehouse.

Google Cloud Storage is used as a Data Lake to store raw data, and BigQuery is used as a Data Warehouse.

API Deployment

The API is containerized using Docker.

The docker image is registered in Google Artifact Registry, and is then deployed via Google Cloud Run.

Data transformation

I used DataForm for data transformations.

It’s a fully-managed scalable data transformations solution within BigQuery.

In order to schedule the data transformations, either Workflows with Cloud Scheduler, or Cloud Composer (Airflow) could be used

Project structure

  1. app.py - Flask application with the API.
  2. Dockerfile - Docker container with the Flask API.
  3. API Documentation (Swagger).html - html-file with API documentation.
  4. requirements.txt - requirements file
  5. utils/ - modules used in the API
  6. definitions/ - data transformations implemented in DataForm.

API documentation

The API documentation can be found in API Documentation (Swagger).html, or under this link: API Documentation

About

This API was implemented as a part of a test case for one of German consultancies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages