Handles weekly assignment PDFs as exported by "web.sta"
Project description
sitzungsdienst
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
Release history Release notifications | RSS feed
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.3.tar.gz
(22.6 kB
view hashes)
Built Distribution
Close
Hashes for sitzungsdienst-2.3.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d93edeefde6b889d54d1df139a9c35a1de073c7b4125dd7eda3b229792669e28 |
|
MD5 | 903f9576ead1bcec0a451337cae2d8af |
|
BLAKE2b-256 | 9562069d89b3c77a92b6f1a0a29e481bf1e88527704d0e15547a080f96c0d218 |