FDA DrugStats queries the FDA drugsfda and event APIs to:
Run the main script to fetch data and produce output in results/:
export FDA_API_KEY=your_api_key_here # optional python src/main.py
Then copy results into the site folder (use --force to overwrite):
python scripts/sync_results.py --force
Finally serve the site locally:
python -m http.server 8000 --directory docs # then open http://localhost:8000
The GitHub Actions workflow runs python src/main.py then calls python scripts/sync_results.py without --force. The sync script will skip existing files in docs/results/ unless forced, so the published site can remain unchanged even if results/ was updated. To ensure the workflow always publishes freshly generated files, update the workflow to call:
python scripts/sync_results.py --force
Source and scripts: