Skip to main content

omnicli-sdk (sdk-python)

Python SDK for building Omni commands.

Overview

omnicli-sdk is a Python package that provides functionality to help build commands that will be executed by Omni. It offers various utilities and helpers that make it easier to work with Omni's features from within Python.

Installation

pip install omnicli-sdk

Features

Argument Parsing

The SDK can read omni-parsed arguments from environment variables into a familiar Python format:

from omnicli import parse_args

try:
    args = parse_args()

    # Access your command's arguments as attributes
    if args.verbose:
        print("Verbose mode enabled")

    if args.input_file:
        print(f"Processing file: {args.input_file}")

except ArgListMissingError:
    print("No Omni CLI arguments found. Make sure 'argparser: true' is set for your command.")

The resulting arguments can be used the same as they would have been when coming from using 'argparse.ArgumentParser().parse_args()', as they will be returned as an 'argparse.Namespace' object, with their values in the expected types.

Integration with omni

The argument parser of omni needs to be enabled for your command. This can be done as part of the metadata of your command, which can either be provided as a separate file:

your-repo
└── commands
    ├── your-command.py
    └── your-command.metadata.yaml
# your-command.metadata.yaml
argparser: true

Or as part of your python command headers:

# your-command.py
#
# argparser: true

import os
...

Requirements

  • Python 3.8 or higher
  • No additional dependencies required

Development

To set up for development:

# Clone the repository
omni clone https://github.com/omnicli/sdk-python.git

# Install dependencies
omni up

# Run tests
omni test

Metadata

Release files for omnicli-sdk 0.1.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 omnicli-sdk 0.1.0
File Size Uploaded
omnicli_sdk-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for omnicli-sdk 0.1.0
File Interpreter ABI Platform
omnicli_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / omnicli_sdk-0.1.0.tar.gz

Download URL omnicli_sdk-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fab44333cf0589191a6d4d4b14d34ab155937ae32ad0af1dbc8a6b7ceaf5f6e8
BLAKE2b-256 checksum
How to use checksums
191e0ea09cb0fe35e67b4f03dc11259cfdee18a79f01a1f5c03f8120e8431d9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2024.

Transparency log

Release files / omnicli_sdk-0.1.0-py3-none-any.whl

Download URL omnicli_sdk-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35f115ea3d17e4e792fd781aada1c1d0f37752603baa9d10581127326a26d4dd
BLAKE2b-256 checksum
How to use checksums
22d8124cca3eeae8205c7ff2b00f509958d3dd0976c8cf7c3a9050b8788c50ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

0.0.0

2 release files

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