Skip to main content

Access to ETNIC web services through Python

Project description

pyetnic

Bibliothèque Python d'accès aux services web SOAP d'ETNIC pour l'enseignement de promotion sociale (Wallonie-Bruxelles).

Fonctionnalités

  • Formations : lister les formations organisables et les formations organisées
  • Organisation : créer, lire, modifier et supprimer une organisation de formation
  • Document 1 : lire, modifier et approuver le document de population (inscriptions)
  • Document 2 : lire et modifier le document des périodes d'activités d'enseignement
  • Document 3 : lire et modifier le document des attributions d'enseignants

Installation

pip install pyetnic

Configuration

Générer un fichier .env de départ avec la commande CLI :

pyetnic init-config

Puis remplir les valeurs dans le fichier .env généré :

# Environnement : dev (services-web.tq.etnic.be) ou prod (services-web.etnic.be)
ENV=dev

# Identifiants pour le développement
DEV_USERNAME=
DEV_PASSWORD=

# Identifiants pour la production
PROD_USERNAME=
PROD_PASSWORD=

# Paramètres par défaut
DEFAULT_ETABID=
DEFAULT_IMPLID=
DEFAULT_SCHOOLYEAR=2024-2025

Les identifiants sont ceux fournis par ETNIC pour accéder aux services web de votre établissement.

Utilisation

Lister les formations

import pyetnic

# Formations organisables (catalogue)
result = pyetnic.lister_formations_organisables(annee_scolaire="2024-2025")
for formation in result:
    print(formation.numAdmFormation, formation.libelleFormation)

# Formations organisées (avec leurs organisations)
result = pyetnic.lister_formations(annee_scolaire="2024-2025")
for formation in result:
    for org in formation.organisations:
        print(org.id.numOrganisation, org.dateDebutOrganisation, org.dateFinOrganisation)

Organisation

import pyetnic

# Lire une organisation
org = pyetnic.lire_organisation(
    annee_scolaire="2024-2025",
    etab_id=3052,
    num_adm_formation=12345,
    num_organisation=1,
)

# Modifier une organisation
pyetnic.modifier_organisation(organisation=org)

# Créer une organisation
pyetnic.creer_organisation(organisation=org)

# Supprimer une organisation
pyetnic.supprimer_organisation(organisation=org)

Documents administratifs

import pyetnic

# Document 1 - Population
doc1 = pyetnic.lire_document_1(annee_scolaire="2024-2025", etab_id=3052,
                                num_adm_formation=12345, num_organisation=1)
pyetnic.modifier_document_1(document=doc1)
pyetnic.approuver_document_1(document=doc1)

# Document 2 - Périodes d'activités
doc2 = pyetnic.lire_document_2(annee_scolaire="2024-2025", etab_id=3052,
                                num_adm_formation=12345, num_organisation=1)
pyetnic.modifier_document_2(document=doc2)

# Document 3 - Attributions d'enseignants
doc3 = pyetnic.lire_document_3(annee_scolaire="2024-2025", etab_id=3052,
                                num_adm_formation=12345, num_organisation=1)
pyetnic.modifier_document_3(document=doc3)

Dépendances

Licence

MIT — voir LICENSE

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

pyetnic-0.0.4.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

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

pyetnic-0.0.4-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file pyetnic-0.0.4.tar.gz.

File metadata

  • Download URL: pyetnic-0.0.4.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for pyetnic-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7e9c76784ecdc67ebdb5bff6c1d7d73c80ccfff38d6f27a63a6c46fad90860a4
MD5 52637f82ccbf7b34a6511bb2f232bde4
BLAKE2b-256 bd5927a94481e75b959d3225a5e565bf5ce07cb1d3ab424b70833b13c594df9f

See more details on using hashes here.

File details

Details for the file pyetnic-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pyetnic-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for pyetnic-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 48fb4ab041853c087c20fb5a3ed7bc40e5d58edb8e8f37ae6bfc10672350ed6a
MD5 81d52faa0fdf791c106445183f88d059
BLAKE2b-256 3f5ca72010cfaf1c7dc255e99dbc400b6c9edd76d903ebcade8f54704770b221

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