Synmax API client
Project description
Synmax API Client
Installation
If you just want to use the package, run:
pip install --upgrade synmax-api-python-client
Requirements
Make sure you have Python 3.7+ and pip installed.
Quickstart
Configuring synmax client
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)
# fetch regions
regions = hyperion_client.fetch_regions()
print(regions)
Paginated data
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
# 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')
payload.fetch_all = False
completions = hyperion_client.well_completion(payload)
print(completions)
# output
# {'data': [{....}, {....}....], 'pagination': {'page_size': 500, 'start': 0, 'total_count': 250}}
## Well data
result_list = hyperion_client.wells(payload)
## Product by Country and Operator
result_list = 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
pip install twine
python setup.py bdist_wheel
twine upload dist/*
python setup.py clean --all
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for synmax_api_python_client-0.0b5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e961ae600405bcc911ba12e31b183b731d0b146aa5da8f059873aca8c68fc6f |
|
MD5 | 291630e3fcfa94a635b5a93ab28ab79a |
|
BLAKE2b-256 | 3d0ba5277e7dd516845376e12f4e7bcf73b6dcb659c2c02a20255aa3f713c357 |