synmax-api-python-client 0.0.44__py3-none-any.whl → 0.0.45__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- DATA/fips_lookup.csv +3196 -3196
- synmax/common/__init__.py +2 -2
- synmax/common/api_client.py +309 -309
- synmax/common/model.py +33 -31
- synmax/config/__init__.py +5 -5
- synmax/hyperion/__init__.py +68 -68
- synmax/hyperion/hyperion_client.py +181 -171
- {synmax_api_python_client-0.0.44.dist-info → synmax_api_python_client-0.0.45.dist-info}/METADATA +10 -13
- synmax_api_python_client-0.0.45.dist-info/RECORD +17 -0
- {synmax_api_python_client-0.0.44.dist-info → synmax_api_python_client-0.0.45.dist-info}/WHEEL +1 -1
- test/hyperion_test.py +187 -187
- test/ip_rate_example.py +50 -50
- synmax_api_python_client-0.0.44.dist-info/RECORD +0 -17
- {synmax_api_python_client-0.0.44.dist-info → synmax_api_python_client-0.0.45.dist-info}/top_level.txt +0 -0
synmax/common/model.py
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
from pydantic import BaseModel
|
|
2
|
-
from typing import Optional, List, Union
|
|
3
|
-
from datetime import date
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class PayloadModelBase(BaseModel):
|
|
7
|
-
pagination_start: Optional[int] = 0
|
|
8
|
-
start_date: Optional[date] = None
|
|
9
|
-
end_date: Optional[date] = None
|
|
10
|
-
forecast_run_date: Optional[date] = None
|
|
11
|
-
production_month: Optional[Union[int, List[int]]] = None
|
|
12
|
-
first_production_month: Optional[date] = None
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
from pydantic import BaseModel
|
|
2
|
+
from typing import Optional, List, Union
|
|
3
|
+
from datetime import date
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PayloadModelBase(BaseModel):
|
|
7
|
+
pagination_start: Optional[int] = 0
|
|
8
|
+
start_date: Optional[date] = None
|
|
9
|
+
end_date: Optional[date] = None
|
|
10
|
+
forecast_run_date: Optional[date] = None
|
|
11
|
+
production_month: Optional[Union[int, List[int]]] = None
|
|
12
|
+
first_production_month: Optional[date] = None
|
|
13
|
+
first_production_month_start: Optional[date] = None
|
|
14
|
+
first_production_month_end: Optional[date] = None
|
|
15
|
+
state_code: Optional[Union[str, List[str]]] = None
|
|
16
|
+
region: Optional[Union[str, List[str]]] = None
|
|
17
|
+
sub_region: Optional[Union[str, List[str]]] = None
|
|
18
|
+
county: Optional[Union[str, List[str]]] = None
|
|
19
|
+
operator: Optional[Union[str, List[str]]] = None
|
|
20
|
+
api: Optional[Union[int, List[int]]] = None
|
|
21
|
+
aggregate_by: Optional[Union[str, List[str]]] = None
|
|
22
|
+
service_company: Optional[Union[str, List[str]]] = None
|
|
23
|
+
frac_class: Optional[Union[str, List[str]]] = None
|
|
24
|
+
rig_class: Optional[Union[str, List[str]]] = None
|
|
25
|
+
completion_class: Optional[Union[str, List[str]]] = None
|
|
26
|
+
category: Optional[Union[str, List[str]]] = None
|
|
27
|
+
modeled: Optional[bool] = None
|
|
28
|
+
|
|
29
|
+
# nerc_id: Optional[Union[str, List[str]]] = None
|
|
30
|
+
|
|
31
|
+
def payload(self, pagination_start=None):
|
|
32
|
+
# just intercept the payload calls so they aren't relayed to `object`
|
|
33
|
+
pass
|
synmax/config/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
PROJECT_DIR = Path(__file__).parent.parent.absolute()
|
|
5
|
-
DATA_FOLDER = os.path.join(PROJECT_DIR, 'DATA')
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
PROJECT_DIR = Path(__file__).parent.parent.absolute()
|
|
5
|
+
DATA_FOLDER = os.path.join(PROJECT_DIR, 'DATA')
|
synmax/hyperion/__init__.py
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import calendar
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
import pandas as pd
|
|
5
|
-
|
|
6
|
-
from .hyperion_client import HyperionApiClient, ApiPayload
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def monthly_to_daily(row, prod_column='gas_monthly', date_column='date'):
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
:param row:
|
|
13
|
-
:param prod_column:
|
|
14
|
-
:param date_column:
|
|
15
|
-
:return:
|
|
16
|
-
"""
|
|
17
|
-
NumberTypes = (int, float)
|
|
18
|
-
if isinstance(row[prod_column], NumberTypes):
|
|
19
|
-
date_ = pd.to_datetime(row[date_column])
|
|
20
|
-
days = calendar.monthrange(date_.year, date_.month)[1]
|
|
21
|
-
|
|
22
|
-
return row[prod_column] / days
|
|
23
|
-
return 0
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def add_daily(df: pd.DataFrame, date_column='date', monthly_columns=['gas_monthly', 'oil_monthly', 'water_monthly'],
|
|
27
|
-
daily_columns=['gas_daily', 'oil_daily', 'water_daily']):
|
|
28
|
-
"""
|
|
29
|
-
Used to add daily production columns to a Pandas dataframe containing monthly production columns.
|
|
30
|
-
:param df: A Pandas dataframe containing monthly columns of production and a date column
|
|
31
|
-
:param date_column: string containing the name of the column denoting the date
|
|
32
|
-
:param monthly_columns: a list of strings contaning the monthly production columns
|
|
33
|
-
:param daily_columns: a list of strings containing the desired names of the outputed daily columns
|
|
34
|
-
which correspond positionaly to the monthly_columns
|
|
35
|
-
:return: a Pandas dataframe
|
|
36
|
-
"""
|
|
37
|
-
for index, column in enumerate(monthly_columns):
|
|
38
|
-
if column in df.columns:
|
|
39
|
-
df[daily_columns[index]] = df.apply(monthly_to_daily, axis=1, args=(column, date_column,))
|
|
40
|
-
else:
|
|
41
|
-
print(f'Skipping {column} which does not exists')
|
|
42
|
-
|
|
43
|
-
return df
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def get_fips():
|
|
47
|
-
"""
|
|
48
|
-
Returns lookup table for FIPS codes
|
|
49
|
-
:return: Pandas dataframe
|
|
50
|
-
"""
|
|
51
|
-
from synmax.config import DATA_FOLDER
|
|
52
|
-
return pd.read_csv(os.path.join(DATA_FOLDER, 'fips_lookup.csv'))
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def make_fips():
|
|
56
|
-
fips_df = pd.read_csv(
|
|
57
|
-
'https://raw.githubusercontent.com/kjhealy/fips-codes/master/state_and_county_fips_master.csv')
|
|
58
|
-
fips_df['name'] = fips_df.apply(lambda x: x['name'].replace(' County', '').replace(' Parish', ''), axis=1)
|
|
59
|
-
fips_df.columns = ['fips', 'county', 'state_ab']
|
|
60
|
-
fips_df['county'] = fips_df.county.str.upper()
|
|
61
|
-
|
|
62
|
-
fips_df.to_csv('fips_lookup.csv', index=False)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if __name__ == '__main__':
|
|
66
|
-
access_token = ''
|
|
67
|
-
client = HyperionApiClient(access_token=access_token, local_server=True)
|
|
68
|
-
print(client.__dir__())
|
|
1
|
+
import calendar
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from .hyperion_client import HyperionApiClient, ApiPayload
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def monthly_to_daily(row, prod_column='gas_monthly', date_column='date'):
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
:param row:
|
|
13
|
+
:param prod_column:
|
|
14
|
+
:param date_column:
|
|
15
|
+
:return:
|
|
16
|
+
"""
|
|
17
|
+
NumberTypes = (int, float)
|
|
18
|
+
if isinstance(row[prod_column], NumberTypes):
|
|
19
|
+
date_ = pd.to_datetime(row[date_column])
|
|
20
|
+
days = calendar.monthrange(date_.year, date_.month)[1]
|
|
21
|
+
|
|
22
|
+
return row[prod_column] / days
|
|
23
|
+
return 0
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def add_daily(df: pd.DataFrame, date_column='date', monthly_columns=['gas_monthly', 'oil_monthly', 'water_monthly'],
|
|
27
|
+
daily_columns=['gas_daily', 'oil_daily', 'water_daily']):
|
|
28
|
+
"""
|
|
29
|
+
Used to add daily production columns to a Pandas dataframe containing monthly production columns.
|
|
30
|
+
:param df: A Pandas dataframe containing monthly columns of production and a date column
|
|
31
|
+
:param date_column: string containing the name of the column denoting the date
|
|
32
|
+
:param monthly_columns: a list of strings contaning the monthly production columns
|
|
33
|
+
:param daily_columns: a list of strings containing the desired names of the outputed daily columns
|
|
34
|
+
which correspond positionaly to the monthly_columns
|
|
35
|
+
:return: a Pandas dataframe
|
|
36
|
+
"""
|
|
37
|
+
for index, column in enumerate(monthly_columns):
|
|
38
|
+
if column in df.columns:
|
|
39
|
+
df[daily_columns[index]] = df.apply(monthly_to_daily, axis=1, args=(column, date_column,))
|
|
40
|
+
else:
|
|
41
|
+
print(f'Skipping {column} which does not exists')
|
|
42
|
+
|
|
43
|
+
return df
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def get_fips():
|
|
47
|
+
"""
|
|
48
|
+
Returns lookup table for FIPS codes
|
|
49
|
+
:return: Pandas dataframe
|
|
50
|
+
"""
|
|
51
|
+
from synmax.config import DATA_FOLDER
|
|
52
|
+
return pd.read_csv(os.path.join(DATA_FOLDER, 'fips_lookup.csv'))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def make_fips():
|
|
56
|
+
fips_df = pd.read_csv(
|
|
57
|
+
'https://raw.githubusercontent.com/kjhealy/fips-codes/master/state_and_county_fips_master.csv')
|
|
58
|
+
fips_df['name'] = fips_df.apply(lambda x: x['name'].replace(' County', '').replace(' Parish', ''), axis=1)
|
|
59
|
+
fips_df.columns = ['fips', 'county', 'state_ab']
|
|
60
|
+
fips_df['county'] = fips_df.county.str.upper()
|
|
61
|
+
|
|
62
|
+
fips_df.to_csv('fips_lookup.csv', index=False)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
if __name__ == '__main__':
|
|
66
|
+
access_token = ''
|
|
67
|
+
client = HyperionApiClient(access_token=access_token, local_server=True)
|
|
68
|
+
print(client.__dir__())
|
|
@@ -1,172 +1,182 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import logging
|
|
3
|
-
import os
|
|
4
|
-
|
|
5
|
-
import pandas
|
|
6
|
-
|
|
7
|
-
from synmax.common import ApiClient, ApiClientAsync, PayloadModelBase
|
|
8
|
-
|
|
9
|
-
LOGGER = logging.getLogger(__name__)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ApiPayload(PayloadModelBase):
|
|
13
|
-
def payload(self, pagination_start=None) -> str:
|
|
14
|
-
|
|
15
|
-
if self.start_date is None:
|
|
16
|
-
payload_start_date = None
|
|
17
|
-
else:
|
|
18
|
-
payload_start_date = str(self.start_date)
|
|
19
|
-
if self.end_date is None:
|
|
20
|
-
payload_end_date = None
|
|
21
|
-
else:
|
|
22
|
-
payload_end_date = str(self.end_date)
|
|
23
|
-
if self.forecast_run_date is None:
|
|
24
|
-
payload_forecast_run_date = None
|
|
25
|
-
else:
|
|
26
|
-
payload_forecast_run_date = str(self.forecast_run_date)
|
|
27
|
-
if self.first_production_month is None:
|
|
28
|
-
payload_first_production_month = None
|
|
29
|
-
else:
|
|
30
|
-
payload_first_production_month = str(self.first_production_month)
|
|
31
|
-
if
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if type(self.
|
|
40
|
-
self.
|
|
41
|
-
if type(self.
|
|
42
|
-
self.
|
|
43
|
-
if type(self.
|
|
44
|
-
self.
|
|
45
|
-
if type(self.
|
|
46
|
-
self.
|
|
47
|
-
if type(self.
|
|
48
|
-
self.
|
|
49
|
-
if type(self.
|
|
50
|
-
self.
|
|
51
|
-
if type(self.
|
|
52
|
-
self.
|
|
53
|
-
if type(self.
|
|
54
|
-
self.
|
|
55
|
-
if type(self.
|
|
56
|
-
self.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
def
|
|
130
|
-
return self.
|
|
131
|
-
|
|
132
|
-
def
|
|
133
|
-
return self.
|
|
134
|
-
|
|
135
|
-
def
|
|
136
|
-
return self.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
1
|
+
import json
|
|
2
|
+
import logging
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
import pandas
|
|
6
|
+
|
|
7
|
+
from synmax.common import ApiClient, ApiClientAsync, PayloadModelBase
|
|
8
|
+
|
|
9
|
+
LOGGER = logging.getLogger(__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ApiPayload(PayloadModelBase):
|
|
13
|
+
def payload(self, pagination_start=None) -> str:
|
|
14
|
+
|
|
15
|
+
if self.start_date is None:
|
|
16
|
+
payload_start_date = None
|
|
17
|
+
else:
|
|
18
|
+
payload_start_date = str(self.start_date)
|
|
19
|
+
if self.end_date is None:
|
|
20
|
+
payload_end_date = None
|
|
21
|
+
else:
|
|
22
|
+
payload_end_date = str(self.end_date)
|
|
23
|
+
if self.forecast_run_date is None:
|
|
24
|
+
payload_forecast_run_date = None
|
|
25
|
+
else:
|
|
26
|
+
payload_forecast_run_date = str(self.forecast_run_date)
|
|
27
|
+
if self.first_production_month is None:
|
|
28
|
+
payload_first_production_month = None
|
|
29
|
+
else:
|
|
30
|
+
payload_first_production_month = str(self.first_production_month)
|
|
31
|
+
if self.first_production_month_start is None:
|
|
32
|
+
payload_first_production_month_start = None
|
|
33
|
+
else:
|
|
34
|
+
payload_first_production_month_start = str(self.first_production_month_start)
|
|
35
|
+
if self.first_production_month_end is None:
|
|
36
|
+
payload_first_production_month_end = None
|
|
37
|
+
else:
|
|
38
|
+
payload_first_production_month_end = str(self.first_production_month_end)
|
|
39
|
+
if type(self.production_month) == int:
|
|
40
|
+
self.production_month = [self.production_month]
|
|
41
|
+
if type(self.state_code) == str:
|
|
42
|
+
self.state_code = [self.state_code]
|
|
43
|
+
if type(self.region) == str:
|
|
44
|
+
self.region = [self.region]
|
|
45
|
+
if type(self.sub_region) == str:
|
|
46
|
+
self.sub_region = [self.sub_region]
|
|
47
|
+
if type(self.county) == str:
|
|
48
|
+
self.county = [self.county]
|
|
49
|
+
if type(self.operator) == str:
|
|
50
|
+
self.operator = [self.operator]
|
|
51
|
+
if type(self.api) == int:
|
|
52
|
+
self.api = [self.api]
|
|
53
|
+
if type(self.aggregate_by) == str:
|
|
54
|
+
self.aggregate_by = [self.aggregate_by]
|
|
55
|
+
if type(self.service_company) == str:
|
|
56
|
+
self.service_company = [self.service_company]
|
|
57
|
+
if type(self.rig_class) == str:
|
|
58
|
+
self.rig_class = [self.rig_class]
|
|
59
|
+
if type(self.completion_class) == str:
|
|
60
|
+
self.completion_class = [self.completion_class]
|
|
61
|
+
if type(self.frac_class) == str:
|
|
62
|
+
self.frac_class = [self.frac_class]
|
|
63
|
+
if type(self.category) == str:
|
|
64
|
+
self.category = [self.category]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
#if type(self.nerc_id) == int:
|
|
68
|
+
# self.nerc_id = [self.nerc_id]
|
|
69
|
+
|
|
70
|
+
_payload = {
|
|
71
|
+
"start_date": payload_start_date,
|
|
72
|
+
"end_date": payload_end_date,
|
|
73
|
+
"forecast_run_date": payload_forecast_run_date,
|
|
74
|
+
"first_production_month": payload_first_production_month,
|
|
75
|
+
"first_production_month_start": payload_first_production_month_start,
|
|
76
|
+
"first_production_month_end": payload_first_production_month_end,
|
|
77
|
+
"production_month": self.production_month,
|
|
78
|
+
"state_code": self.state_code,
|
|
79
|
+
"region": self.region,
|
|
80
|
+
"sub_region": self.sub_region,
|
|
81
|
+
"county": self.county,
|
|
82
|
+
"operator": self.operator,
|
|
83
|
+
"api": self.api,
|
|
84
|
+
"aggregate_by": self.aggregate_by,
|
|
85
|
+
"service_company": self.service_company,
|
|
86
|
+
"rig_class": self.rig_class,
|
|
87
|
+
"completion_class": self.completion_class,
|
|
88
|
+
"frac_class": self.frac_class,
|
|
89
|
+
"category": self.category,
|
|
90
|
+
"modeled": str(self.modeled),
|
|
91
|
+
"pagination": {
|
|
92
|
+
"start": pagination_start if pagination_start else self.pagination_start
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if _payload["production_month"] == None:
|
|
97
|
+
_payload.pop("production_month")
|
|
98
|
+
|
|
99
|
+
return json.dumps(_payload)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class HyperionApiClient(object):
|
|
103
|
+
def __init__(self, access_token: str = None, local_server=False, async_client=True):
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
:param access_token:
|
|
107
|
+
:param local_server:
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
if access_token is None:
|
|
111
|
+
access_token = os.getenv('access_token')
|
|
112
|
+
self.access_key = access_token
|
|
113
|
+
|
|
114
|
+
if local_server:
|
|
115
|
+
self._base_uri = 'http://127.0.0.1:8080/'
|
|
116
|
+
else:
|
|
117
|
+
self._base_uri = 'https://hyperion.api.synmax.com/'
|
|
118
|
+
|
|
119
|
+
if async_client:
|
|
120
|
+
LOGGER.info('Initializing async client')
|
|
121
|
+
self.api_client = ApiClientAsync(access_token=access_token)
|
|
122
|
+
else:
|
|
123
|
+
self.api_client = ApiClient(access_token=access_token)
|
|
124
|
+
|
|
125
|
+
self.api_client_sync = ApiClient(access_token=access_token)
|
|
126
|
+
|
|
127
|
+
# GET
|
|
128
|
+
|
|
129
|
+
def fetch_regions(self) -> pandas.DataFrame:
|
|
130
|
+
return self.api_client_sync.get(f"{self._base_uri}/v3/regions", return_json=True)
|
|
131
|
+
|
|
132
|
+
def fetch_operator_classification(self) -> pandas.DataFrame:
|
|
133
|
+
return self.api_client_sync.get(f"{self._base_uri}/v3/operatorclassification", return_json=True)
|
|
134
|
+
|
|
135
|
+
def fetch_pipeline_scrape_status(self) -> pandas.DataFrame:
|
|
136
|
+
return self.api_client_sync.get(f"{self._base_uri}/v3/pipelinescrapestatus", return_json=True)
|
|
137
|
+
|
|
138
|
+
# POST
|
|
139
|
+
def daily_fracked_feet(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
140
|
+
return self.api_client.post(f"{self._base_uri}/v3/dailyfrackedfeet", payload=payload, return_json=True)
|
|
141
|
+
|
|
142
|
+
def long_term_forecast(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
143
|
+
return self.api_client.post(f"{self._base_uri}/v3/longtermforecast", payload=payload, return_json=True)
|
|
144
|
+
|
|
145
|
+
def well_completion(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
146
|
+
return self.api_client.post(f"{self._base_uri}/v3/completions", payload=payload, return_json=True)
|
|
147
|
+
|
|
148
|
+
def ducs_by_operator(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
149
|
+
return self.api_client.post(f"{self._base_uri}/v3/ducsbyoperator", payload=payload, return_json=True)
|
|
150
|
+
|
|
151
|
+
def frac_crews(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
152
|
+
return self.api_client.post(f"{self._base_uri}/v3/fraccrews", payload=payload, return_json=True)
|
|
153
|
+
|
|
154
|
+
def production_by_well(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
155
|
+
return self.api_client.post(f"{self._base_uri}/v3/productionbywell", payload=payload, return_json=True)
|
|
156
|
+
|
|
157
|
+
def rigs(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
158
|
+
return self.api_client.post(f"{self._base_uri}/v3/rigs", payload=payload, return_json=True)
|
|
159
|
+
|
|
160
|
+
def wells(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
161
|
+
return self.api_client.post(f"{self._base_uri}/v3/wells", payload=payload, return_json=True)
|
|
162
|
+
|
|
163
|
+
def short_term_forecast(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
164
|
+
return self.api_client.post(f"{self._base_uri}/v3/shorttermforecast", payload=payload, return_json=True)
|
|
165
|
+
|
|
166
|
+
def short_term_forecast_history(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
167
|
+
return self.api_client.post(f"{self._base_uri}/v3/shorttermforecasthistory", payload=payload, return_json=True)
|
|
168
|
+
|
|
169
|
+
def short_term_forecast_declines(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
170
|
+
return self.api_client.post(f"{self._base_uri}/v3/shorttermforecastdeclines", payload=payload, return_json=True)
|
|
171
|
+
|
|
172
|
+
def daily_production(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
173
|
+
return self.api_client.post(f"{self._base_uri}/v3/dailyproduction", payload=payload, return_json=True)
|
|
174
|
+
|
|
175
|
+
def pipeline_scrapes(self, payload: ApiPayload = ApiPayload()) -> pandas.DataFrame:
|
|
176
|
+
return self.api_client.post(f"{self._base_uri}/v3/pipelinescrapes", payload=payload, return_json=True)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
if __name__ == '__main__':
|
|
180
|
+
access_token = ''
|
|
181
|
+
client = HyperionApiClient(access_token=access_token, local_server=True)
|
|
172
182
|
print(client.__dir__())
|
{synmax_api_python_client-0.0.44.dist-info → synmax_api_python_client-0.0.45.dist-info}/METADATA
RENAMED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: synmax-api-python-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.45
|
|
4
4
|
Summary: Synmax API client
|
|
5
5
|
Home-page: https://github.com/SynMaxDev/synmax-api-python-client.git
|
|
6
6
|
Author: Eric Anderson and Deepa Aswathaiah
|
|
7
7
|
Author-email:
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Platform: UNKNOWN
|
|
10
8
|
Requires-Python: >=3.7
|
|
11
9
|
Description-Content-Type: text/markdown
|
|
12
|
-
Requires-Dist: wheel
|
|
13
|
-
Requires-Dist: requests
|
|
14
|
-
Requires-Dist: urllib3
|
|
15
|
-
Requires-Dist: pandas
|
|
16
|
-
Requires-Dist: tqdm
|
|
17
|
-
Requires-Dist: aiohttp
|
|
18
|
-
Requires-Dist: aioretry
|
|
19
|
-
Requires-Dist: nest-asyncio
|
|
20
|
-
Requires-Dist: pydantic
|
|
10
|
+
Requires-Dist: wheel >=0.40.0
|
|
11
|
+
Requires-Dist: requests >=2.31.0
|
|
12
|
+
Requires-Dist: urllib3 ==1.26.5
|
|
13
|
+
Requires-Dist: pandas >=0.23.4
|
|
14
|
+
Requires-Dist: tqdm >=4.28.1
|
|
15
|
+
Requires-Dist: aiohttp >=3.8.4
|
|
16
|
+
Requires-Dist: aioretry >=5.0.2
|
|
17
|
+
Requires-Dist: nest-asyncio >=1.5.6
|
|
18
|
+
Requires-Dist: pydantic >=1.10.9
|
|
21
19
|
|
|
22
20
|
# Synmax API Client
|
|
23
21
|
|
|
@@ -139,4 +137,3 @@ python setup.py clean --all
|
|
|
139
137
|
|
|
140
138
|
|
|
141
139
|
```
|
|
142
|
-
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
DATA/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
DATA/fips_lookup.csv,sha256=DMsoKjP9uNAiRamYutSGjicPo7GQaYo1Th-5pnQxYGc,54575
|
|
3
|
+
synmax/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
synmax/common/__init__.py,sha256=2bu-RmHmrZZhI-SixGxWPVqoYFSdNKyIDF7_6aexUtQ,104
|
|
5
|
+
synmax/common/api_client.py,sha256=-pgQOteCBJmDvU7G846Ik_xpkhVQIgpgCsJCPZhgzTg,11756
|
|
6
|
+
synmax/common/model.py,sha256=V2oczvaXjAh4gdGdnPegxbROOKpDFvyTT6ZChP0JYD0,1396
|
|
7
|
+
synmax/config/__init__.py,sha256=zpLY4Fch5KPzABMzxT8T62JWxkRj0INKPklhgEYUSMY,138
|
|
8
|
+
synmax/hyperion/__init__.py,sha256=cKTPE1gi_Yux76X8i7jvbj8KgHtRGa3kmE0nFJh-0PQ,2366
|
|
9
|
+
synmax/hyperion/hyperion_client.py,sha256=0IVQtuynrSE4hFZSDGitoGzQklPOFD05wtaMYh6aJuI,7942
|
|
10
|
+
synmax/theia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
+
test/hyperion_test.py,sha256=o1Cz1X_Yh5IQOMmtWWYWRPbeM6KDg8Ju86dVEQxmNXg,5742
|
|
13
|
+
test/ip_rate_example.py,sha256=yGLGxyWlBLt5a_ojSMgFsvxwLJmHtR07A0GfF2H-ilo,1704
|
|
14
|
+
synmax_api_python_client-0.0.45.dist-info/METADATA,sha256=2cU87_VT4z7l5JDBI562huGwfPj47bK5EAd_AxBZUAQ,3678
|
|
15
|
+
synmax_api_python_client-0.0.45.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
16
|
+
synmax_api_python_client-0.0.45.dist-info/top_level.txt,sha256=SAjmDfHlJzUmjoGCT1SnS4qGSLN_ZF-p58UN1yW5kB0,17
|
|
17
|
+
synmax_api_python_client-0.0.45.dist-info/RECORD,,
|