Skip to main content

Handles weekly assignment PDFs as exported by "web.sta"

Project description

sitzungsdienst

License PyPI Coverage Build

A simple Python utility for working with weekly assignment PDFs as exported by web.sta.

Getting started

Simply install all dependencies inside a virtual environment to get started:

# Clone repository & change directory
git clone https://codeberg.org/S1SYPHOS/sitzungsdienst && cd sitzungsdienst

# Set up & activate virtualenv
poetry shell

# Install dependencies
poetry install

Usage

Using this library is straightforward:

from sitzungsdienst import StA

# Pass file path (or its stream) & retrieve data
court_dates, express_dates = StA.runs('path/to/file.pdf')

# You may also pass multiple file paths (or their streams)
court_dates, express_dates = StA.runs(['path/to/file1.pdf', 'path/to/file2.pdf'])

# Use a subset by filtering it
filtered_court = court_dates.filter(['alice', 'bob'])
filtered_express = express_dates.filter('john')

# Get iCalendar data
ics = filtered_court.data2ics()
print(ics)

##
# BEGIN:VCALENDAR
# VERSION:2.0
# ..
# ..

Note: Since all data methods are using async, you should either await them (inside your own asyncio context) or call them using asyncio.run() (see below).

import asyncio
from sitzungsdienst import StA

async def main(file):
    # ..

    return await StA.run(file)

# Retrieve data
data = asyncio.gather(*[main(file) for file in files])

# ..

If you want to see it in action, head over to the sitzungsapp!

Happy coding!

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

sitzungsdienst-2.3.4.tar.gz (22.7 kB view hashes)

Uploaded Source

Built Distribution

sitzungsdienst-2.3.4-py3-none-any.whl (23.7 kB view hashes)

Uploaded Python 3

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