Skip to main content

🎓 scodoc-api

Python Version License: MIT

scodoc-api est une bibliothèque Python moderne et typée permettant de s'interfacer avec les serveurs ScoDoc et les passerelles Scodoc-Notes (version 7:2:3 / ScoDoc 9) utilisés dans les IUT et universités françaises (notamment avec authentification CAS).


✨ Fonctionnalités

  • 🔐 Authentification CAS automatique : Supporte les serveurs CAS / Keycloak institutionnels (avec compatibilité automatique des suites TLS et anciens ciphers).
  • 📊 Moyennes & Rangs : Récupération instantanée de la moyenne générale, du rang dans la promotion et des statistiques de promotion (min, max, moyenne de promo).
  • 🎯 Détail par UE & Compétences : Moyennes individuelles pour chaque UE (UE1.1, UE1.2, etc.), ECTS associés et coefficients.
  • 📝 Notes détaillées : Liste des évaluations pour toutes les Ressources et SAÉ (avec note, coef, date, min/max promo).
  • 🕒 Suivi de l'assiduité : Bilan des absences justifiées et injustifiées (en heures et en nombre).
  • ⚙️ Sérialisation JSON : Export complet en dictionnaire (.to_dict()) ou JSON (.to_json()) pour l'intégration dans des bots Discord, dashboards ou apps mobiles.

📦 Installation

Clonez le dépôt ou installez les dépendances :

git clone https://github.com/votre-compte/scodoc-api.git
cd scodoc-api
pip install -r requirements.txt

Ou installation en mode développement :

pip install -e .

⚙️ Configuration (.env)

Créez un fichier .env à la racine du projet à partir de .env.example :

cp .env.example .env

Renseignez vos identifiants :

SCODOC_URL=https://wscodoc.iutbeziers.fr
SCODOC_USERNAME=votre.identifiant
SCODOC_PASSWORD=votre_mot_de_passe

Note : Le fichier .env est déjà listé dans .gitignore pour ne jamais exposer vos mots de passe sur GitHub.


🚀 Utilisation

1. Accès direct et rapide

from dotenv import load_dotenv
from scodoc_api import ScoDoc

load_dotenv()

# Connexion automatique via les variables du .env
client = ScoDoc()

print("Moyenne générale :", client.get_moyenne_generale())
rang, total = client.get_rang()
print(f"Rang dans la promo : {rang} sur {total} étudiants")

2. Récupération de l'objet complet Releve

from scodoc_api import ScoDoc

client = ScoDoc("https://wscodoc.iutbeziers.fr", "mon_identifiant", "mon_mot_de_passe")
releve = client.get_releve()

# Profil étudiant
print(releve.etudiant.prenom, releve.etudiant.nom)
print("Formation :", releve.formation)

# Moyennes par UE
for code, ue in releve.ues.items():
    if ue.moyenne is not None:
        print(f"[{code}] {ue.titre} : {ue.moyenne}/20 (Rang: {ue.rang}/{ue.total_promo})")

# Dernières évaluations reçues
for ev in releve.notes_avec_valeur:
    print(f"[{ev.code_matiere}] {ev.description} : {ev.note}/20 (coef {ev.coefficient}, le {ev.date})")

# Bilan d'assiduité et liste des absences
print(f"Absences : {releve.absences.total_nb} créneau(x) ({releve.absences.total_heures}h)")
for c in releve.absences.creneaux_absents:
    justif = "Justifiée" if c.justifie else "Injustifiée"
    print(f"• {c.date} ({c.heure_debut}-{c.heure_fin}) : [{justif}] {c.matiere} (Prof: {c.enseignant})")

# Export en JSON complet
json_complet = releve.to_json(indent=2)

🧪 Lancer les tests

python test_api.py

⚠️ Avertissement (Disclaimer)

Ce projet est développé à des fins d'interopérabilité et d'automatisation personnelle. Il s'appuie sur les endpoints web de la passerelle Scodoc-Notes. Utilisez-le de manière responsable, dans le respect de la charte informatique de votre établissement (pas de requêtes abusives ou d'inondation de requêtes).


📄 Licence

Ce projet est sous licence MIT.

Metadata

Release files for scodoc-api 1.0.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 scodoc-api 1.0.0
File Size Uploaded
scodoc_api-1.0.0.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scodoc-api 1.0.0
File Interpreter ABI Platform
scodoc_api-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / scodoc_api-1.0.0.tar.gz

Download URL scodoc_api-1.0.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fd662510f8792db1f8e2ff523e0d4fe1d1dc27db467480ed25f46357123d748c
BLAKE2b-256 checksum
How to use checksums
71bc3a8155432aed8acdd4c12b9577a65c40eb3c3fb96703825a67d8a3bbb245
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / scodoc_api-1.0.0-py3-none-any.whl

Download URL scodoc_api-1.0.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00ae58bd4e3a5144c4a8d436aaedcedda7b3928d86cc36ceb8e1012ee78c7fa5
BLAKE2b-256 checksum
How to use checksums
7bd903af19b3999c8e0abe4791f9bb4342a2ae8021b282c83e78d25aff67fa36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release 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