carrot-transform 0.3.4__py3-none-any.whl → 0.4.0__py3-none-any.whl
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.
Potentially problematic release.
This version of carrot-transform might be problematic. Click here for more details.
- {carrot_transform-0.3.4.dist-info → carrot_transform-0.4.0.dist-info}/METADATA +41 -18
- carrot_transform-0.4.0.dist-info/RECORD +41 -0
- {carrot_transform-0.3.4.dist-info → carrot_transform-0.4.0.dist-info}/WHEEL +1 -1
- carrot_transform-0.4.0.dist-info/entry_points.txt +2 -0
- carrottransform/__init__.py +1 -1
- carrottransform/_version.py +2 -2
- carrottransform/cli/command.py +9 -5
- carrottransform/cli/subcommands/run.py +302 -443
- carrottransform/cli/subcommands/run_v2.py +145 -0
- carrottransform/config/OMOPCDM_postgresql_5.4_ddl.sql +550 -0
- carrottransform/examples/test/rules/v1.json +280 -0
- carrottransform/examples/test/rules/v2.json +115 -0
- carrottransform/tools/__init__.py +4 -14
- carrottransform/tools/args.py +128 -0
- carrottransform/tools/click.py +21 -0
- carrottransform/tools/concept_helpers.py +61 -0
- carrottransform/tools/core.py +163 -0
- carrottransform/tools/date_helpers.py +79 -0
- carrottransform/tools/file_helpers.py +177 -7
- carrottransform/tools/logger.py +19 -0
- carrottransform/tools/mapping_types.py +32 -0
- carrottransform/tools/mappingrules.py +298 -32
- carrottransform/tools/metrics.py +274 -49
- carrottransform/tools/omopcdm.py +42 -32
- carrottransform/tools/orchestrator.py +381 -0
- carrottransform/tools/person_helpers.py +126 -0
- carrottransform/tools/record_builder.py +413 -0
- carrottransform/tools/stream_helpers.py +71 -0
- carrottransform/tools/types.py +71 -0
- carrottransform/tools/validation.py +62 -0
- carrot_transform-0.3.4.dist-info/RECORD +0 -24
- carrot_transform-0.3.4.dist-info/entry_points.txt +0 -3
- {carrot_transform-0.3.4.dist-info → carrot_transform-0.4.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: carrot_transform
|
|
3
|
-
Version: 0.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Requires-Python: >=3.10
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
-
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
14
|
-
Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
|
|
15
|
-
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
|
16
|
-
Requires-Dist: pytest (>=8.3.4,<9.0.0)
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Author-email: anwarfg <913028+anwarfg@users.noreply.github.com>
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: click<9,>=8.1.7
|
|
9
|
+
Requires-Dist: ruff>=0.12.0
|
|
17
10
|
Description-Content-Type: text/markdown
|
|
18
11
|
|
|
12
|
+
|
|
19
13
|
<p align="center">
|
|
20
14
|
<a href="https://carrot.ac.uk/" target="_blank">
|
|
21
15
|
<picture>
|
|
22
|
-
<source media="(prefers-color-scheme: dark)" srcset="/images/logo-dark.png">
|
|
23
|
-
<img alt="Carrot Logo" src="/images/logo-primary.png" width="280"/>
|
|
16
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Health-Informatics-UoN/carrot-transform/refs/heads/main/images/logo-dark.png">
|
|
17
|
+
<img alt="Carrot Logo" src="https://raw.githubusercontent.com/Health-Informatics-UoN/carrot-transform/refs/heads/main/images/logo-primary.png" width="280"/>
|
|
24
18
|
</picture>
|
|
25
19
|
</a>
|
|
26
20
|
</p>
|
|
27
21
|
|
|
22
|
+
|
|
28
23
|
<p align="center">
|
|
29
24
|
|
|
30
25
|
<a href="https://github.com/Health-Informatics-UoN/carrot-transform/releases">
|
|
@@ -54,11 +49,36 @@ Description-Content-Type: text/markdown
|
|
|
54
49
|
|
|
55
50
|
Carrot Transform transforms input data into tab separated variable files of standard OMOP tables, with concepts mapped according to the provided rules (generated from Carrot Mapper).
|
|
56
51
|
|
|
57
|
-
## Quick Start
|
|
52
|
+
## Quick Start
|
|
58
53
|
|
|
59
54
|
To have the project up and running, please follow the [Quick Start Guide](https://carrot.ac.uk/transform/quickstart).
|
|
60
55
|
|
|
56
|
+
If you need to perform development, [there's a brief guide here](https://carrot.ac.uk/transform/development) to get the tool up and running.
|
|
57
|
+
|
|
58
|
+
## Formatting and Linting
|
|
59
|
+
|
|
60
|
+
This project is using [ruff](https://docs.astral.sh/ruff/) to check formatting and linting.
|
|
61
|
+
The only dependency is the [`uv` command line tool.](https://docs.astral.sh/uv/)
|
|
62
|
+
The `.vscode/tasks.json` file contains a task to run this tool for the currently open file.
|
|
63
|
+
The commands can be run on thier own (in the root folder) like this ...
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# reformat all the files in `./`
|
|
67
|
+
λ uv run ruff format .
|
|
68
|
+
|
|
69
|
+
# run linting checks all the files in `./`
|
|
70
|
+
λ uv run ruff check .
|
|
71
|
+
|
|
72
|
+
# check and fix all the files in `./`
|
|
73
|
+
λ uv run ruff check --fix .
|
|
74
|
+
|
|
75
|
+
# check and fix all the files in `./` but do so so more eggrsively
|
|
76
|
+
λ uv run ruff check --fix --unsafe-fixes .
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
|
|
61
80
|
## Release Procedure
|
|
81
|
+
|
|
62
82
|
To release a new version of `carrot-transform` follow these steps:
|
|
63
83
|
|
|
64
84
|
### 1. Prepare the repository
|
|
@@ -84,6 +104,7 @@ git push --set-upstream origin release/v$NEW_VERSION
|
|
|
84
104
|
|
|
85
105
|
### 4. Create pull request
|
|
86
106
|
- Open a pull request from `release/v$NEW_VERSION` to `main` and await approval.
|
|
107
|
+
|
|
87
108
|
### 5. Merge and tag
|
|
88
109
|
- After approval merge the the feature branch to `main`.
|
|
89
110
|
- Checkout to `main`, pull updates, and create a tag corresponding to the new version number.
|
|
@@ -95,12 +116,14 @@ git push origin "$NEW_VERSION"
|
|
|
95
116
|
```
|
|
96
117
|
|
|
97
118
|
### 6. Create a release
|
|
119
|
+
|
|
98
120
|
- We must now link the tag to a release in the GitHub repository. To do this from the command line first install GitHub command line tools `gh` and then invoke:
|
|
99
121
|
```bash
|
|
100
122
|
gh release create "$TAG" --title "$TAG" --notes "Release for $VERSION"
|
|
101
123
|
```
|
|
102
124
|
|
|
103
125
|
- Alternatively, follow the instructions in the [GitHub documentation](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) to manually create a release.
|
|
126
|
+
|
|
104
127
|
## License
|
|
105
128
|
|
|
106
129
|
This repository's source code is available under the [MIT license](LICENSE).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
carrottransform/__init__.py,sha256=w-DhwucYR1NusuB8OSVCGg-FSXD7uGM4-qRYYVRQuFw,76
|
|
2
|
+
carrottransform/_version.py,sha256=1cid5p9fGAqLJCh8-kGfJREN50SBD2zlOIxb22wmTsw,170
|
|
3
|
+
carrottransform/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
carrottransform/cli/command.py,sha256=cBokJsMNPclG3kwey1FP4hd42tj-_fLvO6N5TY8ZaWA,592
|
|
5
|
+
carrottransform/cli/subcommands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
carrottransform/cli/subcommands/run.py,sha256=vhZx0GkH_oSwX02hvoVG9c2QBpG43jdCQiTh--fcfZc,14846
|
|
7
|
+
carrottransform/cli/subcommands/run_v2.py,sha256=cjqmQQsnk0TT_d8uER5FoieE-n70Pio1_CQhc_NORUo,3788
|
|
8
|
+
carrottransform/config/OMOPCDM_postgresql_5.3_ddl.sql,sha256=fXrPfdL3IzU5ux55ogsQKjjd-c1KzdP_N2A_JjlY3gk,18084
|
|
9
|
+
carrottransform/config/OMOPCDM_postgresql_5.4_ddl.sql,sha256=qax7pJC0ydOlj6rdpKyf1rZ_NILFkryHZYpcFTmh8dY,19615
|
|
10
|
+
carrottransform/config/omop.json,sha256=OT3jvfPjKhjsDnQcQw1OAEOHhQLoHXNxTj_MDwNbYqo,1934
|
|
11
|
+
carrottransform/examples/test/inputs/Covid19_test.csv,sha256=d5t7Lfhkwbfe3Uk2IBqB2ZT5o0h9QaeraC8E5-IMERo,67521
|
|
12
|
+
carrottransform/examples/test/inputs/Demographics.csv,sha256=_ukUTpD4g751sL_mSL3f26T_Edd2kvH-evwm54VfXJI,85237
|
|
13
|
+
carrottransform/examples/test/inputs/Symptoms.csv,sha256=5dvGv16PNJJO_lFc0reRmQbE3m7iWfWajl51JDsqg0M,78447
|
|
14
|
+
carrottransform/examples/test/inputs/covid19_antibody.csv,sha256=SPCpyqpTbVq9987jXZ8AS4FEkrchRMAIYhTQJjfpwfY,98927
|
|
15
|
+
carrottransform/examples/test/inputs/vaccine.csv,sha256=_gcM-SIymyt2Dkkr_zGmQI9keIdmDm-gDI_QvXXLFrY,44037
|
|
16
|
+
carrottransform/examples/test/rules/rules_14June2021.json,sha256=n2OYNFhbx-NLhmqjAad6RsfXjQFknZIgQ7a5uyJF0Co,13226
|
|
17
|
+
carrottransform/examples/test/rules/v1.json,sha256=eE1fMWbLdivDsTvTOzIYOhB7z9sHx6D_t7ohqveJCS0,8622
|
|
18
|
+
carrottransform/examples/test/rules/v2.json,sha256=PxMY7OTgd9zIJWTyHjcHEGATwjiCR1a528DKW0Q3AOk,3293
|
|
19
|
+
carrottransform/tools/__init__.py,sha256=xOaP6dK0oDi58Ifa0bm-gNFU5RL6iXmKfk10jTUPH1k,168
|
|
20
|
+
carrottransform/tools/args.py,sha256=DrB5PhvPs01EfNRMIC8Xt4bYmYHXJcpanshDmJqaDtc,4324
|
|
21
|
+
carrottransform/tools/click.py,sha256=5fxl9zL6piwWMN4cSule0tG90E9g7eFNosoSu1ES1og,471
|
|
22
|
+
carrottransform/tools/concept_helpers.py,sha256=ShZ9q4JEhiI9NvxoZCENhRewlf7LUzy59ozda97adR4,2049
|
|
23
|
+
carrottransform/tools/core.py,sha256=9WCmkY5xlte7sRbJbhwi6Pg1vHNsJBf6iFn0_DoCMQw,7921
|
|
24
|
+
carrottransform/tools/date_helpers.py,sha256=Tj7zmu5j5M1NR9PfCYmlbfWbUv_ga1QMwouOfxyVzSQ,2333
|
|
25
|
+
carrottransform/tools/file_helpers.py,sha256=wxrQ09CtnJQKx9uofI89ljTdWj1INockc1J77mQIJsc,6894
|
|
26
|
+
carrottransform/tools/logger.py,sha256=MTTqX6xgvQId44GOLT2Rtog2HDdvUwQFzHWUiA7W6YQ,506
|
|
27
|
+
carrottransform/tools/mapping_types.py,sha256=1jP3LdGzt3r1pXRk7xvyIURARFI0iPA4AsAF65pDVp4,758
|
|
28
|
+
carrottransform/tools/mappingrules.py,sha256=EP8Qn4RFCeraUrrg4OKhNQ9IkQUAyUiVCm1kyYZJf_A,18912
|
|
29
|
+
carrottransform/tools/metrics.py,sha256=v4JE7P-rC3wYzgYKouRkt7uYB8rPa_5FVyO-3r5wLHg,11702
|
|
30
|
+
carrottransform/tools/omopcdm.py,sha256=lG6YRw99jX1x74k2O5Q_36a7KKl9UckIJ2LkyrIWd-w,8731
|
|
31
|
+
carrottransform/tools/orchestrator.py,sha256=1hRuGSv7BaYGoYCDqzfgSbIRr--pTap8gUfzd8aiiHI,14162
|
|
32
|
+
carrottransform/tools/person_helpers.py,sha256=AVpyy-s3ijwSNth-fO0tBC1InKfVXrvernHb19mrCYU,4257
|
|
33
|
+
carrottransform/tools/record_builder.py,sha256=X4KlDrg56LTRVN3rz8hQKRTBtGdGdWK3wYAVJxuDSPs,16298
|
|
34
|
+
carrottransform/tools/stream_helpers.py,sha256=izx9OxekIApFXzmTfcmwVxbAngzqDsIzzBS5hp2S-lA,2772
|
|
35
|
+
carrottransform/tools/types.py,sha256=J9En6GBA21wBG0LyIpyzAP94WYEHgXfGpUSyyby9Ffk,1919
|
|
36
|
+
carrottransform/tools/validation.py,sha256=1SNfL9uhQ1jWSoOx1mUtd7YtgLOY6IPRRFZGC5aG3Y4,1432
|
|
37
|
+
carrot_transform-0.4.0.dist-info/METADATA,sha256=YkU8Fqs9zSk4_CdZBDbjX5KG6IILMwLQt6O5B1jboGA,4893
|
|
38
|
+
carrot_transform-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
39
|
+
carrot_transform-0.4.0.dist-info/entry_points.txt,sha256=WSJqmgB8PEK8iMl3IFEMBYuyXtzHX5PaKbG13R54AH4,75
|
|
40
|
+
carrot_transform-0.4.0.dist-info/licenses/LICENSE,sha256=pqIiuuTs6Na-oFd10MMsZoZmdfhfUhHeOtQzgzSkcaw,1082
|
|
41
|
+
carrot_transform-0.4.0.dist-info/RECORD,,
|
carrottransform/__init__.py
CHANGED
carrottransform/_version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from importlib.metadata import version
|
|
2
2
|
|
|
3
3
|
try:
|
|
4
|
-
__version__ = version("carrot_transform") # Defined in the pyproject.toml
|
|
4
|
+
__version__ = version("carrot_transform") # Defined in the pyproject.toml
|
|
5
5
|
except Exception:
|
|
6
|
-
__version__ = "unknown"
|
|
6
|
+
__version__ = "unknown"
|
carrottransform/cli/command.py
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
# Package entry point - sets up the "run" subcommand
|
|
2
2
|
from .subcommands.run import run
|
|
3
|
+
from .subcommands.run_v2 import run_v2
|
|
3
4
|
|
|
4
5
|
import carrottransform as c
|
|
5
6
|
import click
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
@click.group(invoke_without_command=True)
|
|
8
|
-
@click.option("--version","-v",is_flag=True)
|
|
10
|
+
@click.option("--version", "-v", is_flag=True)
|
|
9
11
|
@click.pass_context
|
|
10
|
-
def transform(ctx,version):
|
|
11
|
-
if ctx.invoked_subcommand
|
|
12
|
+
def transform(ctx, version):
|
|
13
|
+
if ctx.invoked_subcommand is None:
|
|
12
14
|
if version:
|
|
13
15
|
click.echo(c.__version__)
|
|
14
16
|
else:
|
|
15
|
-
click.echo(ctx.get_help())
|
|
17
|
+
click.echo(ctx.get_help())
|
|
16
18
|
return
|
|
17
19
|
|
|
20
|
+
|
|
18
21
|
transform.add_command(run, "run")
|
|
22
|
+
transform.add_command(run_v2, "run_v2")
|
|
19
23
|
|
|
20
24
|
if __name__ == "__main__":
|
|
21
|
-
|
|
25
|
+
transform()
|