https://github.com/mu373/epydemix-webapi
REST API for running epidemic simulations on epydemix
https://github.com/mu373/epydemix-webapi
epidemic-model epydemix fastapi rest-api
Last synced: about 1 month ago
JSON representation
REST API for running epidemic simulations on epydemix
- Host: GitHub
- URL: https://github.com/mu373/epydemix-webapi
- Owner: mu373
- License: gpl-3.0
- Created: 2026-01-28T20:09:03.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-05-20T22:25:51.000Z (about 1 month ago)
- Last Synced: 2026-05-21T03:37:23.326Z (about 1 month ago)
- Topics: epidemic-model, epydemix, fastapi, rest-api
- Language: Python
- Homepage: https://epydemix-webapi.vercel.app/docs/
- Size: 3.18 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# epydemix WebAPI
REST API for running epidemic simulations on [epydemix](https://github.com/epistorm/epydemix).
Documentation and API reference: https://epydemix-webapi.vercel.app/docs
## Quick Start
```bash
# Install dependencies
uv sync
# Run development server
uv run uvicorn app.main:app --reload
# Run tests
uv run pytest
```
## API Endpoints
- `POST /api/v1/simulations` - Run epidemic simulation
- `GET /api/v1/populations` - List available populations
- `GET /api/v1/populations/{name}` - Get population details
- `GET /api/v1/populations/{name}/contacts` - Get contact matrices
- `GET /api/v1/models/presets` - List model presets
- `GET /api/v1/health` - Health check
## Docker
```bash
# Build and run
docker compose up
# Development with hot reload
docker compose --profile dev up api-dev
```
## Examples
```bash
# List available populations
curl http://localhost:8000/api/v1/populations
# Run SIR simulation
curl -X POST http://localhost:8000/api/v1/simulations \
-H "Content-Type: application/json" \
-d '{
"model": {"preset": "SIR"},
"population": {"name": "United_States"},
"simulation": {
"start_date": "2024-01-01",
"end_date": "2024-03-01",
"Nsim": 100
}
}'
```
## Documentation
API documentation and reference is available [here](https://epydemix-webapi.vercel.app/docs).
Most API parameters follow epydemix conventions. Refer to the [epydemix documentation](https://epydemix.readthedocs.io/en/latest/) for details on model parameters, population data, and simulation options.