Metadata-Version: 2.4
Name: ingenium-lib
Version: 0.1.2
Summary: Python libraries supporting OpenIngenium
Author-email: Christopher Swan <open-ingenium@jpl.nasa.gov>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/OpenIngenium/ingenium-lib
Project-URL: Source, https://github.com/OpenIngenium/ingenium-lib
Project-URL: Issues, https://github.com/OpenIngenium/ingenium-lib/issues
Keywords: ingenium,open-ingenium
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: rich>=15.0.0
Requires-Dist: requests>=2.34.2
Requires-Dist: PyJWT>=2.13.0
Requires-Dist: openpyxl>=3.1.5
Requires-Dist: deepdiff>=9.1.0
Dynamic: license-file

# ingenium-lib

[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

Libraries and scripts to interact with and support [Ingenium](https://github.com/OpenIngenium) operations. This repository provides the `ing_lib` Python package and a set of command-line utilities for managing Ingenium project configurations, venues, test step data, and AMPCS dictionaries.

## Structure

The repository is organized as follows:

-   `ing_lib/`: The main Python package.
    -   `__init__.py`: Package initializer and version accessor.
    -   `common.py`: Shared utility functions, REST helpers, authentication handling, Ingenium API endpoint constants, and the `IngeniumLibError` exception.
    -   `logs.py`: Logging configuration using `RichHandler` for console output.
    -   `project_config.py`: Core library for querying and managing Ingenium Project Configurations, including command/telemetry dictionaries, V&V information, and custom scripts.
    -   `venue.py`: Client library for the Ingenium venue management API, including venue and venue group operations.
    -   `steps.py`: Helper classes and functions for creating Ingenium steps, including bit-mask operations and `ReturnOn` enums.
    -   `apps/`: Command-line applications for managing Project Configurations:
        -   `ProjConfigBackup.py`: Backs up project configuration content from an Ingenium server.
        -   `ProjConfigRestore.py`: Restores project configuration content from a backup file.
        -   `ProjConfigClear.py`: Deletes all project configuration information from an Ingenium server.
        -   `ProjConfigCreateUpdateCS.py`: Creates or updates a custom script on an Ingenium server from XML or JSON input.
        -   `ProjConfigLoadDict.py`: Reads XML dictionary files (AMPCS or XTCE format) and uploads them to an Ingenium server.
        -   `ProjConfigPalette.py`: Reads/writes the Step Palette to an Excel file and supports query, diff, and update modes.
    -   `utils/`: Standalone utility scripts.
        -   `ProjConfigV3toV4Convert.py`: Converts verification item (VI) JSON data from API v3 format to v4 format.
    -   `tests/`: Pytest test suite, including unit and integration tests for the library and all applications.
-   `pyproject.toml`: Packaging configuration for the `ing_lib` package (published on PyPI as `ingenium-lib`).
-   `requirements.txt`: Python package dependencies.
-   `LICENSE`: Apache 2.0 license.

## Related repositories

Reference steps and schemas live in [ingenium-ref](https://github.com/OpenIngenium/ingenium-ref):

-   `docs/custom_script_schema.rnc`: RELAX NG Compact schema for custom script XML, the format read by `ProjConfigCreateUpdateCS.py`.
-   `steps/reference/`: Example steps built on `ing_lib`, each with sample input/output JSON and a `custom_script.xml`.

API and JSON formats live in [dict-service](https://github.com/OpenIngenium/dict-service):

-   `openapi.yaml`: OpenAPI specification for the dictionary service API. (which includes the JSON schemas)

## Installation

The package is published on PyPI as `ingenium-lib` (import name `ing_lib`):

```bash
pip install ingenium-lib
```

For development, install from the repository root:

```bash
pip install -r requirements.txt
pip install .
```

The package requires Python 3.10 or higher.

## Command-line tools

Installing the package also installs the following commands:

-   `proj-config-backup`: Back up project configuration content from an Ingenium server.
-   `proj-config-restore`: Restore project configuration content from a backup file.
-   `proj-config-clear`: Delete all project configuration information from an Ingenium server.
-   `proj-config-create-update-cs`: Create or update a custom script on an Ingenium server from XML or JSON input.
-   `proj-config-load-dict`: Read XML dictionary files (AMPCS or XTCE format) and upload them to an Ingenium server.
-   `proj-config-palette`: Read/write the Step Palette to an Excel file (query, diff, and update modes).
-   `proj-config-v3-to-v4-convert`: Convert verification item (VI) JSON data from API v3 format to v4 format.

Run any command with `--help` for usage details.
