Skip to main content

This module allows you to retrieve your Linky consumption data from your Enedis account.

Project description

Linkpy - Access your Linky data via Python

What is this?

This Python 3 library allows you to retrieve your Linky power consumption data without any hardware, just a connection to your Enedis account.

This module was previously part of Linkindle and was extracted for better modularity and easier usage.

How to install

pip3 install linkpy

Help, it's not working!

  1. First, check that the Enedis website itself is working.
  2. You might need to accept updated terms and conditions on the website. Linkpy won't work until you do.
  3. Check that you have the latest version of this package. As Enedis changes its website, stuff can and occasionally does break.
  4. If everything else fails, you can report an issue. I'll try to get to it on my free time, but contributions are welcome!

How to use

from linkpy import Linky, LinkyLoginException, LinkyServiceException

try:
    linky = Linky()
    linky.login(USERNAME, PASSWORD)

    today = datetime.date.today()
    res_year = linky.get_data_per_year()

    # 6 months ago - today
    res_month = linky.get_data_per_month(dtostr(
        today - relativedelta(months=6)), dtostr(today))

    # One month ago - yesterday
    res_day = linky.get_data_per_day(
                dtostr(today - relativedelta(days=1, months=1)),
                dtostr(today - relativedelta(days=1)))

    # Yesterday - today
    res_hour = linky.get_data_per_hour(
                dtostr(today - relativedelta(days=1)), 
                dtostr(today))
except LinkyLoginException as exc:
    logging.error(exc)

except LinkyServiceException as exc:
    logging.error(exc)

Example

See my Linkindle project for a real-life example.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkpy-1.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file linkpy-1.0.tar.gz.

File metadata

  • Download URL: linkpy-1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for linkpy-1.0.tar.gz
Algorithm Hash digest
SHA256 a7eec7e1ac692ddc2de017064175aa361691b688153bd91288cb8c0a28d45bd8
MD5 cfcf93bd26a6381f551beecca24cb9c9
BLAKE2b-256 a6e0e571749f3d848245b6fd17ed6a4e597dd655efeb75f71522556875475cb2

See more details on using hashes here.

Supported by

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