Metadata-Version: 2.4
Name: ots-shared
Version: 0.4.0
Summary: Shared constants and utilities for OTS operations tools
Project-URL: Repository, https://github.com/onetimesecret/ots-shared
Project-URL: Issues, https://github.com/onetimesecret/ots-shared/issues
Author: Onetime
License-Expression: MIT
License-File: LICENSE
Keywords: cli,infrastructure,shared
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Requires-Dist: cyclopts>=3.9
Requires-Dist: hcloud>=2.16.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pyright>=1.1.390; extra == 'dev'
Requires-Dist: ruff>=0.7; extra == 'dev'
Provides-Extra: ssh
Requires-Dist: paramiko>=3.4; extra == 'ssh'
Provides-Extra: test
Requires-Dist: pytest-cov>=5.0; extra == 'test'
Requires-Dist: pytest-mock>=3.14; extra == 'test'
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

# ots-shared

Shared constants, taxonomy, and utility libraries for the OneTimeSecret operations
tooling family (rots, lots, pots).

This package is not intended for end-user consumption. It is published to PyPI so the
downstream operator-facing CLIs can pin a single, versioned source of truth for:

- exit codes and error taxonomy
- command history records
- environment marker / scaffold helpers
- SSH connection and executor protocols
- Hetzner Cloud (`hcloud`) configuration, network, and server defaults

## Install

```bash
pip install ots-shared

# with optional SSH dependencies (paramiko)
pip install "ots-shared[ssh]"
```

## Layout

```
src/ots_shared/
  cli.py            # init sub-app exposed by downstream CLIs
  exit_codes.py     # canonical exit codes
  history.py        # command history serialization
  init.py           # environment scaffold helpers
  taxonomy.py       # error taxonomy
  hcloud/           # Hetzner Cloud config, networks, server defaults
  ssh/              # connection + executor protocols
```

## Development

```bash
uv sync --extra dev --extra test --extra ssh
uv run pytest tests/
uv run ruff check src/
uv run pyright src/
```

## Releasing

Tag a `vX.Y.Z` commit on `main`. The `Release` workflow builds the wheel and sdist,
creates a GitHub release with auto-generated notes, and publishes to PyPI via Trusted
Publisher. The PyPI environment in the workflow must match the project on
`pypi.org/p/ots-shared`.

## License

MIT — see [LICENSE](./LICENSE).
