openserver


Nameopenserver JSON
Version 1.151 PyPI version JSON
download
home_page
SummaryPetroleum Experts OpenServer calculations
upload_time2023-10-27 13:56:22
maintainer
docs_urlNone
authorStian Molvik
requires_python>=3.9,<3.13
licenseGNU GPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<img src="https://raw.githubusercontent.com/equinor/openserver/master/resources/logo.png" title="OpenServer"/>
</p>

[![PyPI](https://img.shields.io/pypi/v/openserver)](https://pypi.org/project/openserver/)

# 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 OpenServer

c = 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 OpenServer

with 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')
```



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "openserver",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<3.13",
    "maintainer_email": "",
    "keywords": "",
    "author": "Stian Molvik",
    "author_email": "stimo@equinor.com",
    "download_url": "https://files.pythonhosted.org/packages/1d/9b/bbc0d4e4fb127ae6eab6d6f624c60ae8e10fbb329e5b8692ad21fde15081/openserver-1.151.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n<img src=\"https://raw.githubusercontent.com/equinor/openserver/master/resources/logo.png\" title=\"OpenServer\"/>\n</p>\n\n[![PyPI](https://img.shields.io/pypi/v/openserver)](https://pypi.org/project/openserver/)\n\n# OpenServer\nCode 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.\n\nPlease have a look at the [CONTRIBUTING.MD file](https://github.com/equinor/OpenServer/blob/master/CONTRIBUTING.md) if you want to contribute.\n\n\n## Python\n\n### Getting started\nInstall the required package:\n```\npip install openserver\n```\n\n### Example in Python\n\nThere 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. \n\nThe 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.\n\n#### by using the class ####\n\n```\nfrom openserver import OpenServer\n\nc = OpenServer()\nc.connect()\n\nc.DoCmd('PROSPER.START()')\nc.DoCmd('PROSPER.OPENFILE(\"C:\\\\well_2.OUT\")')\nc.DoSet('PROSPER.SIN.SUM.Comments', 'Testing OpenServer from Python')\n\nc.disconnect()\n```\n\nor\n\n```\nfrom openserver import OpenServer\n\nwith OpenServer() as c:\n    c.DoCmd('PROSPER.START()')\n    c.DoCmd('PROSPER.OPENFILE(\"C:\\\\well_2.OUT\")')\n    c.DoSet('PROSPER.SIN.SUM.Comments', 'Testing OpenServer from Python')\n```\n\n#### by importing all modules ####\n\n```\nfrom openserver import *\n\nDoCmd('PROSPER.START()')\nDoCmd('PROSPER.OPENFILE(\"C:\\\\well_2.OUT\")')\nDoSet('PROSPER.SIN.SUM.Comments', 'Testing OpenServer from Python')\n```\n\n\n",
    "bugtrack_url": null,
    "license": "GNU GPL",
    "summary": "Petroleum Experts OpenServer calculations",
    "version": "1.151",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8454a522021f4fe3164a3084cf6d44e3b525327674de3eaf7434201826342eb",
                "md5": "f516411e15402aa5d87745700df7eb8f",
                "sha256": "e0f2ed362934fca34d75d1894b75ea8fb01b63e13ff77be61f0edcaf60315286"
            },
            "downloads": -1,
            "filename": "openserver-1.151-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f516411e15402aa5d87745700df7eb8f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<3.13",
            "size": 16118,
            "upload_time": "2023-10-27T13:56:21",
            "upload_time_iso_8601": "2023-10-27T13:56:21.012262Z",
            "url": "https://files.pythonhosted.org/packages/b8/45/4a522021f4fe3164a3084cf6d44e3b525327674de3eaf7434201826342eb/openserver-1.151-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d9bbbc0d4e4fb127ae6eab6d6f624c60ae8e10fbb329e5b8692ad21fde15081",
                "md5": "214d474a5c4ef2036338d33f78b2c8ea",
                "sha256": "db4e4ca97cf5fad03e401240dbeb66cc272a444d49f798fb0db6c68faf0d8fe9"
            },
            "downloads": -1,
            "filename": "openserver-1.151.tar.gz",
            "has_sig": false,
            "md5_digest": "214d474a5c4ef2036338d33f78b2c8ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<3.13",
            "size": 15351,
            "upload_time": "2023-10-27T13:56:22",
            "upload_time_iso_8601": "2023-10-27T13:56:22.321841Z",
            "url": "https://files.pythonhosted.org/packages/1d/9b/bbc0d4e4fb127ae6eab6d6f624c60ae8e10fbb329e5b8692ad21fde15081/openserver-1.151.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-27 13:56:22",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "openserver"
}
        
Elapsed time: 6.20314s