Skip to main content

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.

Metadata

Release files for linkpy 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for linkpy 1.0
File Size Uploaded Provenance Actions
linkpy-1.0.tar.gz 4.1 kB Without provenance Details for linkpy-1.0.tar.gz

Release files / linkpy-1.0.tar.gz

Download URL linkpy-1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7eec7e1ac692ddc2de017064175aa361691b688153bd91288cb8c0a28d45bd8
BLAKE2b-256 checksum
How to use checksums
a6e0e571749f3d848245b6fd17ed6a4e597dd655efeb75f71522556875475cb2
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for linkpy 1.0

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.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page