Skip to main content

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

myelectricaldatapy-2.2.2.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

myelectricaldatapy-2.2.2-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file myelectricaldatapy-2.2.2.tar.gz.

File metadata

  • Download URL: myelectricaldatapy-2.2.2.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for myelectricaldatapy-2.2.2.tar.gz
Algorithm Hash digest
SHA256 9a5fa0b2c27a6a51c3463cf17cc077e81fc9f7b409c39e566962d20dee0c0aa6
MD5 9c4cc87fa2ca481ccaa5ada1f6562b90
BLAKE2b-256 d082c1d4147536869940aef980f9feb406e40f240c57321d54da82f659d490d3

See more details on using hashes here.

File details

Details for the file myelectricaldatapy-2.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for myelectricaldatapy-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 76e6d2ed9bc03ed91b04831476f43049855daa06c7167ea7d3f934d78ee90a6e
MD5 4968f4e0f1c1e6492f9b73259a7cb9f2
BLAKE2b-256 6bd954dadaae0fe21d3c0483919cb51909f837eaa848c9f9d287c0551071ec62

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page