Skip to main content

Zermelo api wrapper library for python.

Project description

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

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

zermelo.py-1.0.2.tar.gz (3.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page