Metadata-Version: 2.4
Name: processforge
Version: 0.3.8
Summary: A Python-based process simulation framework for chemical engineering applications.
Author-email: Processforge Team <team@processforge.dev>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/urjanova/processforge
Project-URL: Repository, https://github.com/urjanova/processforge
Project-URL: Issues, https://github.com/urjanova/processforge/issues
Keywords: process,simulation,chemical,engineering,flowsheet
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: scipy>=1.14
Requires-Dist: matplotlib>=3.9
Requires-Dist: loguru>=0.7
Requires-Dist: jsonschema>=4.20
Requires-Dist: graphviz>=0.20
Requires-Dist: pandas>=2.2
Requires-Dist: zarr>=3.0
Requires-Dist: coolprop>=7.2.0
Requires-Dist: typer>=0.12
Provides-Extra: eo
Requires-Dist: pyomo>=6.7; extra == "eo"
Provides-Extra: eo-casadi
Requires-Dist: pyomo>=6.7; extra == "eo-casadi"
Requires-Dist: casadi>=3.6; extra == "eo-casadi"
Provides-Extra: fmu
Requires-Dist: pythonfmu>=0.6; extra == "fmu"
Provides-Extra: modelica
Requires-Dist: OMPython>=4.0.0; extra == "modelica"
Requires-Dist: fmpy>=0.3; extra == "modelica"
Provides-Extra: cantera
Requires-Dist: cantera>=3.0; extra == "cantera"
Provides-Extra: coolprop
Requires-Dist: coolprop>=6.6; extra == "coolprop"
Provides-Extra: pcl
Requires-Dist: pint>=0.24; extra == "pcl"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Dynamic: license-file

# Processforge

![processforge-logo](images/processforge-logo.svg)

A lightweight Python framework for process simulation, coupling hydraulic, thermal, and reactor workflows.

## Install

Install the `pf` command-line tool with [uv](https://docs.astral.sh/uv/):

```bash
uv tool install processforge
```

For CoolProp-backed units:

```bash
uv tool install "processforge[coolprop]"
```

Optional solver backends:

```bash
uv tool install "processforge[eo]"
uv tool install "processforge[eo-casadi]"
uv tool install "processforge[modelica]"
```

## Quick start

1. **Install the tool**

   ```bash
   uv tool install processforge
   ```

2. **Download an example flowsheet**

   ```bash
   curl -O https://raw.githubusercontent.com/urjanova/processforge/master/flowsheets/hydraulic-chain.json
   ```

3. **Initialize, plan, and apply**

   ```bash
   pf init flowsheets/hydraulic-chain.json
   pf plan flowsheets/hydraulic-chain.json
   pf apply flowsheets/hydraulic-chain.json
   ```

   `plan` validates the flowsheet (schema, DOF, units) without running the solver; `apply` solves it and stores a snapshot.

4. **Look at the output**

   `pf apply` writes results under `outputs/`:
   - `*_results.zarr` — simulation results store (per-variable arrays, composition flattened)
   - `*_results.zarr.schema.json` — schema file describing streams, variables, dtypes, units, shapes, and run provenance
   - `*.pfstate/` — versioned snapshot store with a `latest` pointer

   For flowsheets with Tank units (dynamic), use `pf run` instead of `pf apply` to solve with the SM solver.

## Python API

```python
from processforge import EOFlowsheet, validate_flowsheet
config = validate_flowsheet("flowsheets/hydraulic-chain.json")
fs = EOFlowsheet(config, backend="scipy")
results = fs.run()
```

## Usage
See the [usage guide](docs/usage.md) for CLI commands and workflows.

Individual providers (e.g. FESTIM, OpenMC) can be run via Docker images using the provider image contract.

## Flowsheets
The core of Processforge is the flowsheet JSON format, which defines materials, units, and recycle rules. See below for more information on the formats and example flowsheets.
- [docs/flowsheets.md](docs/flowsheets.md) : flowsheet JSON format, materials, units, and recycle rules
- [flowsheets/](flowsheets/) : example flowsheets shipped with the repo


## License

BSD 3-Clause License
