Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/equinor/openserver
Code for running Petroleum Experts OpenServer API commands in Python
https://github.com/equinor/openserver
gap petex prosper wellhydraulics
Last synced: about 2 months ago
JSON representation
Code for running Petroleum Experts OpenServer API commands in Python
- Host: GitHub
- URL: https://github.com/equinor/openserver
- Owner: equinor
- License: gpl-3.0
- Created: 2020-05-20T19:10:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-30T14:05:46.000Z (about 1 year ago)
- Last Synced: 2024-01-09T11:24:43.012Z (12 months ago)
- Topics: gap, petex, prosper, wellhydraulics
- Language: Python
- Homepage:
- Size: 164 KB
- Stars: 29
- Watchers: 8
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[![PyPI](https://img.shields.io/pypi/v/openserver)](https://pypi.org/project/openserver/)
[![SCM Compliance](https://scm-compliance-api.radix.equinor.com/repos/equinor/openserver/badge)](https://scm-compliance-api.radix.equinor.com/repos/equinor/openserver/badge)
[![Runs on Windows](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)](https://img.shields.io/badge/Windows-0078D6?style=for-the-badge&logo=windows&logoColor=white)# OpenServer
Code for running Petroleum Experts OpenServer API commands in Python. More general information about this API protocol can be found on [Petroleum Experts'](https://www.petex.com/products/ipm-suite/openserver/) site.Please have a look at the [CONTRIBUTING.MD file](https://github.com/equinor/OpenServer/blob/master/CONTRIBUTING.md) if you want to contribute.
## Python
### Getting started
Install the required package:
```
pip install openserver
```### Example in Python
There are two ways of using the functions, either by importing a class called OpenServer or by importing all modules. The first is the most "pythonic" way which can be used to disconnect from the license server. The latter is easier for those converting from visual basic style coding environment.
The following code will import the OpenServer module, start Prosper, open a Prosper file named well_2 on C-drive and adding a comment into the comment section in Prosper.
#### by using the class ####
```
from openserver import OpenServerc = OpenServer()
c.connect()c.DoCmd('PROSPER.START()')
c.DoCmd('PROSPER.OPENFILE("C:\\well_2.OUT")')
c.DoSet('PROSPER.SIN.SUM.Comments', 'Testing OpenServer from Python')c.disconnect()
```or
```
from openserver import OpenServerwith OpenServer() as c:
c.DoCmd('PROSPER.START()')
c.DoCmd('PROSPER.OPENFILE("C:\\well_2.OUT")')
c.DoSet('PROSPER.SIN.SUM.Comments', 'Testing OpenServer from Python')
```#### by importing all modules ####
```
from openserver import *DoCmd('PROSPER.START()')
DoCmd('PROSPER.OPENFILE("C:\\well_2.OUT")')
DoSet('PROSPER.SIN.SUM.Comments', 'Testing OpenServer from Python')
```