tyba-client 0.4.5__tar.gz → 0.4.7__tar.gz
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.
Potentially problematic release.
This version of tyba-client might be problematic. Click here for more details.
- {tyba_client-0.4.5 → tyba_client-0.4.7}/PKG-INFO +3 -2
- {tyba_client-0.4.5 → tyba_client-0.4.7}/pyproject.toml +5 -2
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/client.py +3 -0
- tyba_client-0.4.7/tyba_client/operations.py +60 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/LICENSE +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/PYPI_README.md +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/__init__.py +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/forecast.py +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/io.py +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/models.py +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/solar_resource.py +0 -0
- {tyba_client-0.4.5 → tyba_client-0.4.7}/tyba_client/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tyba-client
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.7
|
|
4
4
|
Summary: A Python API client for the Tyba Public API
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Tyler Nisonoff
|
|
@@ -16,7 +16,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Requires-Dist: dataclasses-json (>=0.6.4,<0.7.0)
|
|
17
17
|
Requires-Dist: generation-models (>=0,<1)
|
|
18
18
|
Requires-Dist: marshmallow (>=3.12.1,<4.0.0)
|
|
19
|
-
Requires-Dist: pandas (>=1.3.2,<2.0.0)
|
|
19
|
+
Requires-Dist: pandas (>=1.3.2,<2.0.0) ; python_version < "3.9"
|
|
20
|
+
Requires-Dist: pandas (>=2.0.0,<3.0.0) ; python_version >= "3.9"
|
|
20
21
|
Requires-Dist: requests (>=2.25.1,<3.0.0)
|
|
21
22
|
Requires-Dist: structlog (>=24.1.0,<25.0.0)
|
|
22
23
|
Requires-Dist: tyba-financial-model (>=0,<1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "tyba-client"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.7"
|
|
4
4
|
description = "A Python API client for the Tyba Public API"
|
|
5
5
|
authors = ["Tyler Nisonoff <tyler@tybaenergy.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -14,7 +14,10 @@ python = "^3.8"
|
|
|
14
14
|
requests = "^2.25.1"
|
|
15
15
|
dataclasses-json = "^0.6.4"
|
|
16
16
|
marshmallow = "^3.12.1"
|
|
17
|
-
pandas =
|
|
17
|
+
pandas = [
|
|
18
|
+
{ version = "^1.3.2", python = "<3.9" },
|
|
19
|
+
{ version = "^2.0.0", python = ">=3.9" }
|
|
20
|
+
]
|
|
18
21
|
tyba-financial-model = "^0"
|
|
19
22
|
structlog = "^24.1.0"
|
|
20
23
|
generation-models = "^0"
|
|
@@ -11,6 +11,8 @@ import time
|
|
|
11
11
|
from structlog import get_logger
|
|
12
12
|
from typing import Callable
|
|
13
13
|
|
|
14
|
+
from tyba_client.operations import Operations
|
|
15
|
+
|
|
14
16
|
logger = get_logger()
|
|
15
17
|
|
|
16
18
|
|
|
@@ -114,6 +116,7 @@ class Client(object):
|
|
|
114
116
|
self.host = host
|
|
115
117
|
self.services = Services(self)
|
|
116
118
|
self.forecast = Forecast(self)
|
|
119
|
+
self.operations = Operations(self)
|
|
117
120
|
self.request_args = {} if request_args is None else request_args
|
|
118
121
|
|
|
119
122
|
def _auth_header(self):
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from datetime import date
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Operations(object):
|
|
5
|
+
def __init__(self, client):
|
|
6
|
+
self.client = client
|
|
7
|
+
|
|
8
|
+
def get(self, route, params=None):
|
|
9
|
+
response = self.client.get(f"operations/{route}", params=params)
|
|
10
|
+
response.raise_for_status()
|
|
11
|
+
return response.text
|
|
12
|
+
|
|
13
|
+
def performance_report(
|
|
14
|
+
self,
|
|
15
|
+
start_date: date,
|
|
16
|
+
end_date: date,
|
|
17
|
+
asset_name: str,
|
|
18
|
+
):
|
|
19
|
+
return self.get(
|
|
20
|
+
"internal_api/performance_report",
|
|
21
|
+
params={
|
|
22
|
+
"start_date": start_date,
|
|
23
|
+
"end_date": end_date,
|
|
24
|
+
"asset_name": asset_name,
|
|
25
|
+
},
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def da_snapshot(
|
|
29
|
+
self,
|
|
30
|
+
start_date: date,
|
|
31
|
+
end_date: date,
|
|
32
|
+
asset_name: str,
|
|
33
|
+
):
|
|
34
|
+
return self.get(
|
|
35
|
+
"internal_api/da_snapshot",
|
|
36
|
+
params={
|
|
37
|
+
"start_date": start_date,
|
|
38
|
+
"end_date": end_date,
|
|
39
|
+
"asset_name": asset_name,
|
|
40
|
+
},
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def telemetry(
|
|
44
|
+
self,
|
|
45
|
+
start_date: date,
|
|
46
|
+
end_date: date,
|
|
47
|
+
asset_name: str,
|
|
48
|
+
interval_mins: int,
|
|
49
|
+
metrics: list[str]
|
|
50
|
+
):
|
|
51
|
+
return self.get(
|
|
52
|
+
"internal_api/telemetry",
|
|
53
|
+
params={
|
|
54
|
+
"start_date": start_date,
|
|
55
|
+
"end_date": end_date,
|
|
56
|
+
"asset_name": asset_name,
|
|
57
|
+
"interval_mins": interval_mins,
|
|
58
|
+
"metrics": metrics,
|
|
59
|
+
},
|
|
60
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|