tyba-client 0.4.4__tar.gz → 0.4.6__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.6/PKG-INFO +59 -0
- tyba_client-0.4.6/README.md +33 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/pyproject.toml +6 -3
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/client.py +3 -0
- tyba_client-0.4.6/tyba_client/operations.py +60 -0
- tyba_client-0.4.4/PKG-INFO +0 -33
- tyba_client-0.4.4/PYPI_README.md +0 -8
- {tyba_client-0.4.4 → tyba_client-0.4.6}/LICENSE +0 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/__init__.py +0 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/forecast.py +0 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/io.py +0 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/models.py +0 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/solar_resource.py +0 -0
- {tyba_client-0.4.4 → tyba_client-0.4.6}/tyba_client/utils.py +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tyba-client
|
|
3
|
+
Version: 0.4.6
|
|
4
|
+
Summary: A Python API client for the Tyba Public API
|
|
5
|
+
License: MIT
|
|
6
|
+
Author: Tyler Nisonoff
|
|
7
|
+
Author-email: tyler@tybaenergy.com
|
|
8
|
+
Requires-Python: >=3.8,<4.0
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Dist: dataclasses-json (>=0.6.4,<0.7.0)
|
|
17
|
+
Requires-Dist: generation-models (>=0,<1)
|
|
18
|
+
Requires-Dist: marshmallow (>=3.12.1,<4.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"
|
|
21
|
+
Requires-Dist: requests (>=2.25.1,<3.0.0)
|
|
22
|
+
Requires-Dist: structlog (>=24.1.0,<25.0.0)
|
|
23
|
+
Requires-Dist: tyba-financial-model (>=0,<1)
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Tyba API Client
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
For examples see [https://github.com/Tyba-Energy/tyba-client-notebooks](https://github.com/Tyba-Energy/tyba-client-notebooks).
|
|
30
|
+
The script examples in tyba-python-client/examples will be deprecated eventually.
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
### Docs
|
|
34
|
+
We use [`sphinx`](https://github.com/sphinx-doc/sphinx) to manage the documentation for the client.
|
|
35
|
+
Source .rst files can be found in docs/source. We use the
|
|
36
|
+
[`intersphinx`](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#) extension to manage links
|
|
37
|
+
between the client docs and the docs of [`generation_models`](https://github.com/Tyba-Energy/generation/) (the model
|
|
38
|
+
schema for the client). Make sure you understand how these links are defined based on the `intersphinx_mapping`
|
|
39
|
+
variable in docs/source/conf.py to avoid any gotchas.
|
|
40
|
+
|
|
41
|
+
To generate/update documentation for the Tyba client, `cd` into the docs directory and run the makefile that generates
|
|
42
|
+
the HTML documentation
|
|
43
|
+
```bash
|
|
44
|
+
# Assuming you are already in the tyba-python-client directory
|
|
45
|
+
$ cd docs
|
|
46
|
+
$ poetry run make html
|
|
47
|
+
```
|
|
48
|
+
The HTML documentation can be found in docs/build/html.
|
|
49
|
+
|
|
50
|
+
Once it's been reviewed, this HTML documentation needs to be uploaded to s3, so it
|
|
51
|
+
can be served at [https://docs.tybaenergy.com/api/](https://docs.tybaenergy.com/api/). We have a python script to do
|
|
52
|
+
this
|
|
53
|
+
```bash
|
|
54
|
+
poetry run python upload_to_s3.py
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Tyba API Client
|
|
2
|
+
|
|
3
|
+
## Examples
|
|
4
|
+
For examples see [https://github.com/Tyba-Energy/tyba-client-notebooks](https://github.com/Tyba-Energy/tyba-client-notebooks).
|
|
5
|
+
The script examples in tyba-python-client/examples will be deprecated eventually.
|
|
6
|
+
|
|
7
|
+
## Development
|
|
8
|
+
### Docs
|
|
9
|
+
We use [`sphinx`](https://github.com/sphinx-doc/sphinx) to manage the documentation for the client.
|
|
10
|
+
Source .rst files can be found in docs/source. We use the
|
|
11
|
+
[`intersphinx`](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#) extension to manage links
|
|
12
|
+
between the client docs and the docs of [`generation_models`](https://github.com/Tyba-Energy/generation/) (the model
|
|
13
|
+
schema for the client). Make sure you understand how these links are defined based on the `intersphinx_mapping`
|
|
14
|
+
variable in docs/source/conf.py to avoid any gotchas.
|
|
15
|
+
|
|
16
|
+
To generate/update documentation for the Tyba client, `cd` into the docs directory and run the makefile that generates
|
|
17
|
+
the HTML documentation
|
|
18
|
+
```bash
|
|
19
|
+
# Assuming you are already in the tyba-python-client directory
|
|
20
|
+
$ cd docs
|
|
21
|
+
$ poetry run make html
|
|
22
|
+
```
|
|
23
|
+
The HTML documentation can be found in docs/build/html.
|
|
24
|
+
|
|
25
|
+
Once it's been reviewed, this HTML documentation needs to be uploaded to s3, so it
|
|
26
|
+
can be served at [https://docs.tybaenergy.com/api/](https://docs.tybaenergy.com/api/). We have a python script to do
|
|
27
|
+
this
|
|
28
|
+
```bash
|
|
29
|
+
poetry run python upload_to_s3.py
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "tyba-client"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.6"
|
|
4
4
|
description = "A Python API client for the Tyba Public API"
|
|
5
5
|
authors = ["Tyler Nisonoff <tyler@tybaenergy.com>"]
|
|
6
6
|
license = "MIT"
|
|
7
|
-
readme = "
|
|
7
|
+
readme = "README.md"
|
|
8
8
|
include = [
|
|
9
9
|
"LICENSE",
|
|
10
10
|
]
|
|
@@ -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
|
+
)
|
tyba_client-0.4.4/PKG-INFO
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: tyba-client
|
|
3
|
-
Version: 0.4.4
|
|
4
|
-
Summary: A Python API client for the Tyba Public API
|
|
5
|
-
License: MIT
|
|
6
|
-
Author: Tyler Nisonoff
|
|
7
|
-
Author-email: tyler@tybaenergy.com
|
|
8
|
-
Requires-Python: >=3.8,<4.0
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Requires-Dist: dataclasses-json (>=0.6.4,<0.7.0)
|
|
17
|
-
Requires-Dist: generation-models (>=0,<1)
|
|
18
|
-
Requires-Dist: marshmallow (>=3.12.1,<4.0.0)
|
|
19
|
-
Requires-Dist: pandas (>=1.3.2,<2.0.0)
|
|
20
|
-
Requires-Dist: requests (>=2.25.1,<3.0.0)
|
|
21
|
-
Requires-Dist: structlog (>=24.1.0,<25.0.0)
|
|
22
|
-
Requires-Dist: tyba-financial-model (>=0,<1)
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
|
|
25
|
-
<h1 align="center">
|
|
26
|
-
<img src="tyba-logo.svg" width="300">
|
|
27
|
-
</h1><br>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Python client to Tyba's project simulation API.
|
|
31
|
-
|
|
32
|
-
__Documentation:__ https://docs.tybaenergy.com/api
|
|
33
|
-
|
tyba_client-0.4.4/PYPI_README.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|