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.jsonfor 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
-
Environment Variables: Create a
.envfile (or.env_student/.env_familyfor 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
-
MFA Configuration: The
qcm.jsonfile stores the mapping of MFA questions to answers. It is automatically updated when you solve a new challenge.Note: Do not commit
qcm.jsonif 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2951eee94a784d4bcf6b868649025b25876d1b009e83ee26329b3fc6b47d0cf5
|
|
| MD5 |
f7e8cb93c35bac7b362d844f80b9d77f
|
|
| BLAKE2b-256 |
4d78dbc8a5f89c15cb7793a1533d6af3c11e69f0d69b65d05163ecb792d12204
|
File details
Details for the file ecoledirecte_py_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ecoledirecte_py_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa327afe33d99664db2efdbb9dd04f19dc11d42201b3d10bf9aa2849f43063b6
|
|
| MD5 |
7b4fff9ff4f885639cad2d84c2a0dc97
|
|
| BLAKE2b-256 |
49b56a133c7109e1d4483776fee33bcef6c6d484beaf834bb7dfd00e29cab03f
|