Process Risk Consequence Toolkit
23 discoverable Python calculations, strict SI contracts, reproducible receipts, JSON Schemas and dependency-traced workflows. Apache-2.0.
The toolkit covers release/source screening, passive dispersion, fire and explosion effects, normalized exposure, conditional risk, optional SLABx dense-gas histories and an explicitly restricted coupled-layer research model.
This is an independent project. It is not an official CCPS/AIChE product,
an endorsed standard implementation, or a safety certification. The legacy
ccps_consequence import and schema IDs are compatibility identifiers.
No purchased standards, book text, tables, figures, worked examples or external
engine source are distributed. Rights review.
Start here
python -m pip install process-risk-consequence-toolkit
# Optional features, installed explicitly:
python -m pip install 'process-risk-consequence-toolkit[http,coupled,dense]'
Publication status: Zenodo 0.1.0 is available. PyPI publication is pending. The optional pinned slabx==1.0.8 engine was locally tested but is not currently published on PyPI; the dense extra cannot yet be installed from PyPI alone. Base, HTTP and coupled features do not require it. Public CI runs without the native engine and reports native tests as skips. Do not substitute another version silently.
Python 3.12+. Base dependency: Pydantic. coupled adds NumPy, dense adds the
pinned separate slabx==1.0.8 engine, and http adds FastAPI/Uvicorn.
from ccps_consequence import Context, calculate, verify_receipt
context = Context(asset_id="T1", scenario_id="leak", operating_case_id="normal")
receipt = calculate("source/inventory", {
"mass_rate_kg_s": 2.0, "duration_s": 8.0, "inventory_kg": 10.0
}, context=context)
assert receipt.outputs["released_mass_kg"] == 10.0
verify_receipt(receipt)
Human and machine interfaces
| Need | Entry point |
|---|---|
| Complete user guide | Manual / 한국어 안내 |
| Every module and all input/output fields | Module index / shared models |
| Python discovery | calculation_catalog(), contract_schemas() |
| Command line | prct --help, prct catalog, prct schema |
| Typed request / response | Each module's *Input / output models |
| Machine contracts | Schema index |
| Dependency workflows | Workflow, run_workflow; workflow guide |
| HTTP / interactive API docs | prct serve; /docs, /openapi.json |
| Maintenance / next session | AGENTS.md, developer handoff |
| Test evidence | Validation, verification/release.json |
prct catalog
prct schema --calculation source/liquid
prct workflow examples/ccps_screening.workflow.json
prct capabilities
prct serve --host 127.0.0.1 --port 8765
CLI results are JSON on stdout, errors are JSON on stderr with a nonzero exit code. HTTP calculation failures use 422; no silent fallback engine/model.
Model map
| Family | Registered calculations | Scope |
|---|---|---|
| Source | 5 | liquid/gas orifices, inventory, sensible-heat flash, supplied-flux evaporation |
| Dispersion / histories | 7 | Gaussian plume/puff, Richardson screen, SLABx instantaneous/release histories, sampled dose, coupled 1D layer |
| Fire | 4 | fireball size/duration, supplied solid flame, sphere radiation, pool energy |
| Effects / explosion | 6 | point radiation, dose, probit, threshold, TNT scaling, fixed EPA 1 psi endpoint |
| Conditional risk | 1 | explicit LOC frequency and mutually exclusive branches |
All 23 calculations and their parameters are documented individually in the generated module reference. Inputs use Pa absolute, K, kg, m and s. Molecular weight for native dense contracts is kg/mol. Evidence, applicability literals and basis fields are part of the contract, not optional engineering judgments inferred by the software.
Three different dense-gas routes
| Route | Calculation | Meaning |
|---|---|---|
| Instantaneous | dispersion/slabx-instantaneous |
actual isolated SLABx puff dynamics plus authored receptor reconstruction |
| Finite / continuous histories | dispersion/slabx-release-history |
native constant-segment plume-to-puff; pretransition reconstruction and segment independence are explicit approximations |
| Coupled research layer | dispersion/coupled-layer-1d |
one shared nonlinear mass/species/momentum grid; 1D, isothermal, fixed width, vertically mixed |
The coupled route is not a 2D/thermal/two-layer solver or a validated replacement for SLAB/TWODEE. Entrainment and wind-relaxation closures require explicit user qualification. Software conservation/refinement tests are not field validation. Passive Gaussian routes do not become dense models because a screen is passed.
Examples and interoperability
python examples/ccps_dense_history.py
python examples/ccps_release_history.py --mode variable
python examples/ccps_coupled_layer.py --compare-independent
All examples are newly authored synthetic data. PRISM left-held rows, API-581
release receipts and PHA LOC-frequency boundaries preserve source hashes and
ownership. External engine/software source is not included. The optional
ccps_consequence.pha_adapter requires a separately installed compatible PHA
Core; this distribution does not relicense or ship PHA Core or its UI/database.
Integration manual.
Development and release
git clone https://github.com/lyullee/process-risk-consequence-toolkit.git
cd process-risk-consequence-toolkit
python -m pip install -e '.[dev,dense]'
python scripts/build_ccps_contracts.py
python scripts/build_manual.py
python -m pytest -q
python -m build
python -m twine check dist/*
python scripts/release_audit.py --dist
See implementation history, limitations, contribution rules and release checklist. Validation counts in this portable distribution are reported separately from the earlier host PHA integration runs. Do not reuse old counts as release proof.
License and citation
Copyright 2026 Ugwiyeon Lee. Apache-2.0; NOTICE and third-party boundaries apply. Referenced organizations' names and marks remain theirs; no logo or endorsement rights are granted. Use CITATION.cff for citation metadata. DOI and index publication links are added only after their publication is verified.
Metadata
Release files for process-risk-consequence-toolkit 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| process_risk_consequence_toolkit-0.1.0.tar.gz | 146.4 kB | With provenance | Details for process_risk_consequence_toolkit-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| process_risk_consequence_toolkit-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for process_risk_consequence_toolkit-0.1.0-py3-none-any.whl |
Total release size: 202.4 kB
Release files / process_risk_consequence_toolkit-0.1.0.tar.gz
| Download URL | process_risk_consequence_toolkit-0.1.0.tar.gz |
|---|---|
| Size | 146.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eaf6470f2fde85a821118ed619a82faedc2e23efa731519b58a912931d38beff
|
|
BLAKE2b-256 checksum How to use checksums |
31f2c3cab727f579db1598b58e82b48e2ad4ae2bb83b67b3dc9f4cdd3936ca95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / process_risk_consequence_toolkit-0.1.0-py3-none-any.whl
| Download URL | process_risk_consequence_toolkit-0.1.0-py3-none-any.whl |
|---|---|
| Size | 56.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca78d15bf1f0f38ba79d2381291059067380211658ca0dc2345584adb4adfd86
|
|
BLAKE2b-256 checksum How to use checksums |
0e8a5e4b2cddb843abefaa8d28ae2fcf94502cd2ddc42fe63a83b3cbd05c39ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for process-risk-consequence-toolkit 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for process_risk_consequence_toolkit-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.