← All projects

Back end

Python API

FastAPI service exposing the topology computations, containerised with Docker.

Done Sprint S6-S7 · 8 points
In short, no jargon for non-developersRead the summaryClose
What it is
An online service to which other programs send a 3D object, and which sends back its measurements.
What it is for
To plug the portfolio's computations into other software, with nothing to install on their side.
What it shows
Putting a program into service on a server, in Python, safely and reproducibly.
Source code

How the pieces fit together

Diagram: HTTP client → API (POST /v1/mesh/…) ; API → lib-c (statistics) ; API → Topology (invariants) ; API → Classifier (shape class). POST /v1/mesh/… statistics invariants shape class HTTP client raw file body API FastAPI, uvicorn lib-c shared library Topology C API, under a lock Classifier ONNX Runtime, no PyTorch

Tech stack

  • Python
  • FastAPI
  • pytest
  • Docker

Who does what

Python
Calls lib-c and the topology library, built as shared libraries, through ctypes: the same code as the site's demos.
FastAPI
The HTTP routes (statistics, topology, classification), request validation and the OpenAPI documentation on /docs.
pytest
Tests of every route and every error (unreadable file, too large), on Linux, Windows and macOS.
Docker
Runs the API next to the site with docker compose, the C and C++ libraries built in the image.

Definition of Done

  • Code reviewed, diff by diff
  • Unit and integration tests green
  • Green CI on Linux, Windows and macOS when compiled
  • README, REVIEW.md and DECISIONS.md up to date
  • Texts in French and English
  • Demo deployed and tested on mobile