From fe0214c3be78867e523842718c9af8c4de17c082 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 29 May 2023 10:47:55 +0000 Subject: automatic import of python-koza --- python-koza.spec | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 python-koza.spec (limited to 'python-koza.spec') diff --git a/python-koza.spec b/python-koza.spec new file mode 100644 index 0000000..755ec46 --- /dev/null +++ b/python-koza.spec @@ -0,0 +1,281 @@ +%global _empty_manifest_terminate_build 0 +Name: python-koza +Version: 0.3.1 +Release: 1 +Summary: Data transformation framework for LinkML data models +License: BSD License +URL: https://pypi.org/project/koza/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b1/dd/8620d2612ca2c6b8a942760358e79cac25939d6761e68411694c2d781cb6/koza-0.3.1.tar.gz +BuildArch: noarch + +Requires: python3-linkml-validator +Requires: python3-pydantic +Requires: python3-pyyaml +Requires: python3-requests +Requires: python3-ordered-set +Requires: python3-typer +Requires: python3-typer-cli +Requires: python3-loguru + +%description +# Koza - a data transformation framework + +[![Pyversions](https://img.shields.io/pypi/pyversions/koza.svg)](https://pypi.python.org/pypi/koza) +[![PyPi](https://img.shields.io/pypi/v/koza.svg)](https://pypi.python.org/pypi/koza) +![Github Action](https://github.com/monarch-initiative/koza/actions/workflows/build.yml/badge.svg) + +![pupa](docs/img/pupa.png) + +[**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](https://github.com/biolink/kgx/blob/master/specification/kgx-format.md#kgx-format-as-tsv) + - 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/pipx: +``` +[pip|pipx] 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](https://koza.monarchinitiative.org/Usage/configuring_ingests/#transform-code) for details.** + +See the [Koza documentation](https://koza.monarchinitiative.org/) for usage information + +### Try the Examples + +#### Validate + +Give Koza a local or remote csv file, and get some basic information (headers, number of rows) + +```bash +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 + +```bash +koza validate \ + --file ./examples/data/ZFIN_PHENOTYPE_0.jsonl.gz \ + --format jsonl +``` + +```bash +koza validate \ + --file ./examples/data/ddpheno.json.gz \ + --format json \ + --compression gzip +``` + +#### Transform + +Run the example ingest, "string/protein-links-detailed" +```bash +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) + +%package -n python3-koza +Summary: Data transformation framework for LinkML data models +Provides: python-koza +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-koza +# Koza - a data transformation framework + +[![Pyversions](https://img.shields.io/pypi/pyversions/koza.svg)](https://pypi.python.org/pypi/koza) +[![PyPi](https://img.shields.io/pypi/v/koza.svg)](https://pypi.python.org/pypi/koza) +![Github Action](https://github.com/monarch-initiative/koza/actions/workflows/build.yml/badge.svg) + +![pupa](docs/img/pupa.png) + +[**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](https://github.com/biolink/kgx/blob/master/specification/kgx-format.md#kgx-format-as-tsv) + - 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/pipx: +``` +[pip|pipx] 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](https://koza.monarchinitiative.org/Usage/configuring_ingests/#transform-code) for details.** + +See the [Koza documentation](https://koza.monarchinitiative.org/) for usage information + +### Try the Examples + +#### Validate + +Give Koza a local or remote csv file, and get some basic information (headers, number of rows) + +```bash +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 + +```bash +koza validate \ + --file ./examples/data/ZFIN_PHENOTYPE_0.jsonl.gz \ + --format jsonl +``` + +```bash +koza validate \ + --file ./examples/data/ddpheno.json.gz \ + --format json \ + --compression gzip +``` + +#### Transform + +Run the example ingest, "string/protein-links-detailed" +```bash +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) + +%package help +Summary: Development documents and examples for koza +Provides: python3-koza-doc +%description help +# Koza - a data transformation framework + +[![Pyversions](https://img.shields.io/pypi/pyversions/koza.svg)](https://pypi.python.org/pypi/koza) +[![PyPi](https://img.shields.io/pypi/v/koza.svg)](https://pypi.python.org/pypi/koza) +![Github Action](https://github.com/monarch-initiative/koza/actions/workflows/build.yml/badge.svg) + +![pupa](docs/img/pupa.png) + +[**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](https://github.com/biolink/kgx/blob/master/specification/kgx-format.md#kgx-format-as-tsv) + - 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/pipx: +``` +[pip|pipx] 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](https://koza.monarchinitiative.org/Usage/configuring_ingests/#transform-code) for details.** + +See the [Koza documentation](https://koza.monarchinitiative.org/) for usage information + +### Try the Examples + +#### Validate + +Give Koza a local or remote csv file, and get some basic information (headers, number of rows) + +```bash +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 + +```bash +koza validate \ + --file ./examples/data/ZFIN_PHENOTYPE_0.jsonl.gz \ + --format jsonl +``` + +```bash +koza validate \ + --file ./examples/data/ddpheno.json.gz \ + --format json \ + --compression gzip +``` + +#### Transform + +Run the example ingest, "string/protein-links-detailed" +```bash +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) + +%prep +%autosetup -n koza-0.3.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-koza -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 29 2023 Python_Bot - 0.3.1-1 +- Package Spec generated -- cgit v1.2.3