Metadata-Version: 2.3
Name: omnicli-sdk
Version: 0.1.0
Summary: Omni Python SDK
Project-URL: Homepage, https://omnicli.dev
Project-URL: Documentation, https://omnicli.dev
Project-URL: Repository, https://github.com/omnicli/sdk-python.git
Project-URL: Issues, https://github.com/omnicli/sdk-python/issues
Project-URL: Changelog, https://github.com/omnicli/sdk-python/commits/main/
Author-email: Raphaël Beamonte <raphael.beamonte@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Raphaël Beamonte <raphael.beamonte@gmail.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: omni,omnicli,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# 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

```bash
pip install omnicli-sdk
```

## Features

### Argument Parsing

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

```python
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](https://omnicli.dev/reference/custom-commands/path/metadata-headers) of your command, which can either be provided as a separate file:

```
your-repo
└── commands
    ├── your-command.py
    └── your-command.metadata.yaml
```

```yaml
# your-command.metadata.yaml
argparser: true
```

Or as part of your python command headers:

```python
# your-command.py
#
# argparser: true

import os
...
```

## Requirements

- Python 3.8 or higher
- No additional dependencies required

## Development

To set up for development:

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

# Install dependencies
omni up

# Run tests
omni test
```
