-
Notifications
You must be signed in to change notification settings - Fork 11
Introduces CLI commands to interact with the trading API: #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
311b2ff to
c8f0693
Compare
| from datetime import datetime, timedelta | ||
| from zoneinfo import ZoneInfo | ||
|
|
||
| import click |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to go in pyproject.toml as well, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
|
||
| from frequenz.client.electricity_trading.cli.day_ahead import list_day_ahead_prices | ||
|
|
||
| TZ = ZoneInfo("Europe/Berlin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should take it from the "TZ" environment variable and use Berlin as the default, in case we want to call the command with UTC, etc., for whatever reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep this since this is the timezone used on EEX and EPEX, which is what is supported for day-ahead prices.
The click library allows for more complex interactions with the CLI tool for upcoming changes that add support for interacting with the actual trading API. In future the listing of day ahead prices from the entsoe API might be moved into a separate CLI tool. Signed-off-by: cwasicki <[email protected]>
Introduces CLI commands to interact with the trading API: - `list_trades` allows listing and streaming public trades for specified delivery periods. If no delivery start is given, starts streaming all new public trades. - `list_orders` allows listing and streaming orders for specified delivery periods and gridpool IDs. If no delivery start is given, starts streaming all new orders for this gridpool ID. Signed-off-by: cwasicki <[email protected]>
Signed-off-by: cwasicki <[email protected]>
cwasicki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
| from datetime import datetime, timedelta | ||
| from zoneinfo import ZoneInfo | ||
|
|
||
| import click |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
|
||
| from frequenz.client.electricity_trading.cli.day_ahead import list_day_ahead_prices | ||
|
|
||
| TZ = ZoneInfo("Europe/Berlin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to keep this since this is the timezone used on EEX and EPEX, which is what is supported for day-ahead prices.
list_tradesallows listing and streaming public trades for specified delivery periods. If no delivery start is given, starts streaming all new public trades.list_ordersallows listing and streaming orders for specified delivery periods and gridpool IDs. If no delivery start is given, starts streaming all new orders for this gridpool ID.This also changes the argument parsing for the day-ahead command to use the click library to support more complex interactions. In future the listing of day ahead prices from the entsoe API might be moved into a separate CLI tool.