Skip to content

Releases: imcf/pyppms

v3.3.0

07 Jul 20:02
Compare
Choose a tag to compare

Added

  • pyppms.ppms.get_running_sheet() now has an optional parameter localisation (defaulting to an empty str) that will be passed to the call to pyppms.ppms.get_systems_matching(), allowing to restrict the runningsheet to systems of a given "room".

Full Changelog: v3.2.1...v3.3.0

v3.2.1

30 Jun 08:36
Compare
Choose a tag to compare

Fixed

  • 🕛 🌃 end time: pyppms.booking.PpmsBooking.endtime_fromstr() contained a bug where the end time of a booking finishing at midnight got wrongly assigning it to the start of the given day instead of the end. This is now fixed by setting the end time to the start of the following day.

Full Changelog: v3.2.0...v3.2.1

v3.2.0

28 Jun 09:29
Compare
Choose a tag to compare

Added

  • pyppms.ppms.PpmsConnection.last_served_from_cache has been added to indicate if the last request was served from the cache or on-line.

Changed

  • Several log messages have been demoted to lower levels for further reducing logging clutter.

v3.1.0

28 Jun 09:27
Compare
Choose a tag to compare

Added

  • pyppms.common.fmt_time() to string-format a datetime object that might also be None (in which case a fixed string is returned).
  • pyppms.booking.PpmsBooking.desc has been added as a property to retrieve a shorter description of the object than calling str() on it.
  • pyppms.exceptions.NoDataError has been added to indicate a PUMAPI response did not contain any useful data.
  • pyppms.common.parse_multiline_response() will now raise the newly added NoDataError in case the requested runningsheet for a day doesn't contain any bookings to allow for properly dealing with "empty" days.

Changed

  • Several log messages have been demoted from debug to trace level and might have been shortened / combined to reduce logging clutter.

v3.0.0

28 Jun 09:27
Compare
Choose a tag to compare

Changed

  • 🧨 Minimum required Python version is now 3.9.
  • Dependencies have been updated to their latest (compatible) versions.
  • Logging is now done through Loguru.

v2.3.0

28 Jun 09:19
Compare
Choose a tag to compare

Added

  • pyppms.ppms.PpmsConnection() now takes an optional parameter cache_users_only that will prevent any request but getuser from being stored in the local cache. This is useful in scenarios where frequent requests to PPMS are being done to fetch booking states and such that would be slowed down enormously if no user caching was present. Obviously the cached users need to be refreshed explicitly on a regular basis then. Defaults to False which will result in the same behavior as before. Please note that several things are implicitly being cached (in memory) during the lifetime of the PpmsConnection object (e.g. the PPMS systems) unless their corresponding method is being called with force_refresh=True.
  • pyppms.ppms.PpmsConnection.update_users() and pyppms.ppms.PpmsConnection.get_users() now both have an optional parameter active_only (defaulting to True) that can be used to also request users that are marked as inactive in PPMS.

Changed

  • pyppms.ppms.PpmsConnection.get_user() is only logging a DEBUG level message (before: ERROR) in case the requested user can't be found since it also raises a KeyError. This is done to prevent cluttering up the logs of calling code that might use this method to figure out if an account exists in PPMS and properly deals with the exception raised.

v2.2.0

26 Apr 16:10
Compare
Choose a tag to compare

Added

  • pyppms.ppms.PpmsConnection.flush_cache() to flush the on-disk cache with an optional argument keep_users (defaulting to False) that allows for flushing the entire cache except for the user details. This provides the opportunity of refreshing the cache on everything but existing users. Note that this will not affect new users, they will still be recognized and fetched from PUMAPI (and stored in the cache).

Changed

  • pyppms.ppms.PpmsConnection.get_systems_matching() now raises a TypeError in case the parameter name_contains is accidentially as str instead of a list.
  • pyppms.ppms.PpmsConnection.get_running_sheet() now has an optional parameter ignore_uncached_users (defaulting to False) that allows to process the running sheet even if it contains users that are not in the fullname_mapping attribute.
  • If the cache_path attribute is set for an pyppms.ppms.PpmsConnection instance but creating the actual subdir for an intercepted response fails (e.g. due to permission problems) the response-cache will not be updated. Before, the exception raised by the underlying code (e.g. a PermissionError) was passed on.
  • Methods of pyppms.ppms.PpmsConnection are now sorted in alphabetical order, making it easier to locate them e.g. in the API documentation.

Removed

  • The following previously deprecated (or not even implemented) methods of pyppms.ppms.PpmsConnection have been removed in favor of pyppms.ppms.PpmsConnection.get_systems_matching():
    • _get_system_with_name()
    • _get_machine_catalogue_from_system()
    • get_bookable_ids()
  • Removed the stub pyppms.ppms.PpmsConnection.get_system() that was only raising a NotImplementedError.

v2.1.0

30 Aug 09:25
Compare
Choose a tag to compare

Changes in pyppms 2.1.0

  • [API] pyppms.ppms.PpmsConnection.get_user() and pyppms.ppms.PpmsConnection.get_user_dict() now both accept an optional parameter skip_cache that is passed on to the pyppms.ppms.PpmsConnection.request() call
  • [FIX] pyppms.ppms.PpmsConnection.update_users() now explicitly asks for the cache to be skipped

v2.0.0

26 Aug 07:08
Compare
Choose a tag to compare

Changes in pyppms 2.0.0

  • [API] the constructor signature for PpmsUser() has been changed and now expects a single argument (the PUMAPI response text)
  • [API] the constructor signature for PpmsSystem() has been changed and now expects a single argument (a dict as generated by pyppms.common.parse_multiline_response())
  • [API] the constructor signature for PpmsBooking() has been changed and now expects the PUMAPI response text, the booking type (if the booking is currently running or upcoming) and the system ID
  • [API] the following methods have been removed as their behavior is now achieved by the corresponding default constructor of the respective class:
    • PpmsUser.from_response()
    • PpmsSystem.from_parsed_response()
    • PpmsBooking.from_booking_request()

v1.1.0

11 Jul 08:50
Compare
Choose a tag to compare

First public release of the pyppms package.