Fetch Linky data from myelectricaldata.fr
Project description
myelectricaldatapy
Fetch date Enedis Linky from myelectricaldata.fr (enedisgateway.tech)
Install
Use the PIP package manager
$ pip install myelectricaldatapy
Or manually download and install the last version from github
$ git clone https://github.com/cyr-ius/myelectricaldatapy.git
$ python setup.py install
Attributes
- tempo_day : RED/WHITE/BLUE
- ecowatt : Information Dictionary
- power_Data: Data
Methods
- async_get_max_power (start: datetime, end: datetime) Return: max power
- async_get_details_production (start: datetime, end: datetime) Return: details production (max 7days)
- async_get_details_consumption (start: datetime, end: datetime) Return: details consumption (max 7days)
- async_get_daily_production (day: datetime, end: datetime) Return: production (max 1095 days)
- async_get_daily_consumption (start: datetime, end: datetime) Return: consumption (max 1095 days)
- async_get_identity Return: Data identity
- async_check_offpeak (start: datetime) : check if datetime in range offpeak
- async_has_offpeak Return boolean if offpeak detected
- async_get_ecowatt Return: ecowatt information
- async_get_tempoday Return: Tempo day (RED/WHITE/BLUE)
- async_get_address Return address
- async_get_contract Return contact
- async_valid_access Return information access from mylelectricaldata
- async_load (start: datetime, end: datetime) Return None - Load Data in power_Data attribute
- async_refresh Return None - Refresh power_Data , tempo_day and ecowatt attributes.
Get started
# Import the myelectricaldatapy package.
from myelectricaldatapy import EnedisByPDL,EnedisAnalytics
TOKEN="012345"
PDL="012345012345"
async def main():
api = EnedisByPDL(token=TOKEN, pdl=PDL)
print(await api.async_get_contract())
print(await api.async_get_address())
start = datetime.now() - timedelta(days=7)
end = datetime.now()
Data = await api.async_get_details_consumption(start,end)
print(Data)
analytics = EnedisAnalytics(Data)
offpeak_intervals = [(dt.strptime("08H00", "%HH%M"), dt.strptime("12H00", "%HH%M"))]
# it is possible to load detailed production and consumption data within the object (in the power_Data attribute)
await api.async_load()
print(api.power_Data)
# and refresh Data load.
await api.async_refresh()
# Analytics data convert
resultat = analytics.get_data_analytics(
convertKwh=True,
convertUTC=True,
intervals=offpeak_intervals,
groupby="date",
summary=True,
)
offpeak = analytics.set_price(resultat[0], 0.1641, True)
normal = analytics.set_price(resultat[1], 0.18, True)
print(offpeak)
print(normal)
await api.async_close()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Have a look at the example.py for a more complete overview.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file myelectricaldatapy-2.2.5.tar.gz.
File metadata
- Download URL: myelectricaldatapy-2.2.5.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5200f6660e0ea1b2f3ff7989db6a37df7d6be52f7b96cf385d8e3ae1e357c3d7
|
|
| MD5 |
84e7031dd09917d7e82731af1adc27d0
|
|
| BLAKE2b-256 |
d33e8a85ab8242a1b5ef83b94fb6f65b74e0fc151ad74a19f3fc1310e22c583a
|
Provenance
The following attestation bundles were made for myelectricaldatapy-2.2.5.tar.gz:
Publisher:
release.yml on cyr-ius/myelectricaldatapy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myelectricaldatapy-2.2.5.tar.gz -
Subject digest:
5200f6660e0ea1b2f3ff7989db6a37df7d6be52f7b96cf385d8e3ae1e357c3d7 - Sigstore transparency entry: 210387030
- Sigstore integration time:
-
Permalink:
cyr-ius/myelectricaldatapy@5d901406b1133a948518099dee077b4c71606df3 -
Branch / Tag:
refs/tags/2.2.5 - Owner: https://github.com/cyr-ius
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5d901406b1133a948518099dee077b4c71606df3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file myelectricaldatapy-2.2.5-py3-none-any.whl.
File metadata
- Download URL: myelectricaldatapy-2.2.5-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8b0cc666e89209f5bf3b4a83247e19a29610e8686027869cc051578e173deb2
|
|
| MD5 |
69d6f3733f9281364add1f194d8b9696
|
|
| BLAKE2b-256 |
0e0acf0eee80003c6c3eff3df27d0dc9fd4839384c171e7b6b6459219b7ab488
|
Provenance
The following attestation bundles were made for myelectricaldatapy-2.2.5-py3-none-any.whl:
Publisher:
release.yml on cyr-ius/myelectricaldatapy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
myelectricaldatapy-2.2.5-py3-none-any.whl -
Subject digest:
a8b0cc666e89209f5bf3b4a83247e19a29610e8686027869cc051578e173deb2 - Sigstore transparency entry: 210387046
- Sigstore integration time:
-
Permalink:
cyr-ius/myelectricaldatapy@5d901406b1133a948518099dee077b4c71606df3 -
Branch / Tag:
refs/tags/2.2.5 - Owner: https://github.com/cyr-ius
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5d901406b1133a948518099dee077b4c71606df3 -
Trigger Event:
push
-
Statement type: