Skip to main content

Data transformation 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.2.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

koza-0.2.2-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: koza-0.2.2.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for koza-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a9e0c031a6a3308dc2f99f3fc5a48fa4ab4e473a81cb00a0b446b7c9f5711efe
MD5 48cf3bde37cfd944499390966192277b
BLAKE2b-256 71ab95a0c978353cc0f9ebfaabd107f1aff92c2602f4e3fb793fbef608dad61f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: koza-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 31.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for koza-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe0c50bf4d3fa94615303905a2245cc69b6440fb140d563ed8ee2ada46d63fb
MD5 4c3d3979c7eaabbcaf39bd84e9d46987
BLAKE2b-256 77bee4f88258e0b9ae090ed48da099e72ac90c90489a7005e7634bba6a584bda

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