Skip to main content

Koza, an ETL framework for LinkML data models

Project description

Koza - a data transformation framework Pyversions PyPi

pupa

Documentation: https://koza.monarchinitiative.org/

Disclaimer: Koza is in beta; we are looking for beta testers

Overview

  • Transform csv, json, yaml, jsonl, and xml and converting them to a target csv, json, or jsonl format based on your dataclass model.
  • Koza also can output data in the KGX format
  • Write data transforms in semi-declarative Python
  • Configure source files, expected columns/json properties and path filters, field filters, and metadata in yaml
  • Create or import mapping files to be used in ingests (eg id mapping, type mappings)
  • Create and use translation tables to map between source and target vocabularies

Installation

Koza is available on PyPi and can be installed via pip:

pip install koza

Usage

NOTE: As of version 0.2.0, there is a new method for getting your ingest's KozaApp instance. Please see the updated documentation for details.

See the Koza documentation for usage information

Try the Examples

Validate

Give Koza a local or remote csv file, and get some basic information (headers, number of rows)

koza validate \
  --file https://raw.githubusercontent.com/monarch-initiative/koza/main/examples/data/string.tsv \
  --delimiter ' '

Sending a json or jsonl formatted file will confirm if the file is valid json or jsonl

koza validate \
  --file ./examples/data/ZFIN_PHENOTYPE_0.jsonl.gz \
  --format jsonl
koza validate \
  --file ./examples/data/ddpheno.json.gz \
  --format json \
  --compression gzip

Transform

Run the example ingest, "string/protein-links-detailed"

koza transform --source examples/string/protein-links-detailed.yaml --global-table examples/translation_table.yaml

koza transform --source examples/string-declarative/protein-links-detailed.yaml --global-table examples/translation_table.yaml

note: koza expects a directory structure as described in the above example (examples/ingest_name/ingest.yaml)

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

koza-0.2.1.tar.gz (251.0 kB view details)

Uploaded Source

Built Distribution

koza-0.2.1-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file koza-0.2.1.tar.gz.

File metadata

  • Download URL: koza-0.2.1.tar.gz
  • Upload date:
  • Size: 251.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for koza-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2273245b98ec2ba1d19532d116db124260e8fc5e05556b97f96de7c8168713ee
MD5 da3aeb2615bef38ed386d2d191d6e686
BLAKE2b-256 c33f55755d7e9904082df19dd11c405caca7666e3d814aa1b33692207f6161d3

See more details on using hashes here.

File details

Details for the file koza-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: koza-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for koza-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55d4b9f5565a0a6c98c1470582d5b2c2ab97f7c225373913f6008645ff9dfafe
MD5 9b7151f80a45c62c0c12a03f977d4a21
BLAKE2b-256 90bacab2232da64b5bd106811a04ae21d29d035c7402d48b82dd6995d0194368

See more details on using hashes here.

Supported by

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