A simple Python utility for working with weekly assignment PDFs as exported by 'web.sta'
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Martin Folkers 6d309aad21
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
Bump version
2 months ago
src/sitzungsdienst Take care of empty 'query' in 'filter' 2 months ago
tests Take care of empty 'query' in 'filter' 2 months ago
.editorconfig Format code using 'black' & comply with 'pylint' 5 months ago
.gitattributes Add file 'poetry.lock' 2 months ago
.gitignore Update '.gitignore' 8 months ago
.pre-commit-config.yaml Move 'mypy' from 'pre-commit' hook to 'tasks.py' 2 months ago
.python-version Migrate build toolchain to 'poetry' 2 months ago
.woodpecker.yml Add support for 'async' workflows 2 months ago
CODE_OF_CONDUCT.md Add code of conduct notice 9 months ago
CONTRIBUTING.md Change heading & email address in 'CONTRIBUTING.md' 2 months ago
COVERAGE Take care of empty 'query' in 'filter' 2 months ago
LICENSE Migrate repo to 'codeberg.org' 1 year ago
README.md Add support for 'async' workflows 2 months ago
poetry.lock Add support for 'async' workflows 2 months ago
pyproject.toml Bump version 2 months ago
requirements-dev.txt Add support for 'async' workflows 2 months ago
requirements.txt Add support for 'async' workflows 2 months ago
tasks.py Max out code coverage 2 months ago

README.md

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!