Create APIs from data files within seconds, using FastAPI, SQLite and Streamlit

Hi Community!

I’ve released APINESS - an app motivated by the work of jrieke on fastapi-csv.

fastapi-wrapper is a Python package and Streamlit application to create APIs from data files (Excel XLSX and CSV only), using a lightweight & fully customizable wrapper around FastAPI. Endpoints and query parameters are auto-generated based on the column names and data types in the data file. Its contents is written to either a temporary in-memory or persistent SQLite database, so the API can be blazing fast, even for huge files, especially for the in-memory case.

  • The Streamlit app allows multiple Excel files to be uploaded and processed into SQLite databases and (Fast)APIs
  • APIs can be iteratively tested before being deployed live, all within Streamlit.
  • Live APIs can be stopped gracefully.
  • A CLI tool enables all these functions to be performed in a terminal window
  • Alongside the generated SQLite database(s), a configuration database is also created with all the metadata required to recreate the API without having to load the original source data files. In effect, a package comprising the data databases and associated configuration database makes the API portable to any machine that has the fastapi-wrapper CLI tool installed. I call this handy feature BYOAPI (bring your own API). Something that will be very useful at my workplace!

My documentation is (hopefully) pretty thorough, with plenty of API query examples and demo gifs to get you going.

Read on to see how to get this little magic combining Streamlit with FastAPI + SQLite into your data handling workflows.

#fastapi #sqlite #multiprocess

11 Likes

FYI - have added a missing db file to the repo.