Various helper functions

These functions are called (internally) to (i) make the code more readable and (ii) automate some parts of the data handling. These functions are all in pymangal.helpers.

Documentation

pymangal.helpers.uri_from_username(api, username)[source]

Returns a URI from a username

Parameters:
  • api – An API object
  • username – The username for which you want the URI, as a string
Returns:

The URI as a string, and raises ValueError if there is no known user, TypeError if the arguments are not in the correct type.

pymangal.helpers.prepare_data_for_patching(api, resource, data)[source]
pymangal.helpers.check_data_from_api(api, resource, data)[source]
pymangal.helpers.keys_to_uri(api, resource, data)[source]