All Projects → jrieke → fastapi-csv

jrieke / fastapi-csv

Licence: MIT license
🏗️ Create APIs from CSV files within seconds, using fastapi

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to fastapi-csv

Rows
A common, beautiful interface to tabular data, no matter the format
Stars: ✭ 739 (+1506.52%)
Mutual labels:  csv, excel, table, tabular-data
Pytablewriter
pytablewriter is a Python library to write a table in various formats: CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV.
Stars: ✭ 422 (+817.39%)
Mutual labels:  csv, excel, table
Meza
A Python toolkit for processing tabular data
Stars: ✭ 374 (+713.04%)
Mutual labels:  csv, excel, tabular-data
Sheetjs
📗 SheetJS Community Edition -- Spreadsheet Data Toolkit
Stars: ✭ 28,479 (+61810.87%)
Mutual labels:  csv, excel, table
Sqlitebiter
A CLI tool to convert CSV / Excel / HTML / JSON / Jupyter Notebook / LDJSON / LTSV / Markdown / SQLite / SSV / TSV / Google-Sheets to a SQLite database file.
Stars: ✭ 601 (+1206.52%)
Mutual labels:  csv, excel, google-sheets
Magento2 Import Export Sample Files
Default Magento 2 CE import / export CSV files & sample files for Firebear Improved Import / Export extension
Stars: ✭ 68 (+47.83%)
Mutual labels:  csv, excel, google-sheets
Csview
📠 A high performance csv viewer with cjk/emoji support.
Stars: ✭ 208 (+352.17%)
Mutual labels:  csv, table
Docto
Simple command line utility for converting .doc & .xls files to any supported format such as Text, RTF, CSV or PDF
Stars: ✭ 220 (+378.26%)
Mutual labels:  csv, excel
Django Data Wizard
🧙⚙️ Import structured data (e.g. Excel, CSV, XML, JSON) into one or more Django models via an interactive web-based wizard
Stars: ✭ 227 (+393.48%)
Mutual labels:  csv, excel
FastAPI Tortoise template
FastAPI - Tortoise ORM - Celery - Docker template
Stars: ✭ 144 (+213.04%)
Mutual labels:  fastapi, fastapi-template
Csvreader
csvreader library / gem - read tabular data in the comma-separated values (csv) format the right way (uses best practices out-of-the-box with zero-configuration)
Stars: ✭ 169 (+267.39%)
Mutual labels:  csv, tabular-data
Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (+432.61%)
Mutual labels:  csv, excel
cap-table-tool
Cap Table and Exit Waterfall Tool, https://foresight.is/cap-table
Stars: ✭ 22 (-52.17%)
Mutual labels:  excel, google-sheets
Flutter sheet localization
Generate Flutter localization from a simple online Google Sheets.
Stars: ✭ 212 (+360.87%)
Mutual labels:  csv, excel
Tad
A desktop application for viewing and analyzing tabular data
Stars: ✭ 2,275 (+4845.65%)
Mutual labels:  csv, tabular-data
Portphp
Data import/export framework for PHP
Stars: ✭ 225 (+389.13%)
Mutual labels:  csv, excel
Tably
Python command-line script for converting .csv data to LaTeX tables
Stars: ✭ 173 (+276.09%)
Mutual labels:  csv, table
Miller
Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
Stars: ✭ 4,633 (+9971.74%)
Mutual labels:  csv, tabular-data
datapackage-m
Power Query M functions for working with Tabular Data Packages (Frictionless Data) in Power BI and Excel
Stars: ✭ 26 (-43.48%)
Mutual labels:  excel, tabular-data
FastAPI-template
Feature rich robust FastAPI template.
Stars: ✭ 660 (+1334.78%)
Mutual labels:  fastapi, fastapi-template

fastapi-csv  🏗️

PyPi

Create APIs from CSV files within seconds, using fastapi.

This is a Python package to create APIs from CSV files, 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 CSV file. Its data is written to a (temporary) sqlite database, so the API is blazing fast even for huge files.

Installation

pip install fastapi-csv

How to use it

1. From the command line

There's a simple CSV file in this repo for testing (people.csv). To start an API for it, run one of:

# from file
fastapi-csv people.csv

# directly from URL
fastapi-csv https://raw.githubusercontent.com/jrieke/fastapi-csv/main/people.csv

Either command should start a fastapi instance, which has auto-generated endpoints and query parameters based on the CSV file. Here, the API has an endpoint /people (same name as the file), which can be queried using the CSV's column names, e.g. you can do:

  • /people?first_name=Rachel
  • /people?last_name=Johnson&age=48

Additionally, fastapi-csv creates some convenience query parameters for specific data types, e.g.

  • /people&age_greaterThan=18 (for int/float)
  • /people&age_lessThanEqual=18 (for int/float)
  • /people&first_name_contains=ach (for string, watch out: this one is case sensitive!)

Check out the API docs for more information and an interactive demo, they should be at http://127.0.0.1:8000/docs

2. From Python

Create a file my_file.py:

from fastapi_csv import FastAPI_CSV

app = FastAPI_CSV("people.csv")

Start from terminal just like a normal fastapi app:

uvicorn my_file:app

Extending the API

The cool thing: FastAPI_CSV is just a wrapper around FastAPI. Therefore, you can do all the stuff you can do with a normal fastapi instance, e.g. add a new endpoint:

# Add a new endpoint, just like in normal fastapi
@app.get("/hello")
def hello(self):
    return {"Hello:", "World"}

In the future, you will also be able to easily modify existing endpoints that were generated from the CSV file.

Updating the data

If your CSV file changes, you can update the API data with:

app.update_database()

Note that this will only update the data, not the API endpoints or query parameters. To do that, you need to create a new FastAPI_CSV instance or re-start uvicorn.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].