{"id":15640275,"url":"https://github.com/jrieke/fastapi-csv","last_synced_at":"2025-04-15T06:13:41.425Z","repository":{"id":44370594,"uuid":"325310298","full_name":"jrieke/fastapi-csv","owner":"jrieke","description":"🏗️ Create APIs from CSV files within seconds, using fastapi","archived":false,"fork":false,"pushed_at":"2021-05-28T14:54:04.000Z","size":236,"stargazers_count":76,"open_issues_count":4,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-15T06:13:35.102Z","etag":null,"topics":["api","csv","csv-api","excel","fastapi","fastapi-template","google-sheets","python","table","tabular-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrieke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-29T14:39:36.000Z","updated_at":"2025-03-06T04:31:18.000Z","dependencies_parsed_at":"2022-09-02T18:30:59.433Z","dependency_job_id":null,"html_url":"https://github.com/jrieke/fastapi-csv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrieke%2Ffastapi-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrieke%2Ffastapi-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrieke%2Ffastapi-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrieke%2Ffastapi-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrieke","download_url":"https://codeload.github.com/jrieke/fastapi-csv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016638,"owners_count":21198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","csv","csv-api","excel","fastapi","fastapi-template","google-sheets","python","table","tabular-data"],"created_at":"2024-10-03T11:33:32.099Z","updated_at":"2025-04-15T06:13:41.406Z","avatar_url":"https://github.com/jrieke.png","language":"Python","funding_links":[],"categories":["API"],"sub_categories":[],"readme":"# fastapi-csv \u0026nbsp;🏗️\n\n[![PyPi](https://img.shields.io/pypi/v/fastapi-csv)](https://pypi.org/project/fastapi-csv/)\n\n**Create APIs from CSV files within seconds, using fastapi.**\n\nThis is a Python package to create APIs from CSV files, using a lightweight \u0026 \nfully customizable wrapper around [fastapi](https://fastapi.tiangolo.com/). Endpoints \nand query parameters are auto-generated based on the column names and data types in the \nCSV file. Its data is written to a (temporary) sqlite database, so the API is blazing \nfast even for huge files.\n\n![](images/visual-demo.png)\n\n\n## Installation\n\n```bash\npip install fastapi-csv\n```\n\n\n## How to use it\n\n### 1. From the command line\n\nThere's a simple CSV file in this repo for testing ([people.csv](people.csv)). To start\nan API for it, run one of:\n\n```bash\n# from file\nfastapi-csv people.csv\n\n# directly from URL\nfastapi-csv https://raw.githubusercontent.com/jrieke/fastapi-csv/main/people.csv\n```\n\nEither command should start a fastapi instance, which has auto-generated endpoints and \nquery parameters based on the CSV file. Here, the API has an endpoint `/people` \n(same name as the file), which can be queried using the CSV's column names, e.g. you can \ndo:\n\n- `/people?first_name=Rachel`\n- `/people?last_name=Johnson\u0026age=48`\n   \nAdditionally, fastapi-csv creates some convenience query parameters for specific data \ntypes, e.g. \n\n- `/people\u0026age_greaterThan=18` (for int/float)\n- `/people\u0026age_lessThanEqual=18` (for int/float)\n- `/people\u0026first_name_contains=ach` (for string, watch out: this one is case sensitive!)\n\nCheck out the API docs for more information and an interactive demo, they should be at\nhttp://127.0.0.1:8000/docs\n\n\n### 2. From Python\n\nCreate a file `my_file.py`:\n\n```python\nfrom fastapi_csv import FastAPI_CSV\n\napp = FastAPI_CSV(\"people.csv\")\n```\n\nStart from terminal just like a normal fastapi app:\n\n```bash\nuvicorn my_file:app\n```\n\n**Extending the API**\n\nThe cool thing: `FastAPI_CSV` is just a wrapper around `FastAPI`. Therefore, you can do \nall the stuff you can do with a normal fastapi instance, e.g. add a new endpoint:\n\n```python\n# Add a new endpoint, just like in normal fastapi\n@app.get(\"/hello\")\ndef hello(self):\n    return {\"Hello:\", \"World\"}\n```\n\nIn the future, you will also be able to easily modify existing endpoints that were \ngenerated from the CSV file.\n\n\n**Updating the data**\n\nIf your CSV file changes, you can update the API data with:\n\n```python\napp.update_database()\n```\n\nNote that this will only update the data, not the API endpoints or query parameters. \nTo do that, you need to create a new `FastAPI_CSV` instance or re-start uvicorn.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrieke%2Ffastapi-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrieke%2Ffastapi-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrieke%2Ffastapi-csv/lists"}