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 details)

Uploaded Source

File details

Details for the file zermelo.py-1.0.2.tar.gz.

File metadata

  • Download URL: zermelo.py-1.0.2.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for zermelo.py-1.0.2.tar.gz
Algorithm Hash digest
SHA256 06eced4b6ab357efab5c1d9ce8584533aa5d6a3f773d1386d325ca99e96b626a
MD5 6303c9b6f86edffe62af5e6a64a077ba
BLAKE2b-256 d1ebf16412c9155aa171b827949c74a0d586c87d43410683bd35c187e2d3e8c3

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