Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyPPMS

Pytest-Poetry 🧪🎭 codecov

PUMAPI - Python Interface

Stratocore's PPMS booking system offers an API (the so-called PUMAPI, short for PPMS Utility Management API) for fetching information from the booking system as well as changing its state and properties.

This is a Python 3 package for talking to the PUMAPI.

Usage Example

Fetch email addresses of all active users:

from pyppmsconf import PYPPMS_URI, PYPPMS_API_KEY
from pyppms import ppms
from pyppms.common import set_loglevel

set_loglevel("TRACE")  # optional, default is "DEBUG"

conn = ppms.PpmsConnection(PYPPMS_URI, PYPPMS_API_KEY)

print("Querying PPMS for emails of active users, can take minutes...")
emails = ppms.get_users_emails(active=True)
print(f"Got {len(emails)} email addresses from PPMS:")
print("\n".join(emails))

Testing

Automated testing is described in the TESTING document on github.

Note

The PPMS API sometimes exposes a bit of a surprising behavior. During development of the package, we came across several issues (this list is certainly incomplete):

  • HTTP status return code is always 200, even on failed authentication.
  • Results of queries are a mixture of CSV (with headers) and and text with newlines (with no headers and therefore without structural information on the data). JSON is implemented in some cases only.
  • The CSV headers sometimes do contain spaces between the colons, sometimes they don't.
  • Some fields are quoted in the CSV output, some are not. Difficult to separate the values since there are colons in the values too.
  • Semantics of keys is not consistent. Sometimes user is the user id, sometimes it refers to the user's full name.
  • Using an invalid permission level (e.g. Z) with the setright action is silently ignored by PUMAPI, the response is still done even though this doesn't make any sense.
  • There is no (obvious) robust way to derive the user id from the user's full name that is returned e.g. by getrunningsheet, making it very hard to cross-reference it with data from getuser.
  • The result of the getrunningsheet query in general is not suited very well for automated processing, it seems to be rather tailored for humans and subject to (mis-) interpretation.
  • Unfortunately Username and Systemname are not the unique id, they are rather the full description. Therefore sometimes looping over all users and systems is necessary.
  • Some results have a very strange format - for example, the starting time of the next booking is given as minutes from now instead of an absolute time.
  • Official documentation is rather rudimentary, i.e. it contains almost no information on what is returned in case wrong / invalid parameters are supplied and similar situations.

References

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyppms-4.0.0a14.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyppms-4.0.0a14-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file pyppms-4.0.0a14.tar.gz.

File metadata

  • Download URL: pyppms-4.0.0a14.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyppms-4.0.0a14.tar.gz
Algorithm Hash digest
SHA256 7496b5dafeb9f6ef2cea072eb2b7789a86f7d328770b6eda79a42b331777ae35
MD5 798a90ae67943b72e2197ff167ff5c65
BLAKE2b-256 8b88515fa9ada2aba07acefed1e7283a35d45761ed4a98925667e8c1d11e8845

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyppms-4.0.0a14.tar.gz:

Publisher: release.yml on imcf/pyppms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyppms-4.0.0a14-py3-none-any.whl.

File metadata

  • Download URL: pyppms-4.0.0a14-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyppms-4.0.0a14-py3-none-any.whl
Algorithm Hash digest
SHA256 f936548a87d168938e9eee30ee989a9a5c2d665d0546a0f7da6f0229685e9bc0
MD5 4e6537a43cb165e74be4c845636dedb8
BLAKE2b-256 640a1ee128924333c5f82bb985639b5c0e3a249ce0f7fa24d8033515e495ff50

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyppms-4.0.0a14-py3-none-any.whl:

Publisher: release.yml on imcf/pyppms

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page