Skip to main content

PyPI Python Version License

A fully async and easy to use API client for the Ecole Directe API. This package is mainly used by Home Assistant, to offer the Ecole Directe integration. If you want to use this package in your own project, you can look at the Home Assistant Code for more examples.

Features

  • TODO

Installation

$ pip install ecoledirecte

Getting started

import asyncio
import json
import logging
from pathlib import Path
from ecoledirecte_api.client import EDClient
from ecoledirecte_api.exceptions import BaseEcoleDirecteException

logger = logging.getLogger(__name__)

async def save_question(qcm_json):
    """Save question to file."""
    with Path("qcm.json").open(
        "w",
        encoding="utf-8",
    ) as fp:
        json.dump(qcm_json, fp, indent=4, ensure_ascii=False)
    logger.info("Saved question to file", qcm_json)


async def main():
    logging.basicConfig(filename="myapp.log", level=logging.DEBUG)
    logger.info("Started")
    try:
        qcm_json = {}
        with Path("qcm.json").open(
            "r",
            encoding="utf-8",
        ) as fp:
            qcm_json = json.load(fp)

            async with EDClient(
                "user", "password", qcm_json
            ) as client:
                client.on_new_question(save_question)
                l = await client.login()
                logger.info(f"l= {l}")
                logger.info(f"Logged in as {client.username}")
                logger.info("Finished")
                await client.close()
    except BaseEcoleDirecteException as e:
        logger.exception(e.message)
        return
    except Exception as e:
        logger.exception(e)
        return

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

Download files

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

Source Distribution

ecoledirecte-0.2.10.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ecoledirecte-0.2.10-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file ecoledirecte-0.2.10.tar.gz.

File metadata

  • Download URL: ecoledirecte-0.2.10.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecoledirecte-0.2.10.tar.gz
Algorithm Hash digest
SHA256 7787adcbe4f4bafeb192e2f24fd2aa227077853e95f2186ac30e4ec79f965d9c
MD5 7cf9b4af6ce765dcefdfbd9807935d9e
BLAKE2b-256 59f27d453d68f59d895dbd73895396b8761bdc6f81bff50917c0b83425f88443

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecoledirecte-0.2.10.tar.gz:

Publisher: release.yml on hacf-fr/ecoledirecte_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ecoledirecte-0.2.10-py3-none-any.whl.

File metadata

  • Download URL: ecoledirecte-0.2.10-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ecoledirecte-0.2.10-py3-none-any.whl
Algorithm Hash digest
SHA256 26fb0cd8405835d31222fb4087dba3cf3773ee5c7f0a8418e6989f36307b6624
MD5 d0f01a17d8271f720c2bdb465feeafdc
BLAKE2b-256 739972f6d9ecbf83a60e95dd3907b4662cf149225aa5e3046f25cf54783f8b12

See more details on using hashes here.

Provenance

The following attestation bundles were made for ecoledirecte-0.2.10-py3-none-any.whl:

Publisher: release.yml on hacf-fr/ecoledirecte_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.10 This release

2 files

0.2.9

2 files

0.2.8

2 files

0.2.6

2 files

0.2.5

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

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