Skip to main content

A comprehensive Python client for the EcoleDirecte API with MFA support.

Project description

ecoledirecte-py-client

A Python client for the EcoleDirecte API, supporting both Student and Family accounts with Multi-Factor Authentication (MFA) handling.

Features

  • Dual Account Support: Seamlessly handles both Student and Family (Parent) accounts.
  • MFA Support: Integrated handling of CNED/MFA challenges.
  • Interactive & Automated MFA:
    • Prompts for MFA codes interactively if needed.
    • Caches known MFA answers in qcm.json for automated future logins.
  • Secure: Sensitive data is managed via environment variables.

Installation

This project uses uv for dependency management.

uv add ecoledirecte-py-client

Configuration

  1. Environment Variables: Create a .env file (or .env_student / .env_family for specific testing) with your credentials:

    ECOLEDIRECTE_USERNAME=your_username
    ECOLEDIRECTE_PASSWORD=your_password
    # Optional: set to 'true' to skip actual login requests during dev
    ECOLEDIRECTE_DEMO_MODE=false 
    
  2. MFA Configuration: The qcm.json file stores the mapping of MFA questions to answers. It is automatically updated when you solve a new challenge.

    Note: Do not commit qcm.json if it contains personal answers, though the answers are specific to your account challenges.

Usage

from ecoledirecte_py_client import Client
import asyncio

async def main():
    client = Client()
    await client.login("username", "password")
    # ...

Check the examples/ directory for full usage scripts.

uv run --env-file .env examples/demo.py

Project Structure

  • src/ecoledirecte_py_client/: Core library code.
  • examples/: Demo scripts.
  • qcm.json: Local database of MFA Q&A.

License

GPLv3

Project details


Download files

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

Source Distribution

ecoledirecte_py_client-0.1.0.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

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

ecoledirecte_py_client-0.1.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file ecoledirecte_py_client-0.1.0.tar.gz.

File metadata

  • Download URL: ecoledirecte_py_client-0.1.0.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for ecoledirecte_py_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2951eee94a784d4bcf6b868649025b25876d1b009e83ee26329b3fc6b47d0cf5
MD5 f7e8cb93c35bac7b362d844f80b9d77f
BLAKE2b-256 4d78dbc8a5f89c15cb7793a1533d6af3c11e69f0d69b65d05163ecb792d12204

See more details on using hashes here.

File details

Details for the file ecoledirecte_py_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ecoledirecte_py_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa327afe33d99664db2efdbb9dd04f19dc11d42201b3d10bf9aa2849f43063b6
MD5 7b4fff9ff4f885639cad2d84c2a0dc97
BLAKE2b-256 49b56a133c7109e1d4483776fee33bcef6c6d484beaf834bb7dfd00e29cab03f

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