gridstatusio 0.1.0__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.
- gridstatusio-0.1.0/LICENSE +11 -0
- gridstatusio-0.1.0/PKG-INFO +91 -0
- gridstatusio-0.1.0/README.md +57 -0
- gridstatusio-0.1.0/gridstatusio/__init__.py +3 -0
- gridstatusio-0.1.0/gridstatusio/api.py +116 -0
- gridstatusio-0.1.0/gridstatusio/tests/__init__.py +0 -0
- gridstatusio-0.1.0/gridstatusio/tests/test_api.py +63 -0
- gridstatusio-0.1.0/gridstatusio/version.py +1 -0
- gridstatusio-0.1.0/gridstatusio.egg-info/PKG-INFO +91 -0
- gridstatusio-0.1.0/gridstatusio.egg-info/SOURCES.txt +13 -0
- gridstatusio-0.1.0/gridstatusio.egg-info/dependency_links.txt +1 -0
- gridstatusio-0.1.0/gridstatusio.egg-info/requires.txt +13 -0
- gridstatusio-0.1.0/gridstatusio.egg-info/top_level.txt +2 -0
- gridstatusio-0.1.0/pyproject.toml +107 -0
- gridstatusio-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Copyright 2022 James Max Kanter
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
|
+
|
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
|
+
|
|
7
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
+
|
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: gridstatusio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python Client for GridStatus.io API
|
|
5
|
+
Author-email: Max Kanter <kmax12@gmail.com>
|
|
6
|
+
Maintainer-email: Max Kanter <kmax12@gmail.com>
|
|
7
|
+
License: Copyright 2022 James Max Kanter
|
|
8
|
+
|
|
9
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
10
|
+
|
|
11
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
18
|
+
|
|
19
|
+
Project-URL: Source Code, https://github.com/kmax12/gridstatusio/
|
|
20
|
+
Project-URL: Issue Tracker, https://github.com/kmax12/gridstatusio/issues
|
|
21
|
+
Keywords: energy,independent system operator
|
|
22
|
+
Classifier: Programming Language :: Python
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
29
|
+
Requires-Python: <4,>=3.7
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
Provides-Extra: test
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
|
|
35
|
+
# GridStatus.io Hosted API
|
|
36
|
+
|
|
37
|
+
Python client for accessing the [GridStatusIO API](https://www.gridstatus.io/api).
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
Install the library using pip:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install gridstatusio
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
### Set API Key
|
|
51
|
+
To use the library, first set your API key:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import gridstatusio as gs
|
|
55
|
+
|
|
56
|
+
gs.api_key = '<YOUR-API-KEY>'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
if you don't have an API, request one [here](https://www.gridstatus.io/api).
|
|
60
|
+
|
|
61
|
+
### List available datasets
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
gs.list_datasets()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Get specific date
|
|
68
|
+
|
|
69
|
+
Request a dataset at a specific date
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
gs.get_dataset(
|
|
73
|
+
dataset="isone/fuel_mix_clean",
|
|
74
|
+
date="2023-01-01",
|
|
75
|
+
)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Get data range
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
df = gs.get_dataset(
|
|
82
|
+
dataset="isone/fuel_mix_clean",
|
|
83
|
+
start="2023-01-01",
|
|
84
|
+
end="2023-01-05",
|
|
85
|
+
verbose=True,
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Get Help
|
|
90
|
+
|
|
91
|
+
We'd love to answer any usage or data access questions! Please let us know by emailing us at contact@gridstatus.io
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# GridStatus.io Hosted API
|
|
2
|
+
|
|
3
|
+
Python client for accessing the [GridStatusIO API](https://www.gridstatus.io/api).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the library using pip:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install gridstatusio
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
### Set API Key
|
|
17
|
+
To use the library, first set your API key:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
import gridstatusio as gs
|
|
21
|
+
|
|
22
|
+
gs.api_key = '<YOUR-API-KEY>'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
if you don't have an API, request one [here](https://www.gridstatus.io/api).
|
|
26
|
+
|
|
27
|
+
### List available datasets
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
gs.list_datasets()
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Get specific date
|
|
34
|
+
|
|
35
|
+
Request a dataset at a specific date
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
gs.get_dataset(
|
|
39
|
+
dataset="isone/fuel_mix_clean",
|
|
40
|
+
date="2023-01-01",
|
|
41
|
+
)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Get data range
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
df = gs.get_dataset(
|
|
48
|
+
dataset="isone/fuel_mix_clean",
|
|
49
|
+
start="2023-01-01",
|
|
50
|
+
end="2023-01-05",
|
|
51
|
+
verbose=True,
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Get Help
|
|
56
|
+
|
|
57
|
+
We'd love to answer any usage or data access questions! Please let us know by emailing us at contact@gridstatus.io
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
from io import StringIO
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
import requests
|
|
5
|
+
import tqdm
|
|
6
|
+
|
|
7
|
+
API_BASE = "https://data.gridstatus.io"
|
|
8
|
+
|
|
9
|
+
# decorator that requieres kwargs
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def require_only_kwargs(func):
|
|
13
|
+
def wrapper(*args, **kwargs):
|
|
14
|
+
if len(args) > 0:
|
|
15
|
+
raise TypeError("Please use only keyword arguments.")
|
|
16
|
+
return func(**kwargs)
|
|
17
|
+
|
|
18
|
+
return wrapper
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_api_key():
|
|
22
|
+
import gridstatusio as gs
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
return gs.api_key
|
|
26
|
+
except AttributeError:
|
|
27
|
+
raise AttributeError(
|
|
28
|
+
"API key not set. Please set the api_key attribute.",
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _make_request(url, verbose=False):
|
|
33
|
+
"""Make a request to the GridStatus.io API."""
|
|
34
|
+
if verbose:
|
|
35
|
+
print("Requesting: {}".format(url))
|
|
36
|
+
|
|
37
|
+
headers = {"x-api-key": get_api_key()}
|
|
38
|
+
response = requests.get(url, headers=headers)
|
|
39
|
+
|
|
40
|
+
return response
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@require_only_kwargs
|
|
44
|
+
def _get_single_csv_dataset(dataset: str, date, verbose=False):
|
|
45
|
+
"""Get a single dataset from the GridStatus.io API."""
|
|
46
|
+
if date:
|
|
47
|
+
date_str = date.strftime("%Y-%m-%d")
|
|
48
|
+
url = "{}/{}/archive/{}.csv".format(API_BASE, dataset, date_str)
|
|
49
|
+
else:
|
|
50
|
+
url = "{}/{}/latest.csv".format(API_BASE, dataset)
|
|
51
|
+
|
|
52
|
+
response = _make_request(url, verbose=verbose)
|
|
53
|
+
df = pd.read_csv(StringIO(response.text))
|
|
54
|
+
|
|
55
|
+
if "Time" in df.columns:
|
|
56
|
+
df["Time"] = pd.to_datetime(df["Time"])
|
|
57
|
+
df = df.set_index("Time")
|
|
58
|
+
|
|
59
|
+
return df
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@require_only_kwargs
|
|
63
|
+
def get_dataset(dataset: str, date=None, start=None, end=None, verbose=False):
|
|
64
|
+
"""Get a dataset from the GridStatus.io API.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
dataset (str): The dataset to get. For example, "isone/fuel_mix_clean".
|
|
68
|
+
date (str): The date to get. For example, "2020-01-01".
|
|
69
|
+
start (str): The start date to get. For example, "2020-01-01".
|
|
70
|
+
end (str): The end date to get. For example, "2020-01-05".
|
|
71
|
+
verbose (bool): Whether to print verbose output.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
pandas.DataFrame: The dataset.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
# require either date or start and end
|
|
78
|
+
if date is None and (start is None or end is None):
|
|
79
|
+
raise TypeError("Please provide either date or start and end.")
|
|
80
|
+
|
|
81
|
+
if date is not None:
|
|
82
|
+
date = pd.to_datetime(date)
|
|
83
|
+
return _get_single_csv_dataset(
|
|
84
|
+
dataset=dataset,
|
|
85
|
+
date=date,
|
|
86
|
+
verbose=verbose,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
dfs = []
|
|
90
|
+
dates = pd.date_range(start, end).tolist()
|
|
91
|
+
for date in tqdm.tqdm(dates):
|
|
92
|
+
df = _get_single_csv_dataset(
|
|
93
|
+
dataset=dataset,
|
|
94
|
+
date=date,
|
|
95
|
+
verbose=verbose,
|
|
96
|
+
)
|
|
97
|
+
dfs.append(df)
|
|
98
|
+
|
|
99
|
+
return pd.concat(dfs)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def list_datasets(verbose=False):
|
|
103
|
+
"""List all datasets available on the GridStatus.io API."""
|
|
104
|
+
dataset_availability = "datasets/historical_data_availability"
|
|
105
|
+
|
|
106
|
+
df = _get_single_csv_dataset(
|
|
107
|
+
dataset=dataset_availability,
|
|
108
|
+
date=None,
|
|
109
|
+
verbose=verbose,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
df["dataset"] = df["iso"] + "/" + df["dataset"]
|
|
113
|
+
df = df[~df["hidden"]]
|
|
114
|
+
df.drop(["iso", "hidden"], axis=1, inplace=True)
|
|
115
|
+
|
|
116
|
+
return df
|
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
import gridstatusio as gs
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _check_dataframe(df):
|
|
8
|
+
assert isinstance(df, pd.DataFrame)
|
|
9
|
+
assert len(df) > 0
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_api_key_must_be_set():
|
|
13
|
+
with pytest.raises(AttributeError):
|
|
14
|
+
gs.get_api_key()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_set_api_works():
|
|
18
|
+
gs.api_key = "test"
|
|
19
|
+
assert gs.get_api_key() == "test"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# todo test require_only_kwargs
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_get_dataset_date():
|
|
26
|
+
gs.api_key = "TQfPZ3zOQ65Z7AbI1jMsMaLJvjcwAuyG85WjKNJI"
|
|
27
|
+
|
|
28
|
+
df = gs.get_dataset(
|
|
29
|
+
dataset="isone/fuel_mix_clean",
|
|
30
|
+
date="2023-01-01",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
_check_dataframe(df)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def test_get_dataset_date_range():
|
|
37
|
+
gs.api_key = "TQfPZ3zOQ65Z7AbI1jMsMaLJvjcwAuyG85WjKNJI"
|
|
38
|
+
|
|
39
|
+
df = gs.get_dataset(
|
|
40
|
+
dataset="isone/fuel_mix_clean",
|
|
41
|
+
start="2023-01-01",
|
|
42
|
+
end="2023-01-05",
|
|
43
|
+
verbose=True,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
_check_dataframe(df)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_list_datasets():
|
|
50
|
+
gs.api_key = "TQfPZ3zOQ65Z7AbI1jMsMaLJvjcwAuyG85WjKNJI"
|
|
51
|
+
|
|
52
|
+
df = gs.list_datasets()
|
|
53
|
+
|
|
54
|
+
cols = [
|
|
55
|
+
"dataset",
|
|
56
|
+
"earliest",
|
|
57
|
+
"latest",
|
|
58
|
+
"num_missing",
|
|
59
|
+
"earliest_no_missing",
|
|
60
|
+
"missing",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
assert df.columns.tolist() == cols
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: gridstatusio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python Client for GridStatus.io API
|
|
5
|
+
Author-email: Max Kanter <kmax12@gmail.com>
|
|
6
|
+
Maintainer-email: Max Kanter <kmax12@gmail.com>
|
|
7
|
+
License: Copyright 2022 James Max Kanter
|
|
8
|
+
|
|
9
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
10
|
+
|
|
11
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
12
|
+
|
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
18
|
+
|
|
19
|
+
Project-URL: Source Code, https://github.com/kmax12/gridstatusio/
|
|
20
|
+
Project-URL: Issue Tracker, https://github.com/kmax12/gridstatusio/issues
|
|
21
|
+
Keywords: energy,independent system operator
|
|
22
|
+
Classifier: Programming Language :: Python
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
29
|
+
Requires-Python: <4,>=3.7
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
Provides-Extra: test
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
|
|
35
|
+
# GridStatus.io Hosted API
|
|
36
|
+
|
|
37
|
+
Python client for accessing the [GridStatusIO API](https://www.gridstatus.io/api).
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
Install the library using pip:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install gridstatusio
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
### Set API Key
|
|
51
|
+
To use the library, first set your API key:
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import gridstatusio as gs
|
|
55
|
+
|
|
56
|
+
gs.api_key = '<YOUR-API-KEY>'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
if you don't have an API, request one [here](https://www.gridstatus.io/api).
|
|
60
|
+
|
|
61
|
+
### List available datasets
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
gs.list_datasets()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Get specific date
|
|
68
|
+
|
|
69
|
+
Request a dataset at a specific date
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
gs.get_dataset(
|
|
73
|
+
dataset="isone/fuel_mix_clean",
|
|
74
|
+
date="2023-01-01",
|
|
75
|
+
)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Get data range
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
df = gs.get_dataset(
|
|
82
|
+
dataset="isone/fuel_mix_clean",
|
|
83
|
+
start="2023-01-01",
|
|
84
|
+
end="2023-01-05",
|
|
85
|
+
verbose=True,
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Get Help
|
|
90
|
+
|
|
91
|
+
We'd love to answer any usage or data access questions! Please let us know by emailing us at contact@gridstatus.io
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
gridstatusio/__init__.py
|
|
5
|
+
gridstatusio/api.py
|
|
6
|
+
gridstatusio/version.py
|
|
7
|
+
gridstatusio.egg-info/PKG-INFO
|
|
8
|
+
gridstatusio.egg-info/SOURCES.txt
|
|
9
|
+
gridstatusio.egg-info/dependency_links.txt
|
|
10
|
+
gridstatusio.egg-info/requires.txt
|
|
11
|
+
gridstatusio.egg-info/top_level.txt
|
|
12
|
+
gridstatusio/tests/__init__.py
|
|
13
|
+
gridstatusio/tests/test_api.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "gridstatusio"
|
|
3
|
+
readme = { file = "README.md", content-type = "text/markdown" }
|
|
4
|
+
description = "Python Client for GridStatus.io API"
|
|
5
|
+
dynamic = ["version"]
|
|
6
|
+
classifiers = [
|
|
7
|
+
"Programming Language :: Python",
|
|
8
|
+
"Programming Language :: Python :: 3",
|
|
9
|
+
"Programming Language :: Python :: 3.7",
|
|
10
|
+
"Programming Language :: Python :: 3.8",
|
|
11
|
+
"Programming Language :: Python :: 3.9",
|
|
12
|
+
"Programming Language :: Python :: 3.10",
|
|
13
|
+
"Programming Language :: Python :: 3.11",
|
|
14
|
+
]
|
|
15
|
+
authors = [
|
|
16
|
+
{name="Max Kanter", email="kmax12@gmail.com"}
|
|
17
|
+
]
|
|
18
|
+
maintainers = [
|
|
19
|
+
{name="Max Kanter", email="kmax12@gmail.com"}
|
|
20
|
+
]
|
|
21
|
+
keywords = ["energy", "independent system operator"]
|
|
22
|
+
license = {file = "LICENSE"}
|
|
23
|
+
requires-python = ">=3.7,<4"
|
|
24
|
+
dependencies = [
|
|
25
|
+
"requests >= 2.28.1",
|
|
26
|
+
"pandas >= 1.3.0",
|
|
27
|
+
"tqdm >= 4.64.1",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
"Source Code"= "https://github.com/kmax12/gridstatusio/"
|
|
32
|
+
"Issue Tracker" = "https://github.com/kmax12/gridstatusio/issues"
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
test = [
|
|
36
|
+
"pytest == 7.1.2",
|
|
37
|
+
"pytest-xdist == 3.0.2",
|
|
38
|
+
"pytest-rerunfailures == 10.3",
|
|
39
|
+
]
|
|
40
|
+
dev = [
|
|
41
|
+
"ruff == 0.0.202",
|
|
42
|
+
"black[jupyter] == 22.12.0",
|
|
43
|
+
"pre-commit == 2.21.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
[tool.setuptools]
|
|
48
|
+
include-package-data = true
|
|
49
|
+
license-files = ["LICENSE"]
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.dynamic]
|
|
52
|
+
version = {attr = "gridstatusio.version.__version__"}
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.packages.find]
|
|
55
|
+
namespaces = true
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.package-data]
|
|
58
|
+
"*" = [
|
|
59
|
+
"LICENSE",
|
|
60
|
+
"README.md",
|
|
61
|
+
]
|
|
62
|
+
[tool.setuptools.exclude-package-data]
|
|
63
|
+
"*" = [
|
|
64
|
+
"* __pycache__",
|
|
65
|
+
"*.py[co]",
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[tool.pytest.ini_options]
|
|
69
|
+
testpaths = [
|
|
70
|
+
"gridstatusio/tests/*"
|
|
71
|
+
]
|
|
72
|
+
markers = [
|
|
73
|
+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[tool.black]
|
|
77
|
+
line-length = 88
|
|
78
|
+
target-version = ['py311']
|
|
79
|
+
|
|
80
|
+
[build-system]
|
|
81
|
+
requires = [
|
|
82
|
+
"setuptools >= 61",
|
|
83
|
+
"wheel",
|
|
84
|
+
]
|
|
85
|
+
build-backend = "setuptools.build_meta"
|
|
86
|
+
|
|
87
|
+
[tool.ruff]
|
|
88
|
+
line-length = 88
|
|
89
|
+
ignore = []
|
|
90
|
+
select = [
|
|
91
|
+
# Pyflakes
|
|
92
|
+
"F",
|
|
93
|
+
# Pycodestyle
|
|
94
|
+
"E",
|
|
95
|
+
"W",
|
|
96
|
+
# flake8-quotes
|
|
97
|
+
"Q",
|
|
98
|
+
# isort
|
|
99
|
+
"I001"
|
|
100
|
+
]
|
|
101
|
+
src = ["gridstatusio"]
|
|
102
|
+
|
|
103
|
+
[tool.ruff.isort]
|
|
104
|
+
known-first-party = ["gridstatusio"]
|
|
105
|
+
|
|
106
|
+
[tool.ruff.per-file-ignores]
|
|
107
|
+
"__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]
|