Metadata-Version: 2.1
Name: samco-job-lifecycle
Version: 0.1.0
Summary: A small, dependency-free state machine for tracking job lifecycles
Author: samcoai
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE

# samco-job-lifecycle

A small, dependency-free Python library for tracking the state of a job. It validates transitions, records UTC timestamps, and keeps an in-memory event history. It does not run jobs or store them in a database.

## Install

```sh
pip install samco-job-lifecycle
```

## Example

```python
from samco_job_lifecycle import Job, JobStatus

job = Job("report-42")
job.start()
job.succeed()

assert job.status is JobStatus.SUCCEEDED
assert job.is_terminal
print(job.events)
```

Valid paths are `pending -> running -> succeeded|failed|cancelled` and `pending -> cancelled`. Terminal jobs cannot transition again. Invalid changes raise `InvalidTransition`.

Requires Python 3.9 or newer.
