ResSimpy: Python API for working with Reservoir Simulator models
Introduction
ResSimpy is a Python API for automating reservoir simulation workflows, allowing the user to read, manipulate and write reservoir simulation input decks. Whilst it was created by staff at BP, we welcome contributions from anybody interested, whether it is by raising pull requests, or simply suggesting features / raising bugs in the GitHub issues.
Documentation
See the complete package documentation on readthedocs.
Installation
ResSimpy can be installed with pip:
pip install ressimpy
Contributing
Please see Contributing Guide for instructions on how to set up a dev environment and contribute code to the project.
Getting Started
The following Python code examples demonstrate how to perform some simple operations on a model using ResSimpy:
Step 1: Import the library
from ResSimpy import NexusSimulator as Simulator
Step 2: Initialise the model
nexus_fcs_file = '/path/to/fcsfile.fcs'
model = Simulator(origin=nexus_fcs_file) # Create the 'Simulator' model object
Once these steps are completed, you are able to perform any supported operations on the model. The following code snippets are examples of a few such operations:
Writing Out Files
# Update the files in the model that have been modified.
# IMPORTANT: no changes made to the model, such as adding completions or removing constraints will be applied to the model files until this function is called.
model.update_simulator_files()
# Create a copy of the entire model
model.write_out_new_simulator(new_file_path='/new/path/to/fcsfile.fcs', new_include_file_location='/new/path/to/includes_directory/')
Wells - Get wells overview
wells_info = model.wells.get_wells_overview() # Returns a list of wells with their information. Can be print()ed
print(wells_info)
Wells - Get information about an individual Well
well = model.wells.get(well_name='well_1') # Retrieves the named well as a NexusWell object
# You can then access the various properties for that well (such as perforations, shutins, completion events etc) using (for example)
perforations = well.perforations
# You can pretty print the information about a well using
print(well.printable_well_info)
# Get the wells information in dataframe format
wells_df = model.wells.get_df()
print(wells_df)
Completions
# Adding a completion
new_completion = {'date': '01/02/2025', 'i': 4, 'j': 5, 'k': 6, 'well_radius': 7.50} # Create a dictionary containing the properties of the completion you wish to add
model.wells.add_completion(well_name='well_1', completion_properties=new_completion) # Add the new completion
# Removing a completion
completion_to_modify = {'date': '01/02/2025', 'i': 4, 'j': 5, 'k': 6, 'well_radius': 7.5} # Create a dictionary containing the properties of the existing completion
model.wells.remove_completion(well_name='well_1', completion_properties=completion_to_modify) # Remove the completion
# Modifying a completion
modified_properties = {'date': '10/03/2025'} # Create a dict with the properties you want to change and their new values
model.wells.modify_completion(well_name='well_1', properties_to_modify=modified_properties, completion_to_change=completion_to_modify) # Modify the completion
Structured Grid - Get a list of the array functions applied to the grid
func_list = model.grid.get_array_functions_list()
func_summary_df = model.grid.get_array_functions_df() # get a dataframe instead
[print(x) for x in func_list[0:9]] # Example showing how to print out the first 10 functions
Networks - Get constraints
constraints = model.network.constraints.get_all()
constraints_for_well = constraints['well_1'] # Get the constraints for the well well_1
# You can then access various properties related to the constraints, such as oil, water and gas rates using
oil_rate = constraints_for_well[0].max_surface_oil_rate
print(f"\nmax surface oil rate: {oil_rate}")
# Get a dataframe with all constraints in it.
constraint_df = model.network.constraints.get_df()
print(constraint_df)
Networks - Get dataframes of well connections, wellbores, network connections and nodes
df_well_cons = model.network.connections.get_df()
df_well_bores = model.network.wellbores.get_df()
df_connections = model.network.connections.get_df()
df_nodes = model.network.nodes.get_df()
Support
For most bugs or feature requests, we recommend using GitHub issues. If, however, you have a query related to something else, or if your query relates to something confidential, please feel free to email the team at ResSimpy@bp.com.
Metadata
Release files for ResSimpy 2.6.2
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 |
|---|---|---|---|---|
| ressimpy-2.6.2.tar.gz | 273.6 kB | With provenance | Details for ressimpy-2.6.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ressimpy-2.6.2-py3-none-any.whl | Python 3 | none | any | Details for ressimpy-2.6.2-py3-none-any.whl |
Total release size: 680.3 kB
Release files / ressimpy-2.6.2.tar.gz
| Download URL | ressimpy-2.6.2.tar.gz |
|---|---|
| Size | 273.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36084192e92fe030b9143586f2f850cda48128b4206eea990a150d0bb7d4f751
|
|
BLAKE2b-256 checksum How to use checksums |
796e772a8881be4c758dc08a7827026d03ffefdc67e4e8174054d0e284954be6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 18, 2026.
Transparency logRelease files / ressimpy-2.6.2-py3-none-any.whl
| Download URL | ressimpy-2.6.2-py3-none-any.whl |
|---|---|
| Size | 406.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a976397d6862db61872bf4b97e1092f8d3aebf811604b2c114ca60f337a04a3
|
|
BLAKE2b-256 checksum How to use checksums |
763fd647e1819ffc406cf9e180a10e7438c3974820231082993b1eb21ac60c59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 18, 2026.
Transparency logSecurity for ResSimpy 2.6.2
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ressimpy-2.6.2.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 Sep 18, 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.