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.
|
3 months ago | |
---|---|---|
src/sitzungsdienst | 3 months ago | |
tests | 3 months ago | |
.editorconfig | 7 months ago | |
.gitattributes | 4 months ago | |
.gitignore | 10 months ago | |
.pre-commit-config.yaml | 4 months ago | |
.python-version | 4 months ago | |
.woodpecker.yml | 4 months ago | |
CODE_OF_CONDUCT.md | 11 months ago | |
CONTRIBUTING.md | 4 months ago | |
COVERAGE | 3 months ago | |
LICENSE | 1 year ago | |
README.md | 4 months ago | |
poetry.lock | 4 months ago | |
pyproject.toml | 3 months ago | |
requirements-dev.txt | 4 months ago | |
requirements.txt | 4 months ago | |
tasks.py | 4 months ago |
README.md
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!