Everything in between human- and machine-readable syndromes.
Project description
open-syndrome-python
Installation
You can install it from PyPI or Docker. By default, the conversion features use Ollama running locally. Cloud providers (OpenAI, Anthropic, Mistral, DeepSeek, Gemini) are also supported and require only an API key.
From PyPi, install the package with pip install opensyndrome. Then run it with opensyndrome --help.
From Docker, you can run the following command to build the image, tagged opensyndrome:
docker build -t opensyndrome .
Run the container interactively, removing it when it exits
docker run --rm -it opensyndrome
To read a .env file, mount it:
docker run --rm -it \
-v "$(pwd)/.env:/app/.env:ro" \
opensyndrome
To name the container and keep it around:
docker run --name opensyndrome-cli -it opensyndrome
Usage
First, download the schema and definitions in order to work with the CLI locally.
opensyndrome download schema
opensyndrome download definitions
The files will be placed in the folder .open_syndrome in $HOME.
Providers and configuration
The provider and model can be set via environment variables so you don't have to pass them on every command:
OPENSYNDROME_PROVIDER=ollama # ollama (default), openai, anthropic, mistral, deepseek, gemini
OPENSYNDROME_MODEL=mistral # overrides the provider's default model
Copy .env.example to .env and fill in the relevant values:
| Provider | Required env var | Default model |
|---|---|---|
ollama |
— (runs locally) | mistral |
openai |
OPENAI_API_KEY |
gpt-4o |
anthropic |
ANTHROPIC_API_KEY |
claude-3-haiku-20240307 |
mistral |
MISTRAL_API_KEY |
mistral-large-latest |
deepseek |
DEEPSEEK_API_KEY |
deepseek-chat |
gemini |
GEMINI_API_KEY |
gemini-1.5-flash |
For Ollama, the model must be pulled before use: ollama pull mistral. You can also override the Ollama base URL with OLLAMA_BASE_URL
(default: http://localhost:11434).
Ollama models tested: llama3.2, mistral, deepseek-r1. Known to not work well with structured output: qwen2.5-coder.
Convert a human-readable syndrome definition to a machine-readable JSON
If you do not pass
-hror-hf, an editor will open for you to enter the definition.
# see some examples from ECDC: https://www.ecdc.europa.eu/en/all-topics/eu-case-definitions
# pass the definition as inline text
opensyndrome convert -hr "Any person with pneumonia"
# pass the definition from a TXT file
opensyndrome convert -hf definition.txt
# use a specific provider and model
opensyndrome convert -hr "Any person with pneumonia" --provider openai --model gpt-4o
# to have the JSON translated to a specific language and edit it just after conversion
opensyndrome convert --language "Português do Brasil" --edit
# include a validation step after conversion
opensyndrome convert --validate
Convert a machine-readable JSON syndrome definition to a human-readable format
opensyndrome humanize <path-to-json-file>
opensyndrome humanize <path-to-json-file> --provider anthropic
opensyndrome humanize <path-to-json-file> --model mistral-large-latest --language "Português do Brasil"
Validate a machine-readable JSON syndrome definition
opensyndrome validate <path-to-json-file>
Development
To get started with development, you need to have uv installed.
Install dependencies
uv sync
Generate Ollama-compatible JSON
You only need to do this if you are a maintainer adding a new OSI schema or updating an existing one.
Since Ollama requires a specific, more simple, JSON format, we need to generate an Ollama-compatible schema.
To do this, we use datamodel-code-generator to generate a Pydantic schema. Run the following command to update it:
make ollama_schema
It will create a schema.py file in the root of the project. Be careful when editing this file manually.
Citing & Authors
If you find this repository helpful, feel free to cite our publication: The Open Syndrome Definition
@misc{ferreira2025opensyndromedefinition,
title={The Open Syndrome Definition},
author={Ana Paula Gomes Ferreira and Aleksandar Anžel and Izabel Oliva Marcilio de Souza and Helen Hughes and Alex J Elliot and Jude Dzevela Kong and Madlen Schranz and Alexander Ullrich and Georges Hattab},
year={2025},
eprint={2509.25434},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2509.25434},
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opensyndrome-0.3.0.tar.gz.
File metadata
- Download URL: opensyndrome-0.3.0.tar.gz
- Upload date:
- Size: 168.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fecdb68027c7957e1fbb75d385fa655856e7803d77a44732e3e2b6caa6f1fc45
|
|
| MD5 |
e85973fee53976a99585ec593a600bb9
|
|
| BLAKE2b-256 |
e9a348d9be2659cf617e7311cc674d780c1aa5c81bcfdde3cc74d96acf69ff89
|
Provenance
The following attestation bundles were made for opensyndrome-0.3.0.tar.gz:
Publisher:
release.yml on OpenSyndrome/open-syndrome-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensyndrome-0.3.0.tar.gz -
Subject digest:
fecdb68027c7957e1fbb75d385fa655856e7803d77a44732e3e2b6caa6f1fc45 - Sigstore transparency entry: 1122371315
- Sigstore integration time:
-
Permalink:
OpenSyndrome/open-syndrome-python@d82958b8a169f4bd5237a39b2f282a89cb7b1093 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/OpenSyndrome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d82958b8a169f4bd5237a39b2f282a89cb7b1093 -
Trigger Event:
push
-
Statement type:
File details
Details for the file opensyndrome-0.3.0-py3-none-any.whl.
File metadata
- Download URL: opensyndrome-0.3.0-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4562b8fc16d707643e540cc848640c9d32231f9d4a90d0b50baf4e9fd03fd84a
|
|
| MD5 |
01ff8d21384e04ab83ed1494f6a85058
|
|
| BLAKE2b-256 |
e7985059e6c1c5090d9df59e4df003ef44e3ddac78211a3ff9117793c83f9433
|
Provenance
The following attestation bundles were made for opensyndrome-0.3.0-py3-none-any.whl:
Publisher:
release.yml on OpenSyndrome/open-syndrome-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensyndrome-0.3.0-py3-none-any.whl -
Subject digest:
4562b8fc16d707643e540cc848640c9d32231f9d4a90d0b50baf4e9fd03fd84a - Sigstore transparency entry: 1122371319
- Sigstore integration time:
-
Permalink:
OpenSyndrome/open-syndrome-python@d82958b8a169f4bd5237a39b2f282a89cb7b1093 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/OpenSyndrome
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d82958b8a169f4bd5237a39b2f282a89cb7b1093 -
Trigger Event:
push
-
Statement type: