Models¶
User¶
-
class
User
([id=None][, name=None][, profile_image_url=None][, about=None][, website=None][, shakes=None])¶ Represents a User on mlkshk and has the properties listed below. User information cannot be changed via the API as there is no endpoint for this functionality.
Parameters: - id – (int) ID of the user for mlkshk; unable to be changed via mlkshk.com or the API.
- name – (str): Username; unable to be changed via mlkshk.com or the API.
- profile_image_url – (str): Profile picture of the user. User can change this on the website.
- about – (str): Short description of the user.
- website – (str): User’s website (i.e., not the user’s page on mlshk.com).
- shakes – (list): List of Shake objects.
-
NewFromJson
([data=None])¶ Create a User object from a JSON string. Returns a User object.
-
AsDict
([dt=True])¶ Parameters: dt – (bool) Return dates as datetime
objects; false to return as ISO strings. Return the User object as a dictionary of values. NB: Dates will be returned as native, UTC-timezone (but not timezone aware)datetime.datetime
objects.
-
AsJsonString
()¶ Return the User object as JSON string. NB: any dates will be converted to ISO strings as part of the serialization.
Shake¶
-
class
Shake
([id=None][, name=None][, owner=None][, url=None][, thumbnail_url=None][, description=None][, type=None][, created_at=None][, updated_at=None])¶ Object representing a Shake on mlkshk.com
Parameters: - id – (id): ID of the Shake
- name – (str): Shake’s name
- owner – (User): User object representing the owner of the Shake
- url – (str): URL of the Shake (i.e., mlkshk.com/commute)
- thumbnail_url – (str): “Avatar” for the Shake
- description – (str): Description of the Shake
- type – (str): ‘user’ or ‘group’ denoting whether the Shake is has no contributors other than the owner (
user
shake) or many (group
shake). - created_at – (datetime):
datetime.datetime
representing the creation date & time of the Shake. - updated_at – (datetime): Last modified
datetime.datetime
of the Shake.
-
NewFromJson
([data=None])¶ Return a Shake object from a JSON string.
-
AsDict
([dt=True])¶ Parameters: dt – (bool) Return dates as datetime
objects; false to return as ISO strings. Return the User object as a dictionary of values. NB: Dates will be returned as native, UTC-timezone (but not timezone aware)datetime.datetime
objects.
-
AsJsonString
()¶ Return a JSON string representing this Shake instance. NB: any dates will be converted to ISO strings as part of the serialization.