Metadata-Version: 2.1
Name: sitzungsdienst
Version: 2.3.2
Summary: Handles weekly assignment PDFs as exported by "web.sta"
Home-page: https://digitalbuero.eu
License: GPL-3.0-only
Keywords: websta,legal
Author: Digitalbüro
Author-email: pypi@digitalbuero.eu
Maintainer: Martin Folkers
Maintainer-email: hello@twobrain.io
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Legal Industry
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing
Requires-Dist: ics (>=0.7,<0.8)
Requires-Dist: pypdf2 (==2.0.0)
Project-URL: Funding, https://donate.rsf.org
Project-URL: Issue Tracker, https://codeberg.org/digitalbuero/sitzungsdienst/issues
Project-URL: Repository, https://codeberg.org/digitalbuero/sitzungsdienst
Description-Content-Type: text/markdown

# sitzungsdienst
[![License](https://badgen.net/badge/license/GPL/blue)](https://codeberg.org/S1SYPHOS/sitzungsdienst/src/branch/main/LICENSE) [![PyPI](https://badgen.net/pypi/v/sitzungsdienst)](https://pypi.org/project/sitzungsdienst) [![Coverage](https://badgen.net/badge/coverage/100/cyan)](https://codeberg.org/S1SYPHOS/sitzungsdienst/src/branch/main/COVERAGE) [![Build](https://ci.codeberg.org/api/badges/S1SYPHOS/sitzungsdienst/status.svg)](https://codeberg.org/S1SYPHOS/sitzungsdienst/issues)

A simple Python utility for working with weekly assignment PDFs as exported by [`web.sta`](https://www.dvhaus.de/leistungen/web.sta).


## Getting started

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

```bash
# 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:

```python
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).

```python
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`](https://codeberg.org/S1SYPHOS/sitzungsapp)!


**Happy coding!**

