Skip to main content

Everything in between human- and machine-readable syndromes.

Project description

open-syndrome-python

PyPI - Version Test

Installation

You can install it from PyPI or Docker. To use the conversion features, you will need to have Ollama installed.

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.

Convert a human-readable syndrome definition to a machine-readable JSON

You need to have Ollama installed locally to use this feature. Pull the models you want to use with opensyndrome before running the command. We have tested llama3.2, mistral, and deepseek-r1 so far.

Don't go well with structured output: qwen2.5-coder

If you do not pass -hr or -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

opensyndrome convert --model mistral

# to have the JSON translated to a specific language and edit it just after conversion
opensyndrome convert --language "Português do Brasil" --model mistral --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> --model mistral
opensyndrome humanize <path-to-json-file> --model mistral --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

opensyndrome-0.2.0.tar.gz (83.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opensyndrome-0.2.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file opensyndrome-0.2.0.tar.gz.

File metadata

  • Download URL: opensyndrome-0.2.0.tar.gz
  • Upload date:
  • Size: 83.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opensyndrome-0.2.0.tar.gz
Algorithm Hash digest
SHA256 660ca8d4227c78d8d42f6157557859330e3c3ab6addfe4fb3daa87340b2ceb4a
MD5 620d20e573662b105f3421de71167cfe
BLAKE2b-256 46fd385c1f4d51ef29334875ae75fa79c134df5be7dff213d029797c179f8901

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensyndrome-0.2.0.tar.gz:

Publisher: release.yml on OpenSyndrome/open-syndrome-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opensyndrome-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: opensyndrome-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opensyndrome-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3081742e8f17958c36183894ae253e4aa5b78bea708a7108e90f1e4ee2fb45ab
MD5 52e46af82fd62ce3a8927a860127085c
BLAKE2b-256 8b483ddc0786934ec019f9ebeb418d4e609f3cedcf94ab053833e0dfddd9787b

See more details on using hashes here.

Provenance

The following attestation bundles were made for opensyndrome-0.2.0-py3-none-any.whl:

Publisher: release.yml on OpenSyndrome/open-syndrome-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page