Skip to content

feat(examples): add FastAPI asynchronous cleaning microservice recipe #514

Closed

Description

@JohnnyWilson16

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:

  1. A POST /clean endpoint accepting CSV file uploads (UploadFile) or JSON tabular records.
  2. Optional query parameters / request body options (strategy, impute, drop_duplicates).
  3. 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.
  4. Returns the cleaned data along with the structured audit actions from CleanReport.to_dict().
  5. Includes a runnable if __name__ == "__main__": uvicorn.run(...) block so contributors can test immediately.

Acceptance Criteria

  • Create examples/integrations/fastapi_clean_service.py with standalone, clean, and well-typed code.
  • Document required dependencies (pip install fastapi uvicorn "freshdata-cleaner[dev]") in the module docstring.
  • Register the new recipe in examples/README.md.
  • Script runs and passes lint checks (ruff check examples/integrations/fastapi_clean_service.py).

Pointers


New to the codebase? Comment /assign to claim this issue! You can also check our First Contribution Guide.

Activity

  1. added
    good first issue
    examples
    on Oct 1, 2026
  2. removed their assignment
    on Oct 1, 2026
  3. MIYUMIYUMIMI commented on Oct 1, 2026

    @MIYUMIYUMIMI

    /assign

  4. added
    in-progress
    on Oct 1, 2026
  5. github-actions commented on Oct 1, 2026

    @github-actions

    Hey @MIYUMIYUMIMI! 🎉 You have claimed this issue.

    Quick Onboarding Checklist

    • 📖 Read the First Contribution Guide.
    • ⚡ Fast local test iteration: pytest tests/<test_file>.py --no-cov (bypasses CI 93% global gate during local development).
    • 🔍 Lint & style checks: ruff check .
    • 💬 If you have questions or need clarification, ask anytime here in the comments!

    (Need to unassign yourself? Simply reply with /unassign.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

examplesgood first issuein-progress

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions