python-barry-energy - ⚡
This simple python package is an interface to Barry Energy's API
Please note that this lib is unofficial and NOT related to Barry Energy.
How to use
How to install ?
Simply type pip3 install python-barry-energy
How to run
You can use the Barry Energy API to get the SPOT prices of any given period in the past or near future (if settlements have been made).
For example, in order to get actual France's spot prices, you may do the following:
>>> import datetime
>>> from barry_energy import BarryEnergyAPI, PriceArea
>>>
>>> barry = BarryEnergyAPI('my-super-secret-token')
>>> now = datetime.datetime.now()
>>> barry.spotPrices(PriceArea.FR_EPEX_SPOT_FR, now, now + datetime.timedelta(hours=2)))
{datetime.datetime(2021, 2, 17, 20, 0, tzinfo=datetime.timezone.utc): 0.04837,
datetime.datetime(2021, 2, 17, 21, 0, tzinfo=datetime.timezone.utc): 0.04758,
datetime.datetime(2021, 2, 17, 22, 0, tzinfo=datetime.timezone.utc): 0.04499}
>>>
>>> barry.meteringPointConsumption(barry.yesterday_start, barry.yesterday_end)
{'1234567891023': {datetime.datetime(2021, 3, 1, 23, 0, tzinfo=datetime.timezone.utc): 0.337, ....}}
The dates indicate the start of the delivery period. It is assumed that each delivery period is one hour long. In our case, prices are in €/kWh
The values returned by the API should be the same values than EPEX spot
More information
Price Areas
If your electricity meter is located in France, use PriceArea.FR_EPEX_SPOT_FR
If you're in Danemark, use PriceArea.DK_NORDPOOL_SPOT_DK1 or PriceArea.DK_NORDPOOL_SPOT_DK2 according to wikipedia
How to get a token
You can get a token from the APP in the Modules / Barry API menu.
Doc
class BarryEnergyAPI(builtins.object)
| BarryEnergyAPI(api_token: str)
|
| Methods defined here:
|
| __init__(self, api_token: str)
| Initialize self. See help(type(self)) for accurate signature.
|
| meteringPointConsumption(self, date_start: datetime.datetime, date_end: datetime.datetime, mpid=None)
| Returns the consumption (in kWh per hour) during date_start and date_end. If mpid is None,
| returns the consumption of the MPID/MPAN. Else returns the consumption of the specified mpid
|
| spotPrices(self, market_zone: barry_energy.PriceArea, date_start: datetime.datetime, date_end: datetime.datetime)
| Returns the hourly spot price on market_zone for the
| given dates.
| Warning: dates are assumed UTC
|
| hourlykWhPrice(self, date: datetime, mpid: int)
| Returns the total kWh price (currency/kWh)
| (incl. grid fees, tarrifs, subscription, and spot price) of a metering
| point and a specific hour.
| ----------------------------------------------------------------------
| Readonly properties defined here:
|
| meteringPoints
| Returns the metering points linked to the contract
|
| one_day
| Returns a timedelta of 24 hours
|
| yesterday_end (equivalent to today_start)
| Returns the date of the end of yesterday
|
| yesterday_start
| Returns the date of the start of yesterday
|
| today_start (equivalent to yesterday_end)
| Returns the date of the start of today
|
| now
| Return the curent (utc) time troncated at hour
|
| ----------------------------------------------------------------------
Metadata
Release files for python-barry-energy 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-barry-energy-0.0.5.tar.gz | 4.6 kB | Without provenance | Details for python-barry-energy-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_barry_energy-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for python_barry_energy-0.0.5-py3-none-any.whl |
Total release size: 9.2 kB
Release files / python-barry-energy-0.0.5.tar.gz
| Download URL | python-barry-energy-0.0.5.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cdca8d527e9539a22332604057ece8e0f8bf4a25566dbfd5b45b5110671d0c6
|
|
BLAKE2b-256 checksum How to use checksums |
0b29a2da2c192b9fb3007f083e4a545e2d66e00ab56d3c8afe136e8e021b41fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
|
Release files / python_barry_energy-0.0.5-py3-none-any.whl
| Download URL | python_barry_energy-0.0.5-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
776713e0fbe6d6084b242789ca48242039df3ced0e0987c8dfe0f21885e6d7eb
|
|
BLAKE2b-256 checksum How to use checksums |
1c32b27cd8e5cb1b33e3f3ee21cd5dd9f8225fe88639affaed113115e1a7f5d4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
|
Security for python-barry-energy 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.