Skip to main content

Wrapper for Cheminot's API

Project description

Cheminot API wrapper

A simple wrapper for Cheminot's API to aid in registration automation.

Cheminot is the course registration application of École de technologie supérieure.

[!CAUTION] Registration automation may not be allowed; real usage of this wrapper is discouraged.

I made this for fun and API reverse engineering practice.

Installation

pip install cheminot

Usage

Instanciation

from cheminot import CheminotSession

cheminot = CheminotSession(
    AUTH_TOKEN,
    USER_AGENT,
    STUDENT_ID,
    PROGRAM_ID,
    SEMESTER_ID,
    "https://cheminotn.etsmtl.ca"
)

Methods

get_path_courses() # Retrieve the program's path's courses.
get_course_available_groups(course_id: str) # Get available groups for a specific course.
register_to_course(course_id: str, group_number: str, concentration: str) # Register to a course's group.
unregister_from_course(course_id: str) # Unregister from a course.
get_schedule() # Retrieve the current schedule.
confirm_schedule() # Confirm/save the current schedule.

Variables

AUTH_TOKEN

The JWT authorization token associated with the session to be used in requests. It expires after 1 hour.

USER_AGENT

The user to be used in requests.

STUDENT_ID

The permanent student code.

PROGRAM_ID

The code of the program.

SEMESTER_ID

The semester's code.

Format: {YEAR}{SEMESTER_POSITION_IN_YEAR(1 for Winter, 2 for Summer and 3 for Fall)}

CONCENTRATION_ID

Possible values:

  • "TC" (for Tronc Commun) used for mandatory courses.
  • "AX" (for Axe), used for optional courses.

Endpoints

Get path's courses

GET /api/Etudiant/{STUDENT_ID}/programme/{PROGRAM_ID}/cheminement?session={SEMESTER_ID}

Get course's available groups

GET /api/CoursOfferts/{STUDENT_ID}/programme/{PROGRAM_ID}/cours/{COURSE_ID}?sessionInscr={SEMESTER_ID}

Register to a course

POST /api/horaire/etudiant/{STUDENT_ID}/programme/{PROGRAM_ID}/horaire/add?session={SEMESTER_ID}&concentration={CONCENTRATION_ID}
Body: {"Sigle":"{COURSE_ID}","Groupe":"{GROUP_NUMBER}"}

Unregister from a course

DELETE /api/horaire/etudiant/{STUDENT_ID}/programme/{PROGRAM_ID}/session/{SEMESTER_ID}/cours/{COURSE_ID}

Get schedule

GET /api/horaire/etudiant/{STUDENT_ID}/programme/{PROGRAM_ID}/horaire?session={SEMESTER_ID}

Confirm schedule

PUT /api/horaire/etudiant/{STUDENT_ID}/confirmation-horaire
Body: {"SessionInscr":{SEMESTER_ID},"ProgrammeId":"{PROGRAM_ID}"}

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

cheminot-1.0.0.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

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

cheminot-1.0.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file cheminot-1.0.0.tar.gz.

File metadata

  • Download URL: cheminot-1.0.0.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cheminot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1cf744d5330dfdf3a27dc09f56155229ca0795250e6b5f290f98e1419b344f84
MD5 e951f97eae8488c714e24bac1beb736b
BLAKE2b-256 d6595d1d62c6e7839a5cd1d0a4a1ed46500bfcd207992389fe2ed06fdda54e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheminot-1.0.0.tar.gz:

Publisher: pypi.yml on ariannelafraise/cheminot-api-wrapper

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

File details

Details for the file cheminot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cheminot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cheminot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 172d36c6705ac0975720bba5ee702797d8e13ee5c1db5b96b49a89dbef636685
MD5 1ba39562c40a42b0bed084a18f82cef4
BLAKE2b-256 c93803a2e84d3a3786255b727b64ec1ec0b9726fb2c68ceeb773f74cabb9b360

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheminot-1.0.0-py3-none-any.whl:

Publisher: pypi.yml on ariannelafraise/cheminot-api-wrapper

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

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