Skip to content

Commit 9785a54

Browse files
authored
Merge pull request #17 from atsangarides/tec-2297-add-more-eac-resources
TEC-2297: Add more eac resources for buy and sell orders
2 parents 9a83db8 + cbe7795 commit 9785a54

File tree

5 files changed

+52
-2
lines changed

5 files changed

+52
-2
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ r: bytes = client.query(date_col=date_col, start_date=start_date, end_date=end_d
4141
* `historic-frequency-data` [Jan21-Jan22]
4242
* `transmission-entry-capacity-tec-register`
4343
* `dx-eac-eso-results-summary`
44+
* `dx-eac-eso-sell-orders`
45+
* `dx-eac-eso-buy-orders`
46+
4447

4548
### Download of files
4649
* `historic-generation-mix`

pyngeso/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .pyngeso import NgEso
22

3-
__version__ = "0.3.5"
3+
__version__ = "0.3.6"

pyngeso/resources.py

+8
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@
176176
"dx-eac-eso-results-summary": {
177177
"id": "596f29ac-0387-4ba4-a6d3-95c243140707",
178178
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
179+
},
180+
"dx-eac-eso-sell-orders": {
181+
"id": "13b511df-d6ec-4143-afb1-0ecc6fd19810",
182+
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
183+
},
184+
"dx-eac-eso-buy-orders": {
185+
"id": "1cf68f59-8eb8-4f1d-bccf-11b5a47b24e5",
186+
"url": "https://api.nationalgrideso.com/api/3/action/datastore_search",
179187
}
180188
}
181189

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pyngeso"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
description = "Simple python wrapper for the National Grid ESO Portal"
55
authors = [
66
"atsangarides <[email protected]>",

tests/test_pyngeso.py

+39
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,42 @@ def test_dx_eac_eso_results_summary():
359359
assert isinstance(records, list)
360360
assert len(records) > 0
361361
assert len(records) == 36
362+
363+
364+
@pytest.mark.vcr
365+
def test_dx_eac_eso_sell_orders():
366+
date_col = "deliveryStart"
367+
start_date = datetime(2023, 11, 2, 23)
368+
end_date = datetime(2023, 11, 3, 23)
369+
client = NgEso("dx-eac-eso-sell-orders")
370+
r = client.query(
371+
date_col=date_col,
372+
start_date=start_date,
373+
end_date=end_date,
374+
)
375+
376+
assert isinstance(r, bytes)
377+
r_dict = json.loads(r)
378+
records = r_dict.get("result").get("records")
379+
assert isinstance(records, list)
380+
assert len(records) > 0
381+
382+
383+
@pytest.mark.vcr
384+
def test_dx_eac_eso_buy_orders():
385+
date_col = "deliveryStart"
386+
start_date = datetime(2023, 11, 2, 23)
387+
end_date = datetime(2023, 11, 3, 23)
388+
client = NgEso("dx-eac-eso-buy-orders")
389+
r = client.query(
390+
date_col=date_col,
391+
start_date=start_date,
392+
end_date=end_date,
393+
)
394+
395+
assert isinstance(r, bytes)
396+
r_dict = json.loads(r)
397+
records = r_dict.get("result").get("records")
398+
assert isinstance(records, list)
399+
assert len(records) > 0
400+

0 commit comments

Comments
 (0)