Skip to content
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

update README.md #2

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# efaciency

A package to simplify working with EFA blocks and settlement periods in the GB electricity trading system.
![Tests](https://github.com/github/docs/actions/workflows/test.yml/badge.svg)
![PyPi](https://img.shields.io/pypi/v/efaciency)


A package to simplify working with [EFA](https://en.wikipedia.org/wiki/Electricity_Forward_Agreement) blocks and settlement periods in the GB electricity trading system.

## Installation

Expand All @@ -9,7 +13,9 @@ This package can be installed via pip:
$ pip install efaciency
```

## Quick start
## Examples

### Settlement periods

Define a settlement period and get the corresponding half-hour datetime.
```python
Expand All @@ -20,7 +26,22 @@ Define a settlement period and get the corresponding half-hour datetime.
datetime.datetime(2023, 7, 1, 11, 30, tzinfo=<DstTzInfo 'Europe/London' BST+1:00:00 DST>)
```

Create ranges of half-hour granularity for all SPs in between two dates.
Get the corresponding EFA information and settlement information for a given timestamp.
```python
>>> from datetime import datetime
>>> from efaciency import SettlementPeriod
>>> sp = SettlementPeriod(ts=datetime(2023, 7, 1, 11, 30))
>>> sp
{
'settlement_date': datetime.date(2023, 7, 1)
'settlement_period': 24,
'ts': datetime.datetime(2023, 7, 1, 11, 30, tzinfo=<DstTzInfo 'Europe/London' BST+1:00:00 DST>),
'efa_date': datetime.date(2023, 7, 1),
'efa_block': 4,
}
```

Create half-hourly range for all SPs in between two dates.
```python
>>> from datetime import date
>>> from efaciency import settlement_period_range
Expand All @@ -38,6 +59,8 @@ Create ranges of half-hour granularity for all SPs in between two dates.
}
```

### EFA blocks

Define EFA blocks and get the corresponding start and end datetimes.
```python
>>> from datetime import date
Expand All @@ -49,6 +72,20 @@ Define EFA blocks and get the corresponding start and end datetimes.
'2023-07-01 11:00'
```

Create a range of all EFA blocks between two dates.
```python
>>> from datetime import date
>>> from efaciency import efa_block_range
>>> efa_range = efa_block_range(date(2023, 7, 1), date(2023, 7, 2))
>>> efa_range[0]
{
'efa_date': datetime.date(2023, 7, 1),
'efa_block': 1,
'start_ts': datetime.datetime(2023, 6, 30, 23, 0, tzinfo=<DstTzInfo 'Europe/London' BST+1:00:00 DST>),
'end_ts': datetime.datetime(2023, 7, 1, 3, 0, tzinfo=<DstTzInfo 'Europe/London' BST+1:00:00 DST>),
}
```

## Contribution

Please make a pull request or log an issue on GitHub.
Expand Down