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
pip install samco-job-lifecycle
Example
from samco_job_lifecycle import Job, JobStatus
job = Job("your-project-id") # Replace this with your own identifier
job.start()
job.succeed()
assert job.status is JobStatus.SUCCEEDED
assert job.is_terminal
print(job.events)
The string passed to Job is an ID you choose. If your application already has a project ID, you can use it here. The library only tracks this job's state; it does not look up or create a project.
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.
Metadata
Release files for samco-job-lifecycle 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| samco_job_lifecycle-0.1.1.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| samco_job_lifecycle-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / samco_job_lifecycle-0.1.1.tar.gz
| Download URL | samco_job_lifecycle-0.1.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f682ea7b81086eb6cd7c6c58df0b357c010c7049e51475a3cd632741ae4cd2a6
|
|
BLAKE2b-256 checksum How to use checksums |
a1df46304d156822fc3c9ddb1d6ac6e776a83a9bb88924cce5223a35b496e05f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.10
|
Release files / samco_job_lifecycle-0.1.1-py3-none-any.whl
| Download URL | samco_job_lifecycle-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7b528b923b2c642afe5232507a6f070cf16eb24bf8b99340f57cbde07b0f132
|
|
BLAKE2b-256 checksum How to use checksums |
21aedc6cf1611fc8bf5c4e99d98d4b7dca7432e6fcb705e2d289b15cd9e52d39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.10
|