Metadata-Version: 2.4
Name: nomad-pydantic
Version: 0.1.1
Summary: Pydantic models for nomad
Project-URL: Repository, https://github.com/airflow-laminar/nomad-pydantic
Project-URL: Homepage, https://github.com/airflow-laminar/nomad-pydantic
Author-email: the nomad-pydantic authors <t.paine154@gmail.com>
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.11
Requires-Dist: hydra-core<2,>=1.3
Requires-Dist: pydantic<3,>=2
Provides-Extra: develop
Requires-Dist: build; extra == 'develop'
Requires-Dist: bump-my-version; extra == 'develop'
Requires-Dist: check-dist; extra == 'develop'
Requires-Dist: codespell; extra == 'develop'
Requires-Dist: hatchling; extra == 'develop'
Requires-Dist: mdformat; extra == 'develop'
Requires-Dist: mdformat-tables>=1; extra == 'develop'
Requires-Dist: pytest; extra == 'develop'
Requires-Dist: pytest-cov; extra == 'develop'
Requires-Dist: ruff; extra == 'develop'
Requires-Dist: twine; extra == 'develop'
Requires-Dist: ty; extra == 'develop'
Requires-Dist: uv; extra == 'develop'
Requires-Dist: wheel; extra == 'develop'
Description-Content-Type: text/markdown

# nomad-pydantic

Typed Python models for building, validating, rendering, and managing
[Nomad](https://developer.hashicorp.com/nomad) jobs.

[![Build Status](https://github.com/airflow-laminar/nomad-pydantic/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/airflow-laminar/nomad-pydantic/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/airflow-laminar/nomad-pydantic/branch/main/graph/badge.svg)](https://codecov.io/gh/airflow-laminar/nomad-pydantic)
[![License](https://img.shields.io/github/license/airflow-laminar/nomad-pydantic)](https://github.com/airflow-laminar/nomad-pydantic)
[![PyPI](https://img.shields.io/pypi/v/nomad-pydantic.svg)](https://pypi.python.org/pypi/nomad-pydantic)

`nomad-pydantic` represents jobs, task groups, tasks, resources, services,
volumes, and periodic schedules as Pydantic models. It renders the JSON envelope
accepted by `nomad job run -json` and provides a mockable client for common
Nomad CLI lifecycle operations.

```python
from nomad_pydantic import Job, NomadConfiguration, Task, TaskGroup

config = NomadConfiguration(
    job=Job(
        id="hello",
        type="batch",
        task_groups=[
            TaskGroup(
                name="hello",
                tasks=[
                    Task(
                        name="hello",
                        driver="docker",
                        config={"image": "alpine:3", "args": ["echo", "hello"]},
                    )
                ],
            )
        ],
    )
)

config.write()
```

## Documentation

- [Tutorial](docs/src/tutorial.md) builds and renders a first job.
- [How-to guides](docs/src/how-to.md) cover Hydra, periodic jobs, and lifecycle
  operations.
- [Concepts](docs/src/explanation.md) explains the model hierarchy and JSON
  boundary.
- [API reference](docs/src/api.md) documents every public model and client.

## Ecosystem

`nomad-pydantic` follows the same configuration pattern as
[supervisor-pydantic](https://github.com/airflow-laminar/supervisor-pydantic),
[systemd-pydantic](https://github.com/airflow-laminar/systemd-pydantic), and
[cron-pydantic](https://github.com/airflow-laminar/cron-pydantic). The broader
declarative Airflow stack is built from
[airflow-pydantic](https://github.com/airflow-laminar/airflow-pydantic) and
[airflow-config](https://github.com/airflow-laminar/airflow-config), with runtime
integrations provided by
[airflow-supervisor](https://github.com/airflow-laminar/airflow-supervisor),
[airflow-systemd](https://github.com/airflow-laminar/airflow-systemd), and
[airflow-cron](https://github.com/airflow-laminar/airflow-cron).

## Installation

```bash
pip install nomad-pydantic
```
