wouter173 / zermelo.py

zermelo api wrapper library for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zermelo.py

Build Status Python 3.6 License: MIT

A Python implementation of the Zermelo API.

Features

  1. Get appointments from a zermelo calendar.
  2. Get data of a zermelo user.
  3. Get announcements.

Installation

To install the package run this command:

  pip install zermelo.py

Usage

Client

Client()

params:

School: String ? Name of the school.

Result:

Client: Zermelo.Client()

Demo:

from zermelo import Client

cl = Client("scalacollege")

Authentication

Client.authenticate()

Params:

Code: String ? A connect code you get from https://YOURSCHOOLNAME.zportel.nl/main/#connectionsModule-connectApp

Result:

Token: dict()

Demo:

token = cl.auhtenticate("441 440 997 507")
print(token["access_token"])

User

Client.get_user()

Params:

Token: String ? Access_token you get from the Client.Authenticate() function

Result:

User: dict()

Demo:

user = cl.get_user(token["access_token"])
print(user)

Appointments

Client.get_appointments()

Params:

Token: String ? Access_token you get from the Client.Authenticate() function
StartUnix: int ? Unix timestamp for the first date you want to get the appointments from.
EndUnix: int ? Unix timestamp for the last date you want to get the appointments from.

Result:

Appointments: dict()

Demo:

appointments = cl.get_appointments(token["access_token"], 1567468800, 1568073600)
print(appointments)

Announcements

Client.get_announcements()

Params:

Token: String ? Access_token you get from the Client.Authenticate() function

Result:

Announcements: dict()

Demo:

announcements = cl.get_announcements(token["access_token"])
print(announcements)

Enrollments

Client.get_liveschedule()

Params:

Token: String ? Access_token you get from the Client.Authenticate() function
Week: String ? The ISO-week for which you want to request the schedule
Usercode: String ? The code of the student you want to request the schedule of 

Result:

Enrollments: dict()

Demo:

usercode = cl.get_user(token["access_token"])["response"]["data"][0]["code"]
enrollments = cl.get_liveschedule(token["access_token"], "202150", usercode) # Requests week 50 of the year 2021
print(enrollments)

License

MIT

About

zermelo api wrapper library for python

License:MIT License


Languages

Language:Python 100.0%