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.

SharedFile

class SharedFile([sharekey=None][, name=None][, user=None][, title=None][, description=None][, posted_at=None][, permalink=None][, width=None][, height=None][, views=None][, likes=None][, saves=None][, comments=None][, nsfw=None][, image_url=None][, source_url=None][, saved=None][, liked=None])

Object representing a file or embedded video on mlkshk.com

Parameters:
  • sharekey – (str): Sharekey of the file.
  • name – (str): Filename as uploaded to mlkshk.com
  • user – (User): User object representing user who uploaded the file
  • title – (str): Title of the SharedFile
  • description – (str): Description of the SharedFile
  • posted_at – (datetime): datetime.datetime object representing the time the SharedFile was uploaded
  • permalink – (str): URL of the SharedFile. Example: “http://mlkshk.com/1645C
  • width – (int): Width of the image.
  • height – (int): Height of the image
  • views – (int): How many views the SharedFile has received.
  • likes – (int): How many likes/favorites the SharedFile has received.
  • saves – (int): How many saves the SharedFile has received.
  • comments – (list): List of Comment objects posted to the SharedFile.
  • nsfw – (bool): Whether the file is not safe for work (NB: folks in the community sometimes flag very large GIFs as NSFW).
  • image_url – (str): URL for hotlinking to the image file.
  • source_url – (str): If not an image, this can be a YouTube, Vine, etc. link.
  • saved – (bool): If the currently authenticated user has saved the file.
  • liked – (bool): If the currently authenticated user has liked the file.
NewFromJson([data=None])

Return a SharedFile 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.

Return a dictionary representing the SharedFile object.

AsJsonString()

Return a JSON string representing this SharedFile instance. NB: any dates will be converted to ISO strings as part of the serialization.