Skip to main content

omnipy-examples

Example projects that that makes use of the omnipy package for type-driven, scalable and interoperable data wrangling!

Main installation instructions

  • Install:
    • pip install omnipy-examples
  • Run example scripts:
    • Example: omnipy-examples isajson
    • For help on the command line interface: omnipy-examples --help
    • For help on a particular example: omnipy-examples isajson --help

Output of flow runs

The output will by default appear in the data directory, with a timestamp.

  • It is recommended to install a file viewer that are capable of browsing tar.gz files. For instance, the "File Expander" plugin in PyCharm is excellent for this.
  • To unpack the compressed files of a run on the command line (just make sure to replace the datetime string from this example):
for f in $(ls data/2023_02_03-12_51_51/*.tar.gz); do mkdir ${f%.tar.gz}; tar xfzv $f -C ${f%.tar.gz}; done

Run with the Prefect engine

Omnipy is integrated with the powerful Prefect data flow orchestration library.

  • To run an local example using the prefect engine, e.g.:
    • omnipy-examples --engine prefect isajson
  • After completion of some runs, you can check the flow logs and orchestration options in the Prefect UI:
    • prefect server start

To set up a kubernetes-based deployment on our NIRD test setup, run e.g.:

  • prefect config set PREFECT_API_URL=https://prefect.fairtracks.sigma2.no/api
  • prefect deploy -n isajson

The configuration of this job is found in the file prefect.yaml.

More info on Prefect configuration will come soon...

Development setup

  • Install Poetry:

    • curl -sSL https://install.python-poetry.org | python3 -
  • Install dependencies:

    • poetry install --with dev
  • Update all dependencies:

    • poetry update
  • Update single dependency, e.g.:

    • poetry update omnipy
  • If a dependency is not updated to the latest version available on Pypi, you might need to clear the pip cache of poetry:

    • poetry cache clear pypi --all

For mypy support in PyCharm

  • In PyCharm, install "Mypy" plugin (not "Mypy (Official)")
    • which mypy to get path to mypy binary
    • In the PyCharm settings for the mypy plugin:
      • Select the mypy binary
      • Select pyproject.toml as the mypy config file

For automatic formatting and linting

I have added my typical setup for automatic formatting and linting. The main alternative is to use black, which is easier to set up, but it does not have as many options. I am not fully happy with my config, but I at least like it better than black.

  • In PyCharm -> File Watchers:
    • Click arrow down icon
    • Select pycharm-file-watchers.xml
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Finished running "task-transpose-dicts-2-lists-annoying-wombat"! [omnipy.log.registry.RunStateRegistry]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Writing dataset as a gzipped tarpack to "/Users/sveinugu/PycharmProjects/omnipy_examples/outputs/2024_08_27-15_39_30/02_task_transpose_dicts_2_lists.tar.gz" [omnipy.compute.task.TaskWithMixins]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Finished running "func-flow-transpose-dicts-of-lists-of-dicts-2-lists-of-dicts-banana-antelope"! [omnipy.log.registry.RunStateRegistry]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Writing dataset as a gzipped tarpack to "/Users/sveinugu/PycharmProjects/omnipy_examples/outputs/2024_08_27-15_39_30/03_func_flow_transpose_dicts_of_lists_of_dicts_2_lists_of_dicts.tar.gz" [omnipy.compute.flow.FuncFlowWithMixins]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Initialized "func-flow-flatten-nested-json-incredible-bobcat" [omnipy.log.registry.RunStateRegistry]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Started running "func-flow-flatten-nested-json-incredible-bobcat"... [omnipy.log.registry.RunStateRegistry]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Initialized "task-flatten-outer-level-of-all-data-files-axiomatic-ape" [omnipy.log.registry.RunStateRegistry]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Started running "task-flatten-outer-level-of-all-data-files-axiomatic-ape"... [omnipy.log.registry.RunStateRegistry]
[OMNIPY]  Tue Aug 27 15:39:30 2024 - INFO: Finished running "task-flatten-outer-level-of-all-data-files-axiomatic-ape"! [omnipy.log.registry.RunStateRegistry]

Metadata

Release files for omnipy-examples 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for omnipy-examples 0.8.0
File Size Uploaded Provenance
omnipy_examples-0.8.0.tar.gz 10.2 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for omnipy-examples 0.8.0
File Interpreter ABI Platform
omnipy_examples-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.4 MB

Release files / omnipy_examples-0.8.0.tar.gz

Download URL omnipy_examples-0.8.0.tar.gz
Size 10.2 MB
Tags Source
SHA-256 checksum
How to use checksums
bb42b8e83f3e10a11eaceb19503cad0664358d778e958591a92a1683a2caa807
BLAKE2b-256 checksum
How to use checksums
0ba3e79b9c8a1df2e3723b37ab5c4571d069df54b5ba950e3f883d65cfc36e7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.10.8 Darwin/23.6.0

Release files / omnipy_examples-0.8.0-py3-none-any.whl

Download URL omnipy_examples-0.8.0-py3-none-any.whl
Size 10.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e850582c4070fdd39a33e8f573e336b6a60cea273f2946ad55efaf175cc09c41
BLAKE2b-256 checksum
How to use checksums
c83d54d46e48daa5ce0e2136d941a5698a2b29fcd19df09feb73a26dce4a5178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.10.8 Darwin/23.6.0

Security for omnipy-examples 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page