api module
- class api.ApiDecoder(*, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None)
Bases:
json.decoder.JSONDecoder
Subclass of json decoder made for the calendar-specific JSON decodings.
- decode(obj: Any, w: Optional[Any] = None) str
Return the Python representation of
s
(astr
instance containing a JSON document).
- class api.ApiEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)
Bases:
json.encoder.JSONEncoder
Subclass of json decoder made for the calendar-specific JSON encodings.
- default(obj: Any) Any
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
- api.before_api_request()
- api.get_events()
API endpoint to fetch the schedule matching the various arguments.
- The request accepts 3 arguments:
- view: if set to True, shows the schedule in ADE-Scheduler’s schedule viewer.
By default, view = False the data is returned in JSON format.
- year: defines the academical year. Accepted format is YYYY-YYYY where the second year is the first + 1.
e.g.: 2020-20201
- code: the various code of the courses to be added to the schedule.
e.g.: LELEC2885, LMECA2170, LEPL1104,… To specify a list of codes, use the following format: /schedule?code=CODE_1&code=CODE_2&code=CODE_3 and so on.
- filtered events: the IDs of the events you want to filter.
Say the course which code is “CODE” has two TPs with IDs “TP: CODE-Q1A” and “TP: CODE-Q1B” and you want to filter out the events of “TP: CODE-Q1A”, you can specify such a filter by specifying: /schedule?code=CODE&CODE=TP: CODE-Q1A&…
/!To make sure to avoid any problems, respect the case-sensitiveness of the codes and event IDs. Generally, those are uppercase. /!
- Example:
- or, with filtered events:
https://ade-scheduler.info.ucl.ac.be/api/events?year=2020-2021&code=LEPL1104&LEPL1104=TP: LEPL1104_Q2B-APE&view=true
- api.schedule_shield()
API route for badges on the GitHub Repository, per shields.io
- api.user_shield()
API route for badges on the GitHub Repository, per shields.io