Skip to main content

Omni Python SDK

Project description

omnicli (sdk-python)

Python SDK for building Omni commands.

Overview

omnicli 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

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
git clone https://github.com/omnicli/sdk-python.git
cd omnicli

# Install dependencies
omni up

# Run tests
omni test

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

omnicli_sdk-0.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

omnicli_sdk-0.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file omnicli_sdk-0.0.0.tar.gz.

File metadata

  • Download URL: omnicli_sdk-0.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for omnicli_sdk-0.0.0.tar.gz
Algorithm Hash digest
SHA256 565b0827f7856804ea4cf88ad7ec5effea52de5096dfd264358cf29202e8b91f
MD5 bd4db6bbeefbbdb34bae758441f919fb
BLAKE2b-256 8065b8229810d719efa921f3811080fa92b33964c30134efa682bc4e479d1d03

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnicli_sdk-0.0.0.tar.gz:

Publisher: build.yaml on omnicli/sdk-python

Attestations:

File details

Details for the file omnicli_sdk-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: omnicli_sdk-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for omnicli_sdk-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c29b778bbe0444aff8f046dcb95dff9f48768995febdcccd845b31ca18cd1e0
MD5 1fac79ac174b1e972aa3658251be6bd7
BLAKE2b-256 52d374406194dbff32f4fd9d1ef42be7ad423b05663d379557d5cd1b80883e79

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnicli_sdk-0.0.0-py3-none-any.whl:

Publisher: build.yaml on omnicli/sdk-python

Attestations:

Supported by

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