Skip to main content

No project description provided

Project description

Carrot Logo

Release License

Streamlined Data Transformation to OMOP


Carrot Transform automates data transformation processes and facilitates the standardisation of datasets to the OMOP vocabulary, simplifying the integration of diverse data sources.


Explore the docs »

Carrot Mapper is a webapp which allows the user to use the metadata (as output by WhiteRabbit) from a dataset to produce mapping rules to the OMOP standard, in the JSON format. These can be ingested by Carrot Transform to perform the mapping of the contents of the dataset to OMOP.

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).

Quick Start

To have the project up and running, please follow the Quick Start Guide.

If you need to perform development, there's a brief guide here to get the tool up and running.

Formatting and Linting

This project is using ruff to check formatting and linting. The only dependency is the uv command line tool. The .vscode/tasks.json file contains a task to run this tool for the currently open file. The commands can be run on thier own (in the root folder) like this ...

# reformat all the files in `./`
λ uv run ruff format .

# run linting checks all the files in `./` 
λ uv run ruff check .

# check and fix all the files in `./`
λ uv run ruff check --fix .

# check and fix all the files in `./` but do so so more eggrsively
λ uv run ruff check --fix --unsafe-fixes .

SQLAlchemy Workflow

Carrot-Transform can read input tables from SQLAlchemy. This is experimental, and requires specifying a connection-string as --input-db-url instead of an input dir folder. The person-file parameter and carrot-mapper workflow should still be used, as if working with .csv files, but carrot-transform can read from an SQLAlchemy database.

  1. Extract/export some rows from the various tables
    • something like SELECT column_name(s) FROM patients LIMIT 1000; is written to patients.csv
  2. the usual scan reports are performed on these subsets
  3. when carrot-transform is invoked instead of --input-dir one specifies --input-db-url with a database connection string
    • the --person-file parameter should still point to the equivalent of person_tablename.csv
    • the --rules-file parameter needs to refer to a file on the disk as usual
  4. carrot transform will still write data to --output-dir and otherwise operate as normal
    • The following parameters have undefined behaviour with this functionality
      • --write-mode
      • --saved-person-id-file
      • --use-input-person-ids
      • --last-used-ids-file

Release Procedure

To release a new version of carrot-transform follow the steps outlined on the documentation website.

License

This repository's source code is available under the MIT license.

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

carrot_transform-0.7.0.tar.gz (248.5 kB view details)

Uploaded Source

Built Distribution

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

carrot_transform-0.7.0-py3-none-any.whl (263.1 kB view details)

Uploaded Python 3

File details

Details for the file carrot_transform-0.7.0.tar.gz.

File metadata

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

File hashes

Hashes for carrot_transform-0.7.0.tar.gz
Algorithm Hash digest
SHA256 f3415bae9e58d21305c3b71de7c5b44d3eaef54175bb0106cc6f9d870feb332c
MD5 8c85d5665c1882668ae863a3115547dc
BLAKE2b-256 41fb957ee4c237a606c2206e4de2073aaf0bcbd2e57b7f29084391bffcf20586

See more details on using hashes here.

Provenance

The following attestation bundles were made for carrot_transform-0.7.0.tar.gz:

Publisher: pypi.publish.yml on Health-Informatics-UoN/carrot-transform

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

File details

Details for the file carrot_transform-0.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for carrot_transform-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f3a4f9e8a15d7265aa987a8a40b0a826c420add4063d6f619a3f4aef64857e
MD5 844dbe6a36d778773bad8e04dc43e46d
BLAKE2b-256 9f81e218054e06091356b1377f5a64ee131ca168451a4f85faf63627850a66d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for carrot_transform-0.7.0-py3-none-any.whl:

Publisher: pypi.publish.yml on Health-Informatics-UoN/carrot-transform

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