Omni Python SDK
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omnicli_sdk-0.1.0.tar.gz.
File metadata
- Download URL: omnicli_sdk-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fab44333cf0589191a6d4d4b14d34ab155937ae32ad0af1dbc8a6b7ceaf5f6e8
|
|
| MD5 |
f5754c7321ed62d5b34e588d770ac876
|
|
| BLAKE2b-256 |
191e0ea09cb0fe35e67b4f03dc11259cfdee18a79f01a1f5c03f8120e8431d9e
|
Provenance
The following attestation bundles were made for omnicli_sdk-0.1.0.tar.gz:
Publisher:
build.yaml on omnicli/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omnicli_sdk-0.1.0.tar.gz -
Subject digest:
fab44333cf0589191a6d4d4b14d34ab155937ae32ad0af1dbc8a6b7ceaf5f6e8 - Sigstore transparency entry: 148286085
- Sigstore integration time:
-
Permalink:
omnicli/sdk-python@79e07ad782fbdef90684c3a8c81854aac5135ac1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/omnicli
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@79e07ad782fbdef90684c3a8c81854aac5135ac1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file omnicli_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: omnicli_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35f115ea3d17e4e792fd781aada1c1d0f37752603baa9d10581127326a26d4dd
|
|
| MD5 |
08cd694aeadcc9a08dda2692cf8151f7
|
|
| BLAKE2b-256 |
22d8124cca3eeae8205c7ff2b00f509958d3dd0976c8cf7c3a9050b8788c50ed
|
Provenance
The following attestation bundles were made for omnicli_sdk-0.1.0-py3-none-any.whl:
Publisher:
build.yaml on omnicli/sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omnicli_sdk-0.1.0-py3-none-any.whl -
Subject digest:
35f115ea3d17e4e792fd781aada1c1d0f37752603baa9d10581127326a26d4dd - Sigstore transparency entry: 148286088
- Sigstore integration time:
-
Permalink:
omnicli/sdk-python@79e07ad782fbdef90684c3a8c81854aac5135ac1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/omnicli
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yaml@79e07ad782fbdef90684c3a8c81854aac5135ac1 -
Trigger Event:
push
-
Statement type: