CLI and Resources
OpenPinch ships packaged learning assets in addition to the Python API. The resource helpers are the primary programmatic surface for discovering, inspecting, and copying those assets. The command-line surface is intentionally narrow and only copies notebooks.
Command-Line Interface
The published package currently exposes one CLI subcommand:
notebookfor copying packaged example notebooks
Command-line helpers for packaged OpenPinch notebook assets.
- OpenPinch.__main__.build_parser()[source]
Create the CLI argument parser.
- Return type:
ArgumentParser
- OpenPinch.__main__.main(argv=None)[source]
Execute the OpenPinch CLI.
- Parameters:
argv (list[str] | None)
- Return type:
int
This means the CLI is an onboarding surface, not a solve surface. Validation, targeting, graph export, Excel export, and dashboard launch all happen through Python.
Packaged Resources
The resources module exposes the packaged sample cases and notebooks used throughout the guides and examples.
The main helpers are:
list_sample_cases(),sample_case_metadata(), andread_sample_case()for discovery and inspectioncopy_sample_case()for local editable copieslist_notebooks(),notebook_metadata(), andcopy_notebook()for the packaged notebook series
The internal PinchProblem and PinchWorkspace coordinators also resolve
packaged sample-case names such as basic_pinch.json directly when no local
file with the same name exists.
The packaged notebooks are intended to be copied as clean source assets. They
ship without stored execution output and exercise the same unsupported
PinchWorkspace and plotting internals documented elsewhere in RTD. The
series is ordered around first solves, Total Site method interpretation,
multiperiod studies, advanced Heat Pump screening, direct gas/vapour MVR,
VC+MVR cascade mechanics, HEN synthesis, energy-transfer analysis, and
schema/service integration.
The current optional install split is:
openpinch[notebook]for Jupyter, Plotly graph rendering, and Excel I/Oopenpinch[dashboard]for Streamlit plus the same plotting/export stackopenpinch[synthesis]for solver-backed heat exchanger network synthesisopenpinch[brayton_cycle]for TESPy-backed Brayton-cycle toolingopenpinch[full]for every optional surface, including the IDAES/Pyomo synthesis stack; runidaes get-extensionsafter installation
Helpers for accessing packaged OpenPinch sample cases and notebooks.
- class OpenPinch.resources.NotebookMetadata(name, title, description, topics=())[source]
Bases:
objectDescription of one packaged notebook.
- Parameters:
name (str)
title (str)
description (str)
topics (tuple[str, ...])
- class OpenPinch.resources.SampleCaseMetadata(name, title, description, topics=())[source]
Bases:
objectDescription of one packaged sample case.
- Parameters:
name (str)
title (str)
description (str)
topics (tuple[str, ...])
- OpenPinch.resources.copy_notebook(name, destination)[source]
Copy a packaged notebook to
destination.- Parameters:
name (str)
destination (str | Path)
- Return type:
Path
- OpenPinch.resources.copy_sample_case(name, destination)[source]
Copy a packaged sample case to
destination.- Parameters:
name (str)
destination (str | Path)
- Return type:
Path
- OpenPinch.resources.list_notebooks()[source]
Return the packaged notebook filenames.
- Return type:
list[str]
- OpenPinch.resources.list_sample_cases()[source]
Return the packaged sample-case filenames.
- Return type:
list[str]
- OpenPinch.resources.notebook_metadata(name=None)[source]
Return metadata for one or all packaged notebooks.
- Parameters:
name (str | None)
- OpenPinch.resources.read_sample_case(name)[source]
Return the text of a packaged sample case.
- Parameters:
name (str)
- Return type:
str
- OpenPinch.resources.sample_case_metadata(name=None)[source]
Return metadata for one or all packaged sample cases.
- Parameters:
name (str | None)
Packaged Asset Modules
Packaged data assets for examples and notebooks.
Packaged sample cases for OpenPinch user workflows.
Packaged example notebooks for OpenPinch user workflows.
Dashboard Surface
OpenPinch also includes a Streamlit-oriented graphing and dashboard path for
interactive exploration after solving a problem. Install
openpinch[dashboard] before using this surface.
The repository-level streamlit_app.py module is documented here as a local
demo entrypoint for contributors. It is not part of the published wheel.
Application code can call problem.show_dashboard() explicitly after
targeting.
Streamlit entry point for exploring OpenPinch analysis results.
Run with streamlit run streamlit_app.py to load the bundled demonstration
case and launch the interactive dashboard defined in
OpenPinch.presentation.dashboard.
- streamlit_app.validate_problem_path(problem_path)[source]
Stop the Streamlit app early when the configured problem file is missing.
- Return type:
None
Where This Fits
Use packaged resources when you want reproducible examples, shareable learning assets, or a fast onboarding path. Use Package-Root API for the application contract; use the other API pages only when contributor-level detail is acceptable.