Name | omnicli-sdk JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Omni Python SDK |
upload_time | 2024-11-12 04:17:24 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
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
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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
```
Raw data
{
"_id": null,
"home_page": null,
"name": "omnicli-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "omni, omnicli, sdk",
"author": null,
"author_email": "Rapha\u00ebl Beamonte <raphael.beamonte@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/19/1e/0ea09cb0fe35e67b4f03dc11259cfdee18a79f01a1f5c03f8120e8431d9e/omnicli_sdk-0.1.0.tar.gz",
"platform": null,
"description": "# omnicli-sdk (sdk-python)\n\nPython SDK for building Omni commands.\n\n## Overview\n\n`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.\n\n## Installation\n\n```bash\npip install omnicli-sdk\n```\n\n## Features\n\n### Argument Parsing\n\nThe SDK can read omni-parsed arguments from environment variables into a familiar Python format:\n\n```python\nfrom omnicli import parse_args\n\ntry:\n args = parse_args()\n\n # Access your command's arguments as attributes\n if args.verbose:\n print(\"Verbose mode enabled\")\n\n if args.input_file:\n print(f\"Processing file: {args.input_file}\")\n\nexcept ArgListMissingError:\n print(\"No Omni CLI arguments found. Make sure 'argparser: true' is set for your command.\")\n```\n\nThe 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.\n\n### Integration with omni\n\nThe 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:\n\n```\nyour-repo\n\u2514\u2500\u2500 commands\n \u251c\u2500\u2500 your-command.py\n \u2514\u2500\u2500 your-command.metadata.yaml\n```\n\n```yaml\n# your-command.metadata.yaml\nargparser: true\n```\n\nOr as part of your python command headers:\n\n```python\n# your-command.py\n#\n# argparser: true\n\nimport os\n...\n```\n\n## Requirements\n\n- Python 3.8 or higher\n- No additional dependencies required\n\n## Development\n\nTo set up for development:\n\n```bash\n# Clone the repository\nomni clone https://github.com/omnicli/sdk-python.git\n\n# Install dependencies\nomni up\n\n# Run tests\nomni test\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Rapha\u00ebl 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.",
"summary": "Omni Python SDK",
"version": "0.1.0",
"project_urls": {
"Changelog": "https://github.com/omnicli/sdk-python/commits/main/",
"Documentation": "https://omnicli.dev",
"Homepage": "https://omnicli.dev",
"Issues": "https://github.com/omnicli/sdk-python/issues",
"Repository": "https://github.com/omnicli/sdk-python.git"
},
"split_keywords": [
"omni",
" omnicli",
" sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "22d8124cca3eeae8205c7ff2b00f509958d3dd0976c8cf7c3a9050b8788c50ed",
"md5": "08cd694aeadcc9a08dda2692cf8151f7",
"sha256": "35f115ea3d17e4e792fd781aada1c1d0f37752603baa9d10581127326a26d4dd"
},
"downloads": -1,
"filename": "omnicli_sdk-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "08cd694aeadcc9a08dda2692cf8151f7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6210,
"upload_time": "2024-11-12T04:17:22",
"upload_time_iso_8601": "2024-11-12T04:17:22.872546Z",
"url": "https://files.pythonhosted.org/packages/22/d8/124cca3eeae8205c7ff2b00f509958d3dd0976c8cf7c3a9050b8788c50ed/omnicli_sdk-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "191e0ea09cb0fe35e67b4f03dc11259cfdee18a79f01a1f5c03f8120e8431d9e",
"md5": "f5754c7321ed62d5b34e588d770ac876",
"sha256": "fab44333cf0589191a6d4d4b14d34ab155937ae32ad0af1dbc8a6b7ceaf5f6e8"
},
"downloads": -1,
"filename": "omnicli_sdk-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "f5754c7321ed62d5b34e588d770ac876",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4790,
"upload_time": "2024-11-12T04:17:24",
"upload_time_iso_8601": "2024-11-12T04:17:24.614892Z",
"url": "https://files.pythonhosted.org/packages/19/1e/0ea09cb0fe35e67b4f03dc11259cfdee18a79f01a1f5c03f8120e8431d9e/omnicli_sdk-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-12 04:17:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "omnicli",
"github_project": "sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "omnicli-sdk"
}