synmax-api-python-client


Namesynmax-api-python-client JSON
Version 0.0.41 PyPI version JSON
download
home_pagehttps://github.com/SynMaxDev/synmax-api-python-client.git
SummarySynmax API client
upload_time2023-11-17 10:33:44
maintainer
docs_urlNone
authorEric Anderson and Deepa Aswathaiah
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Synmax API Client

## Installation

If you just want to use the package, run:

```bash
pip install --upgrade synmax-api-python-client
```

### Requirements

Make sure you have [Python 3.7+](https://docs.python.org/3/) and [pip](https://pypi.org/project/pip/) installed.

## Quickstart

    Hyperion API Swagger doc: https://hyperion.api.synmax.com/apidocs/#/default

### Jupyter notebook setting 
    run this block of code at the beggining of synmax api client
```python

!pip install nest_asyncio

import nest_asyncio
nest_asyncio.apply()

After this run your code as usual.
```
### Configuring synmax client

```python

import logging
from synmax.hyperion import HyperionApiClient, ApiPayload

# enable debug if required.
logging.basicConfig(level=logging.DEBUG)

# two ways to pass access token.
# 1. Set environment variables: os.environ['access_token'] = 'your token'
# OR
# 2. pass to HyperionApiClient instance
access_token = 'your access token goes here'
hyperion_client = HyperionApiClient(access_token=access_token)

```

#### Fetching data based on your subscription key (access_key)

```python
from synmax.hyperion import HyperionApiClient, ApiPayload

hyperion_client = HyperionApiClient(access_token='....')
# fetch regions
region_df = hyperion_client.fetch_regions()
print(region_df.count())


```

#### Paginated data

```python

import logging
from synmax.hyperion import HyperionApiClient, ApiPayload

# enable debug if required.
logging.basicConfig(level=logging.DEBUG)

# two ways to pass access token.
# 1. Set environment variables: os.environ['access_token'] = 'your token'
# 2. pass to HyperionApiClient instance
access_token = 'your access token goes here'
hyperion_client = HyperionApiClient(access_token=access_token)

# well completion based on input filters of type ApiPayload; 
# fetch_all = True will paginate all of rows and return accumulation of each page result. True by default
# set fetch_all=False to get first page or any single page starting row with payload.pagination_start = <start row index, default to 0>
payload = ApiPayload(start_date='2022-06-1', end_date='2022-06-25', state_code='TX')

# return result is in pandas.DataFrame
completions_df = hyperion_client.well_completion(payload)
print(completions_df.count())
# output is in pandas.DataFrame
# Querying API pages: 100%|██████████| 8/8 [00:06<00:00,  1.14it/s]

# with optional payload to fetch full dataset
result_df = hyperion_client.wells()
print(result_df.count())
# Querying API wells pages:   0%|          | 4/7225 [00:16<8:51:17,  4.41s/it]


## Well data
result_df = hyperion_client.wells(payload)

## Product by Country and Operator
result_df = hyperion_client.production_by_county_and_operator(payload)

## Available api methods on hyperion_client
dir(hyperion_client)
# output: ['ducs_by_operator', 'fetch_regions', 'frac_crews', 'production_by_county_and_operator', 'production_by_well', 'rigs', 'well_completion', 'wells']

```

## publishing package

```shell
pip install twine

python setup.py bdist_wheel 

twine upload dist/*


python setup.py clean --all


```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SynMaxDev/synmax-api-python-client.git",
    "name": "synmax-api-python-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Eric Anderson and Deepa Aswathaiah",
    "author_email": "",
    "download_url": "",
    "platform": null,
    "description": "# Synmax API Client\n\n## Installation\n\nIf you just want to use the package, run:\n\n```bash\npip install --upgrade synmax-api-python-client\n```\n\n### Requirements\n\nMake sure you have [Python 3.7+](https://docs.python.org/3/) and [pip](https://pypi.org/project/pip/) installed.\n\n## Quickstart\n\n    Hyperion API Swagger doc: https://hyperion.api.synmax.com/apidocs/#/default\n\n### Jupyter notebook setting \n    run this block of code at the beggining of synmax api client\n```python\n\n!pip install nest_asyncio\n\nimport nest_asyncio\nnest_asyncio.apply()\n\nAfter this run your code as usual.\n```\n### Configuring synmax client\n\n```python\n\nimport logging\nfrom synmax.hyperion import HyperionApiClient, ApiPayload\n\n# enable debug if required.\nlogging.basicConfig(level=logging.DEBUG)\n\n# two ways to pass access token.\n# 1. Set environment variables: os.environ['access_token'] = 'your token'\n# OR\n# 2. pass to HyperionApiClient instance\naccess_token = 'your access token goes here'\nhyperion_client = HyperionApiClient(access_token=access_token)\n\n```\n\n#### Fetching data based on your subscription key (access_key)\n\n```python\nfrom synmax.hyperion import HyperionApiClient, ApiPayload\n\nhyperion_client = HyperionApiClient(access_token='....')\n# fetch regions\nregion_df = hyperion_client.fetch_regions()\nprint(region_df.count())\n\n\n```\n\n#### Paginated data\n\n```python\n\nimport logging\nfrom synmax.hyperion import HyperionApiClient, ApiPayload\n\n# enable debug if required.\nlogging.basicConfig(level=logging.DEBUG)\n\n# two ways to pass access token.\n# 1. Set environment variables: os.environ['access_token'] = 'your token'\n# 2. pass to HyperionApiClient instance\naccess_token = 'your access token goes here'\nhyperion_client = HyperionApiClient(access_token=access_token)\n\n# well completion based on input filters of type ApiPayload; \n# fetch_all = True will paginate all of rows and return accumulation of each page result. True by default\n# set fetch_all=False to get first page or any single page starting row with payload.pagination_start = <start row index, default to 0>\npayload = ApiPayload(start_date='2022-06-1', end_date='2022-06-25', state_code='TX')\n\n# return result is in pandas.DataFrame\ncompletions_df = hyperion_client.well_completion(payload)\nprint(completions_df.count())\n# output is in pandas.DataFrame\n# Querying API pages: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 8/8 [00:06<00:00,  1.14it/s]\n\n# with optional payload to fetch full dataset\nresult_df = hyperion_client.wells()\nprint(result_df.count())\n# Querying API wells pages:   0%|          | 4/7225 [00:16<8:51:17,  4.41s/it]\n\n\n## Well data\nresult_df = hyperion_client.wells(payload)\n\n## Product by Country and Operator\nresult_df = hyperion_client.production_by_county_and_operator(payload)\n\n## Available api methods on hyperion_client\ndir(hyperion_client)\n# output: ['ducs_by_operator', 'fetch_regions', 'frac_crews', 'production_by_county_and_operator', 'production_by_well', 'rigs', 'well_completion', 'wells']\n\n```\n\n## publishing package\n\n```shell\npip install twine\n\npython setup.py bdist_wheel \n\ntwine upload dist/*\n\n\npython setup.py clean --all\n\n\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Synmax API client",
    "version": "0.0.41",
    "project_urls": {
        "Homepage": "https://github.com/SynMaxDev/synmax-api-python-client.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "326c14d5dcf753366adab0107903b9e5810cdb9b67cb23a67fcc756b3da93ecc",
                "md5": "ecb8763f3aa35744e5ee100aa1b23a9f",
                "sha256": "4610404350a4637f39dc59999875aac7d29f4a0336cd79811b90a7c44938b38c"
            },
            "downloads": -1,
            "filename": "synmax_api_python_client-0.0.41-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ecb8763f3aa35744e5ee100aa1b23a9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 31321,
            "upload_time": "2023-11-17T10:33:44",
            "upload_time_iso_8601": "2023-11-17T10:33:44.656981Z",
            "url": "https://files.pythonhosted.org/packages/32/6c/14d5dcf753366adab0107903b9e5810cdb9b67cb23a67fcc756b3da93ecc/synmax_api_python_client-0.0.41-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-17 10:33:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SynMaxDev",
    "github_project": "synmax-api-python-client",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "requirements": [],
    "lcname": "synmax-api-python-client"
}
        
Elapsed time: 0.15157s