Context
Many production systems consume data-cleaning libraries behind microservices or ETL worker endpoints. Adding a lightweight, standalone FastAPI integration recipe in examples/integrations/ helps backend engineers integrate FreshData into web APIs and production serving stacks.
Task
Create a standalone runnable FastAPI recipe in examples/integrations/fastapi_clean_service.py that implements:
- A
POST /clean endpoint accepting CSV file uploads (UploadFile) or JSON tabular records.
- Optional query parameters / request body options (
strategy, impute, drop_duplicates).
- Clean execution using
freshdata.clean() inside a thread pool (asyncio.to_thread or run_in_threadpool) so CPU-bound dataframe processing does not block the async event loop.
- Returns the cleaned data along with the structured audit actions from
CleanReport.to_dict().
- Includes a runnable
if __name__ == "__main__": uvicorn.run(...) block so contributors can test immediately.
Acceptance Criteria
Pointers
New to the codebase? Comment /assign to claim this issue! You can also check our First Contribution Guide.
Context
Many production systems consume data-cleaning libraries behind microservices or ETL worker endpoints. Adding a lightweight, standalone FastAPI integration recipe in
examples/integrations/helps backend engineers integrate FreshData into web APIs and production serving stacks.Task
Create a standalone runnable FastAPI recipe in
examples/integrations/fastapi_clean_service.pythat implements:POST /cleanendpoint accepting CSV file uploads (UploadFile) or JSON tabular records.strategy,impute,drop_duplicates).freshdata.clean()inside a thread pool (asyncio.to_threadorrun_in_threadpool) so CPU-bound dataframe processing does not block the async event loop.CleanReport.to_dict().if __name__ == "__main__": uvicorn.run(...)block so contributors can test immediately.Acceptance Criteria
examples/integrations/fastapi_clean_service.pywith standalone, clean, and well-typed code.pip install fastapi uvicorn "freshdata-cleaner[dev]") in the module docstring.examples/README.md.ruff check examples/integrations/fastapi_clean_service.py).Pointers
examples/integrations/examples/README.mdsrc/freshdata/api.pyNew to the codebase? Comment
/assignto claim this issue! You can also check our First Contribution Guide.