This repository is a small demo containing synthetic CSV data and a documentation page (data specification) that can be published to GitHub Pages.
What is included:
data/sample_patients.csv— synthetic patient demographicsdata/measurements.csv— synthetic clinical measurementsdata-specification.md— explainer and data dictionaryscripts/— small utility scripts to derive example outputs from the CSVs (seescripts/README.md)tests/— pytest unit tests for script functions.github/workflows/publish-pages.yml— manual GitHub Actions workflow that publishes the documentation and the data to thegh-pagesbranch.github/workflows/python-tests.yml— CI workflow that installs test deps and runs pytest on pushes/PRs tomain
Quick usage
Build the site locally (the same tool used in CI):
# from repository root
pandoc data-specification.md -o site/index.html --standalone --metadata title="Data specification" --css=assets/style.css
mkdir -p site/data site/assets
cp -R data/* site/data/
cp -R assets/* site/assets/
open site/index.htmlPlatform notes
-
macOS
- Install pandoc with Homebrew:
brew install pandoc. - The commands above work as-is;
open site/index.htmlwill open the page in the default browser.
- Install pandoc with Homebrew:
-
Linux (Debian/Ubuntu)
- Install pandoc:
sudo apt-get update && sudo apt-get install -y pandoc. - Use
xdg-open site/index.htmlto open the page from a terminal.
- Install pandoc:
-
Windows (PowerShell)
-
Install pandoc via Chocolatey (if available):
choco install pandocor download the installer from https://pandoc.org/installing.html. -
From PowerShell you can run the same pandoc command (remove the
mkdir -pusage):pandoc data-specification.md -o site/index.html --standalone --metadata title="Data specification" --css=assets/style.css New-Item -ItemType Directory -Force -Path site\data,site\assets Copy-Item -Recurse data\* site\data\ Copy-Item -Recurse assets\* site\assets\ Start-Process site\index.html
-
-
Windows (cmd)
-
Use the pandoc installer from the website or Chocolatey. In cmd.exe:
pandoc data-specification.md -o site/index.html --standalone --metadata title="Data specification" --css=assets/style.css mkdir site\data mkdir site\assets xcopy data\* site\data\ /E /I xcopy assets\* site\assets\ /E /I start site\index.html
-
Run the demo script (derives patient-level status):
pip install -r scripts/requirements.txt
python3 scripts/derive_patient_status.pyRun unit tests locally:
python -m venv .venv
source .venv/bin/activate
pip install -r scripts/requirements.txt
pytest -qCI and workflows
- The
Publish data specificationworkflow (.github/workflows/publish-pages.yml) is manual (workflow_dispatch) and publishes site output to thegh-pagesbranch. If the action cannot push, add a PAT asGH_PAGES_PATor enable appropriate workflow permissions. - The
Run Python testsworkflow (.github/workflows/python-tests.yml) runs pytest on pushes and pull requests tomain. Tests installscripts/requirements.txtandpytestin CI.
Contributing
See CONTRIBUTING.md for guidance on PRs, testing, and coding conventions. In particular:
- Add unit tests for new script functions and update
scripts/requirements.txtif you add dependencies. - Ensure
scripts/is importable (includescripts/__init__.pyor ensure PYTHONPATH is set in CI) so tests can import modules underscripts.
If you'd like help writing tests or adjusting CI, open an issue or a draft PR and tag a maintainer.