opensyndrome 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opensyndrome-0.1.0/.env.example +1 -0
- opensyndrome-0.1.0/.github/workflows/ci.yml +28 -0
- opensyndrome-0.1.0/.github/workflows/release.yml +27 -0
- opensyndrome-0.1.0/.gitignore +179 -0
- opensyndrome-0.1.0/.idea/.gitignore +3 -0
- opensyndrome-0.1.0/.idea/inspectionProfiles/Project_Default.xml +15 -0
- opensyndrome-0.1.0/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- opensyndrome-0.1.0/.idea/misc.xml +7 -0
- opensyndrome-0.1.0/.idea/modules.xml +8 -0
- opensyndrome-0.1.0/.idea/open-syndrome-python.iml +11 -0
- opensyndrome-0.1.0/.idea/vcs.xml +6 -0
- opensyndrome-0.1.0/.idea/workspace.xml +81 -0
- opensyndrome-0.1.0/.pre-commit-config.yaml +22 -0
- opensyndrome-0.1.0/Dockerfile +11 -0
- opensyndrome-0.1.0/Makefile +20 -0
- opensyndrome-0.1.0/PKG-INFO +136 -0
- opensyndrome-0.1.0/README.md +118 -0
- opensyndrome-0.1.0/examples/cholera_colombia.json +52 -0
- opensyndrome-0.1.0/examples/dengue_usa.json +124 -0
- opensyndrome-0.1.0/examples/intussusception_vietnam.json +277 -0
- opensyndrome-0.1.0/examples/measles_brazil.json +74 -0
- opensyndrome-0.1.0/notebooks/__marimo__/session/filter_example.py.json +317 -0
- opensyndrome-0.1.0/notebooks/__marimo__/session/osi_filter_prototype.py.json +287 -0
- opensyndrome-0.1.0/notebooks/osi_filter_prototype.py +421 -0
- opensyndrome-0.1.0/opensyndrome/__init__.py +0 -0
- opensyndrome-0.1.0/opensyndrome/cli.py +154 -0
- opensyndrome-0.1.0/opensyndrome/converters.py +195 -0
- opensyndrome-0.1.0/opensyndrome/filtering.py +136 -0
- opensyndrome-0.1.0/opensyndrome/schema.py +225 -0
- opensyndrome-0.1.0/opensyndrome/to_be_updated__schema.py +292 -0
- opensyndrome-0.1.0/opensyndrome/validators.py +24 -0
- opensyndrome-0.1.0/pyproject.toml +37 -0
- opensyndrome-0.1.0/tests/__init__.py +0 -0
- opensyndrome-0.1.0/tests/definitions/v1/a/arbovirosis_aesop_brazil_sd.json +172 -0
- opensyndrome-0.1.0/tests/definitions/v1/a/arbovirosis_aesop_brazil_sd_with_like.json +164 -0
- opensyndrome-0.1.0/tests/definitions/v1/a/arbovirosis_paraguay_sd.json +59 -0
- opensyndrome-0.1.0/tests/definitions/v1/c/covid_brazil_sd.json +74 -0
- opensyndrome-0.1.0/tests/definitions/v1/d/dengue_usa.json +118 -0
- opensyndrome-0.1.0/tests/definitions/v1/e/extremetemperaturescold_argentina.json +44 -0
- opensyndrome-0.1.0/tests/definitions/v1/e/extremetemperaturesheat_argentina.json +51 -0
- opensyndrome-0.1.0/tests/definitions/v1/s/smallpox_costarica.json +151 -0
- opensyndrome-0.1.0/tests/definitions/v1/s/syphiliscongenitalandneonatal_greece.json +66 -0
- opensyndrome-0.1.0/tests/definitions/v1/u/uri_aesop_brazil_sd.json +397 -0
- opensyndrome-0.1.0/tests/definitions/v1/z/zika_paho.json +67 -0
- opensyndrome-0.1.0/tests/test_converters.py +104 -0
- opensyndrome-0.1.0/tests/test_filtering.py +322 -0
- opensyndrome-0.1.0/uv.lock +1224 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
OLLAMA_BASE_URL=http://localhost:11434
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
name: Lint
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: astral-sh/setup-uv@v3
|
|
16
|
+
- name: Pre-commit to rule them all
|
|
17
|
+
run: uv run pre-commit run --all-files
|
|
18
|
+
|
|
19
|
+
test:
|
|
20
|
+
name: Run tests
|
|
21
|
+
strategy:
|
|
22
|
+
matrix:
|
|
23
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
24
|
+
runs-on: ${{ matrix.os }}
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
- uses: astral-sh/setup-uv@v3
|
|
28
|
+
- run: uv run pytest
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
# Publish on any tag starting with a `v`, e.g. v1.2.3
|
|
8
|
+
- v*
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
pypi:
|
|
12
|
+
name: Publish to PyPI
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
# Environment and permissions trusted publishing.
|
|
15
|
+
environment:
|
|
16
|
+
# Create this environment in the GitHub repository under Settings -> Environments
|
|
17
|
+
name: release
|
|
18
|
+
url: https://pypi.org/p/osi
|
|
19
|
+
permissions:
|
|
20
|
+
contents: read
|
|
21
|
+
id-token: write
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
- uses: astral-sh/setup-uv@v3
|
|
25
|
+
- run: uv build
|
|
26
|
+
- name: Publish package distributions to PyPI
|
|
27
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py,cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
#Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
#uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
#poetry.lock
|
|
109
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# PyPI configuration file
|
|
171
|
+
.pypirc
|
|
172
|
+
|
|
173
|
+
# temporary
|
|
174
|
+
schema.json
|
|
175
|
+
ollama_schema.json
|
|
176
|
+
osi/to_be_updated__schema.py
|
|
177
|
+
|
|
178
|
+
# data
|
|
179
|
+
*.csv
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="PyInterpreterInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
5
|
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
6
|
+
<option name="ignoredPackages">
|
|
7
|
+
<value>
|
|
8
|
+
<list size="1">
|
|
9
|
+
<item index="0" class="java.lang.String" itemvalue="numpy" />
|
|
10
|
+
</list>
|
|
11
|
+
</value>
|
|
12
|
+
</option>
|
|
13
|
+
</inspection_tool>
|
|
14
|
+
</profile>
|
|
15
|
+
</component>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="Black">
|
|
4
|
+
<option name="sdkName" value="Python 3.11 (open-syndrome-python)" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (open-syndrome-python)" project-jdk-type="Python SDK" />
|
|
7
|
+
</project>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/open-syndrome-python.iml" filepath="$PROJECT_DIR$/.idea/open-syndrome-python.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="PYTHON_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
|
7
|
+
</content>
|
|
8
|
+
<orderEntry type="inheritedJdk" />
|
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
10
|
+
</component>
|
|
11
|
+
</module>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="AutoImportSettings">
|
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ChangeListManager">
|
|
7
|
+
<list default="true" id="30af56eb-4595-48f7-b4f7-768062c1e361" name="Changes" comment="">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/osi/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/opensyndrome/__init__.py" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/osi/cli.py" beforeDir="false" afterPath="$PROJECT_DIR$/opensyndrome/cli.py" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/osi/converters.py" beforeDir="false" afterPath="$PROJECT_DIR$/opensyndrome/converters.py" afterDir="false" />
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/osi/filtering.py" beforeDir="false" afterPath="$PROJECT_DIR$/opensyndrome/filtering.py" afterDir="false" />
|
|
12
|
+
<change beforePath="$PROJECT_DIR$/osi/schema.py" beforeDir="false" afterPath="$PROJECT_DIR$/opensyndrome/schema.py" afterDir="false" />
|
|
13
|
+
<change beforePath="$PROJECT_DIR$/osi/validators.py" beforeDir="false" afterPath="$PROJECT_DIR$/opensyndrome/validators.py" afterDir="false" />
|
|
14
|
+
<change beforePath="$PROJECT_DIR$/pyproject.toml" beforeDir="false" afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
|
|
15
|
+
<change beforePath="$PROJECT_DIR$/uv.lock" beforeDir="false" afterPath="$PROJECT_DIR$/uv.lock" afterDir="false" />
|
|
16
|
+
</list>
|
|
17
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
18
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
19
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
20
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
21
|
+
</component>
|
|
22
|
+
<component name="FileTemplateManagerImpl">
|
|
23
|
+
<option name="RECENT_TEMPLATES">
|
|
24
|
+
<list>
|
|
25
|
+
<option value="Python Script" />
|
|
26
|
+
</list>
|
|
27
|
+
</option>
|
|
28
|
+
</component>
|
|
29
|
+
<component name="Git.Settings">
|
|
30
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
31
|
+
</component>
|
|
32
|
+
<component name="ProjectColorInfo">{
|
|
33
|
+
"associatedIndex": 6
|
|
34
|
+
}</component>
|
|
35
|
+
<component name="ProjectId" id="2sX9mWP0rVfSY8fQDo7aatsQlvD" />
|
|
36
|
+
<component name="ProjectLevelVcsManager">
|
|
37
|
+
<ConfirmationsSetting value="1" id="Add" />
|
|
38
|
+
</component>
|
|
39
|
+
<component name="ProjectViewState">
|
|
40
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
41
|
+
<option name="showLibraryContents" value="true" />
|
|
42
|
+
</component>
|
|
43
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
44
|
+
"keyToString": {
|
|
45
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
46
|
+
"git-widget-placeholder": "main",
|
|
47
|
+
"last_opened_file_path": "/Users/Gomes-FerreiraA-Dev/workspace/osi-python/examples"
|
|
48
|
+
}
|
|
49
|
+
}]]></component>
|
|
50
|
+
<component name="RecentsManager">
|
|
51
|
+
<key name="CopyFile.RECENT_KEYS">
|
|
52
|
+
<recent name="$PROJECT_DIR$/examples" />
|
|
53
|
+
<recent name="$PROJECT_DIR$/tests/definitions/v1/a" />
|
|
54
|
+
<recent name="$PROJECT_DIR$/tests/definitions/v1/e" />
|
|
55
|
+
<recent name="$PROJECT_DIR$/tests/definitions/v1/c" />
|
|
56
|
+
<recent name="$PROJECT_DIR$/tests/definitions/v1/u" />
|
|
57
|
+
</key>
|
|
58
|
+
<key name="MoveFile.RECENT_KEYS">
|
|
59
|
+
<recent name="$PROJECT_DIR$/examples" />
|
|
60
|
+
<recent name="$PROJECT_DIR$/tests/definitions/v1" />
|
|
61
|
+
</key>
|
|
62
|
+
</component>
|
|
63
|
+
<component name="SharedIndexes">
|
|
64
|
+
<attachedChunks>
|
|
65
|
+
<set>
|
|
66
|
+
<option value="bundled-python-sdk-975db3bf15a3-31b6be0877a2-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-241.18034.82" />
|
|
67
|
+
</set>
|
|
68
|
+
</attachedChunks>
|
|
69
|
+
</component>
|
|
70
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
71
|
+
<component name="TaskManager">
|
|
72
|
+
<task active="true" id="Default" summary="Default task">
|
|
73
|
+
<changelist id="30af56eb-4595-48f7-b4f7-768062c1e361" name="Changes" comment="" />
|
|
74
|
+
<created>1738591211638</created>
|
|
75
|
+
<option name="number" value="Default" />
|
|
76
|
+
<option name="presentableId" value="Default" />
|
|
77
|
+
<updated>1738591211638</updated>
|
|
78
|
+
</task>
|
|
79
|
+
<servers />
|
|
80
|
+
</component>
|
|
81
|
+
</project>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v5.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- repo: https://github.com/ambv/black
|
|
10
|
+
rev: 25.1.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: black
|
|
13
|
+
args: [
|
|
14
|
+
"--force-exclude=.*tests\/fixtures\/.*"
|
|
15
|
+
]
|
|
16
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
+
rev: v0.9.4
|
|
18
|
+
hooks:
|
|
19
|
+
- id: ruff
|
|
20
|
+
args: [
|
|
21
|
+
"--fix"
|
|
22
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# load .env file
|
|
2
|
+
ifneq (,$(wildcard .env))
|
|
3
|
+
include .env
|
|
4
|
+
export
|
|
5
|
+
endif
|
|
6
|
+
|
|
7
|
+
SCHEMA_FILE := $(HOME)/.open_syndrome/v1/schema.json
|
|
8
|
+
|
|
9
|
+
ask_ollama_schema:
|
|
10
|
+
@echo "Generate JSON schema compatible with Ollama..."
|
|
11
|
+
@ollama run mistral "Convert this JSON schema to the simplified version supported by Ollama. Do not include description or examples. Do not create new fields. Only work with the JSON: $$(cat $(SCHEMA_FILE))" --format json > ollama_schema.json
|
|
12
|
+
@echo "Done!"
|
|
13
|
+
|
|
14
|
+
ollama_schema:
|
|
15
|
+
@datamodel-codegen --input-file-type jsonschema \
|
|
16
|
+
--output-model-type pydantic_v2.BaseModel \
|
|
17
|
+
--use-unique-items-as-set \
|
|
18
|
+
--use-default \
|
|
19
|
+
--input $(SCHEMA_FILE) \
|
|
20
|
+
--output osi/to_be_updated__schema.py
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: opensyndrome
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Author-email: Ana Paula Gomes <apgomes88@gmail.com>
|
|
5
|
+
Requires-Python: ~=3.11
|
|
6
|
+
Requires-Dist: click<9,>=8.1.8
|
|
7
|
+
Requires-Dist: datamodel-code-generator<0.29,>=0.28.1
|
|
8
|
+
Requires-Dist: jsonschema<5,>=4.23.0
|
|
9
|
+
Requires-Dist: numpy<3,>=2.3.1
|
|
10
|
+
Requires-Dist: ollama<0.6,>=0.5.1
|
|
11
|
+
Requires-Dist: plotly[express]<7,>=6.1.2
|
|
12
|
+
Requires-Dist: pyarrow<21,>=20.0.0
|
|
13
|
+
Requires-Dist: pydantic<3,>=2.10.6
|
|
14
|
+
Requires-Dist: pygments<3,>=2.19.1
|
|
15
|
+
Requires-Dist: python-dotenv<2,>=1.0.1
|
|
16
|
+
Requires-Dist: requests>=2.32.5
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# open-syndrome-python
|
|
20
|
+
|
|
21
|
+
[](https://github.com/OpenSyndrome/open-syndrome-python/actions/workflows/ci.yml)
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
You can install it from PyPI or from Docker.
|
|
26
|
+
|
|
27
|
+
From PyPi, install the package with `pip install opensyndrome`. Then run it with `osi`.
|
|
28
|
+
|
|
29
|
+
From Docker, you can run the following command to build the image, tagged `osi`:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
docker build -t osi .
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Run the container interactively, removing it when it exits
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
docker run --rm osi
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To read a `.env` file, mount it:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
docker run --rm -it \
|
|
45
|
+
-v "$(pwd)/.env:/app/.env:ro" \
|
|
46
|
+
osi
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
To name the container and keep it around:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
docker run --name osi-cli -it osi
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
First, download the schema and definitions in order to work with the CLI locally.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
osi download schema
|
|
61
|
+
osi download definitions
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The files will be placed in the folder `.open_syndrome` in `$HOME`.
|
|
65
|
+
|
|
66
|
+
### Convert a human-readable syndrome definition to a machine-readable JSON
|
|
67
|
+
|
|
68
|
+
You need to have [Ollama](https://github.com/ollama/ollama) installed locally
|
|
69
|
+
to use this feature. Pull the models you want to use with `osi` before running the command.
|
|
70
|
+
We have tested llama3.2, mistral, and deepseek-r1 so far.
|
|
71
|
+
|
|
72
|
+
Don't go well with structured output: qwen2.5-coder
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
osi convert
|
|
76
|
+
osi convert --model mistral
|
|
77
|
+
|
|
78
|
+
# to have the JSON translated to a specific language and edit it just after conversion
|
|
79
|
+
osi convert --language "Português do Brasil" --model mistral --edit
|
|
80
|
+
|
|
81
|
+
# include a validation step after conversion
|
|
82
|
+
osi convert --validate
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Convert a machine-readable JSON syndrome definition to a human-readable format
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
osi humanize <path-to-json-file>
|
|
89
|
+
osi humanize <path-to-json-file> --model mistral
|
|
90
|
+
osi humanize <path-to-json-file> --model mistral --language "Português do Brasil"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Validate a machine-readable JSON syndrome definition
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
osi validate
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Development
|
|
100
|
+
|
|
101
|
+
To get started with development, you need to have [Poetry](https://python-poetry.org/) installed.
|
|
102
|
+
|
|
103
|
+
### Install dependencies
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
uv sync
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Generate Ollama-compatible JSON
|
|
110
|
+
|
|
111
|
+
> You only need to do this if you are a maintainer adding a new OSI schema or updating an existing one.
|
|
112
|
+
|
|
113
|
+
Since Ollama requires a specific, more simple, JSON format, we need to generate an Ollama-compatible schema.
|
|
114
|
+
To do this, we use `datamodel-code-generator` to generate a Pydantic schema. Run the following command to update it:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
make ollama_schema
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
It will create a `schema.py` file in the root of the project. Be careful when editing this file manually.
|
|
121
|
+
|
|
122
|
+
## Citing & Authors
|
|
123
|
+
|
|
124
|
+
If you find this repository helpful, feel free to cite our publication: The Open Syndrome Definition
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
@misc{ferreira2025opensyndromedefinition,
|
|
128
|
+
title={The Open Syndrome Definition},
|
|
129
|
+
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},
|
|
130
|
+
year={2025},
|
|
131
|
+
eprint={2509.25434},
|
|
132
|
+
archivePrefix={arXiv},
|
|
133
|
+
primaryClass={cs.AI},
|
|
134
|
+
url={https://arxiv.org/abs/2509.25434},
|
|
135
|
+
}
|
|
136
|
+
```
|