USP Mein Postkorb
This package provides access to the Mein Postkorb service of the Austrian Government's Unternehmensserviceportal (see references below). You can retrieve new or all deliveries (Nachrichten), mark them as read or delete them, and download attachments.
Installation
Requires Python 3.11 or newer. Install from PyPI:
pip install usp-mp
This installs the usp_mp library and the uspmp command line tool:
uspmp --help
To install only the command line tool, in its own environment, use pipx install usp-mp or uv tool install usp-mp instead.
To install from source, for example for development:
git clone https://github.com/mjl/usp-mp.git
cd usp-mp
python -m venv .venv && . .venv/bin/activate
pip install -e '.[dev]'
You also need a client certificate (.p12) for the Automatische Abholung; see docs/howto.md for how to obtain one and for usage.
Development
Run the tests (no certificate or network needed; a fake service stands in for Mein Postkorb):
pip install -e '.[dev]'
pytest
Or, with uv, on a specific Python version. Run at least the oldest (3.11) and the newest supported version:
uv run --no-project --python 3.11 --with-editable '.[dev]' pytest
uv run --no-project --python 3.14 --with-editable '.[dev]' pytest
Tests against the demo service
tests/test_demo.py runs against the Mein Postkorb demo (TEST) endpoint. It covers TLS with the client certificate, querying and paging, metadata, downloads with checksum verification, the documented error responses, close/delete, and the uspmp CLI.
The demo always returns the same mock data, and the tests check it against expected results in three layers:
- Invariants that hold for any data:
HitCountmatches, paging reassembles the full list, checksums verify, and so on. - Values documented in the vendor HowTo: the 10 delivery IDs in order, the 3 new ones, and the attachment-download example.
- A golden snapshot of everything else in tests/data/demo_snapshot.json: subjects, timestamps, and attachment IDs, names, MIME types, sizes and checksums. A mismatch lists each difference by path. If BRZ refreshes the demo data, re-record it with
--update-demo-snapshot(plus the certificate options) and review the diff before committing.
You must bring your own client certificate and password. Neither is part of this repository, and no test contains or defaults to one. Each person running these tests uses a .p12 issued for their own USP account (see the certificate setup checklist in docs/howto.md). Without a certificate, the demo tests are skipped and everything else runs normally.
Provide the certificate and password with pytest options or environment variables (options win):
| What | Option | Environment variable |
|---|---|---|
| Certificate | --p12=PATH |
USP_MP_P12 |
| Password, from a file (first line) | --p12-password-file=PATH |
USP_MP_P12_PASS_FILE |
| Password, as a value (empty means none) | --p12-password=VALUE |
USP_MP_P12_PASS |
| Re-record the snapshot instead of comparing | --update-demo-snapshot |
# only the demo tests
pytest -m demo --p12=$HOME/secrets/usp.p12 --p12-password-file=$HOME/secrets/usp.pw
# everything, configured through the environment
export USP_MP_P12=$HOME/secrets/usp.p12 USP_MP_P12_PASS_FILE=$HOME/secrets/usp.pw
pytest
Notes:
- Write the options with
=, as above. With--p12 PATH, pytest mistakes the path for a test location before it reads the project configuration, and then reports the option as unknown. - Prefer a password file (mode
0600) over--p12-passwordorUSP_MP_P12_PASS, since a value on the command line is visible to other users in the process list. - Keep the certificate and password file outside the repository.
*.p12is in.gitignoreas a safety net, but a password file is not. - If a certificate is given without any password source, or the file doesn't exist, pytest stops with a usage error instead of silently skipping. A wrong password makes the demo tests fail, not skip.
- The tests only ever use the demo endpoint and refuse to run against production. They call close and delete, which per the vendor HowTo succeed on the demo without changing its mock data.
pytest --helplists the options under "Mein Postkorb demo-service tests".
License
BSD 3-Clause; see LICENSE. BRZ's documents are not redistributed here (see docs/api_docs/README.md). The bundled WSDL/XSDs are BRZ's service definition, with local changes listed in src/usp_mp/wsdl/PATCHES.md.
References
Metadata
Release files for usp-mp 1.3.20261124
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| usp_mp-1.3.20261124.tar.gz | 73.1 kB | Without provenance | Details for usp_mp-1.3.20261124.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| usp_mp-1.3.20261124-py3-none-any.whl | Python 3 | none | any | Details for usp_mp-1.3.20261124-py3-none-any.whl |
Total release size: 116.7 kB
Release files / usp_mp-1.3.20261124.tar.gz
| Download URL | usp_mp-1.3.20261124.tar.gz |
|---|---|
| Size | 73.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcebc4a08ad4de4e47681cf3d3ef9655d8e19229569f427989067c06f442b93c
|
|
BLAKE2b-256 checksum How to use checksums |
cf2ed0c29454d17e6fe242ea987c2e553f0e10a9fa3a97e1d6efcf3cedd9d2d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / usp_mp-1.3.20261124-py3-none-any.whl
| Download URL | usp_mp-1.3.20261124-py3-none-any.whl |
|---|---|
| Size | 43.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
56c4e4ea7781355326fc8ee4168a91cf55e713ae6a0ebd435ab064e3a2bf48aa
|
|
BLAKE2b-256 checksum How to use checksums |
c54dd412b3bd1b22c287e38673dd10de7b46c3ef5314350e50c2aaff07513c61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for usp-mp 1.3.20261124
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.