pyaspenplus is a lightweight Python wrapper to interact with Aspen Plus via a programmatic API. It provides a simple client interface to open cases, run simulations, read and write stream values, and save results. The library is backend-agnostic and supports a COM backend (for real Aspen Plus on Windows) and a Mock backend (for development and testing).
- Connect to Aspen Plus via COM (Windows)
- Open / save case files, run simulations
- Read and write stream properties
- Clean, documented API and examples
- CI workflows for testing and publishing to PyPI
Install from PyPI (after publishing):
pip install pyaspenplus
Or install from source:
python -m pip install .
Note: To use the COM backend you must be on Windows with Aspen Plus installed and pywin32 (or comtypes) available.
from pyaspenplus import AspenPlusClient
client = AspenPlusClient(backend="mock") # use mock for local testing
with client.connect():
client.open_case("example.bkp")
client.run()
streams = client.get_streams()
print(streams)Full examples in the examples/ folder.
This repository includes a GitHub Actions workflow that will publish to PyPI when you push a git tag that matches v* (for example v0.1.0). To enable publishing:
- Create an API token on PyPI.
- Add it to your GitHub repository secrets as
PYPI_API_TOKEN. - Tag a release and push:
git tag v0.1.0 && git push --tags - The workflow
.github/workflows/publish.ymlwill build and upload to PyPI.
See docs/usage.md and docs/api.md for usage and API reference.
Apache-2.0 license