A FastAPI-based REST API for data processing operations including filtering and aggregation.
- Filter collections based on field conditions
- Aggregate data with operations like sum, average, count, min, and max
- Interactive API documentation (Swagger UI)
- Clone the repository:
git clone https://github.com/DiegoCarrillogt/wf2.git
cd wf2
- Install dependencies:
pip install -r requirements.txt
- Start the server:
python app.py
- Access the API documentation at: http://localhost:8001/docs
Filter a collection based on field conditions.
Example request:
{
"collection": [
{"id": 1, "name": "John", "age": 30},
{"id": 2, "name": "Jane", "age": 25}
],
"conditions": {
"age": 30
}
}
Aggregate data by grouping and performing operations.
Example request:
{
"collection": [
{"department": "IT", "salary": 5000},
{"department": "IT", "salary": 6000},
{"department": "HR", "salary": 4000}
],
"group_by": "department",
"aggregate_field": "salary",
"operation": "avg"
}
MIT