Misc Models¶
Documentation on all the other objects returned by mod.io requests which are not large enough to warrant their own page.
Module for miscs objects.
-
class
modio.entities.
Message
(**attrs)[source]¶ A simple representation of a modio Message, used when modio returns a status message for the query that was accomplished.
-
class
modio.entities.
Image
(**attrs)[source]¶ A representation of a modio image, which stand for the Logo, Icon and Header of a game/mod or the Avatar of a user.Can also be a regular image.
-
small
¶ A link to a smaller version of the image, processed by Size varies based on the object being processed. Can be None.
Type: str
-
-
class
modio.entities.
Event
(**attrs)[source]¶ Represents a mod event.
Filter-Only Attributes
These attributes can only be used at endpoints which return instances of this class and takes filter arguments. They are not attached to the object itself and trying to access them will cause an AttributeError
- latest : bool
- Returns only the latest unique events, which is useful for checking if the primary modfile has changed.
- subscribed : bool
- Returns only events connected to mods the authenticated user is subscribed to, which is useful for keeping the users mods up-to-date.
-
date
¶ UNIX timestamp of the event occurrence. Filter attribute.
Type: datetime.datetime
-
game_id
¶ ID of the game that the mod the user change came from. Can be None if it is a mod event. Filter attribute.
Type: int
-
type
-
class
modio.entities.
Comment
(**attrs)[source]¶ Represents a comment on a mod page.
-
date
¶ Unix timestamp of date the comment was posted. Filter attribute.
Type: datetime.datetime
-
parent_id
¶ ID of the parent this comment is replying to. 0 if comment is not a reply. Filter attribute.
Type: int
-
position
¶ The position of the comment. Filter attribute. How it works: - The first comment will have the position ‘01’. - The second comment will have the position ‘02’. - If someone responds to the second comment the position will be ‘02.01’. - A maximum of 3 levels is supported.
Type: int
-
level
¶ The level of nesting from 1 to 3 where one is top level and three is the deepest level
Type: int
-
edit
(content)[source]¶ Update the contents of a comment.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: content (str) – The new content of the comment Returns: The comment with the new content Return type: Comment
-
delete
()[source]¶ Remove the comment.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
add_positive_karma
()[source]¶ Add positive karma to the comment
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Returns: The updated comment Return type: Comment
-
add_negative_karma
()[source]¶ Add negative karma to the comment
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Returns: The updated comment Return type: Comment
-
-
class
modio.entities.
ModFile
(**attrs)[source]¶ A object to represents modfiles. If the modfile has been returned for the me/modfile endpoint then edit() and delete() cannot be called as a game is lacking.
-
date
¶ UNIX timestamp of the date the modfile was submitted. Filter attribute.
Type: datetime.datetime
-
scanned
¶ UNIX timestamp of the date the file was virus scanned. Filter attribute.
Type: datetime.datetime
-
virus_status
¶ Current status of the virus scan for the file. Filter attribute.
Type: VirusStatus
-
date_expires
¶ UNIX timestamp of when the url expires
Type: datetime.datetime
-
game_id
¶ ID of the game of the mod this file belongs to. Can be None if this file was returned from the me/modfiles endpoint.
Type: int
-
platforms
¶ List of platforms this file is avalaible on.
Type: List[ModFilePlatform]
-
edit
(**fields)[source]¶ Edit the file’s details. Returns an updated instances of the file.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: - version (str) – Change the release version of the file
- changelog (str) – Change the changelog of this release
- active (bool) – Change whether or not this is the active version.
- metadata_blob (str) – Metadata stored by the game developer which may include properties such as what version of the game this file is compatible with.
Returns: The updated file
Return type:
-
delete
()[source]¶ Deletes the modfile, this will raise an error if the file is the active release for the mod.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Raises: Forbidden
– You cannot delete the active release of a mod
-
url_is_expired
()[source]¶ Check if the url is still valid for this modfile.
Returns: True if it’s still valid, else False Return type: bool
-
async_get_owner
() → modio.entities.User¶
-
-
class
modio.entities.
GamePlatform
(**attrs)[source]¶ The platform for a game.
-
platform
¶ The platform
Type: TargetPlatform
-
-
class
modio.entities.
ModPlatform
(**attrs)[source]¶ The platform for a mod
-
platform
¶ The platform
Type: TargetPlatform
-
-
class
modio.entities.
ModFilePlatform
(**attrs)[source]¶ The platform for a mod file
-
platform
¶ The platform
Type: TargetPlatform
-
status
¶ The status of the modfile for the corresponding platform.
Type: ModFilePlatformStatus
-
-
class
modio.entities.
TagOption
(**attrs)[source]¶ Represents a game tag gropup, a category of tags from which a mod may pick one or more.
-
type
¶ Can be either “checkbox” where users can chose multiple tags from the list or “dropdown” in which case only one tag can be chosen from the group
Type: str
Whether or not the tag is only accessible to game admins, used for internal mod filtering.
Type: bool
Array of tags for this group
Type: List[str]
-
-
class
modio.entities.
Rating
(**attrs)[source]¶ Represents a rating, objects obtained from the get_my_ratings endpoint
-
rating
¶ The rating type
Type: RatingType
-
date
¶ UNIX timestamp of whe the rating was added
Type: datetime.datetime
-
mod_key
= 'mod_id'¶
-
add_negative_rating
()¶ Changes the mod rating to negative, the author of the rating will be the authenticated user. If the mod has already been negatively rated by the user it will return False. If the negative rating is successful it will return True.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
add_positive_rating
()¶ Changes the mod rating to positive, the author of the rating will be the authenticated user. If the mod has already been positevely rated by the user it will return False. If the positive rating is successful it will return True.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
async_add_negative_rating
()¶
-
async_add_positive_rating
()¶
-
async_delete
()¶
-
delete
()¶ Removes a rating. Returns true if the rating was succefully removed.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
-
class
modio.entities.
ModStats
(**attrs)[source]¶ Represents a summary of stats for a mod
-
weighted
¶ Overall rating of this item calculated using the Wilson score confidence interval. This column is good to sort on, as it will order items based on number of ratings and will place items with many positive ratings above those with a higher score but fewer ratings.
Type: int
-
text
¶ Textual representation of the rating in format. This is currently not updated by the lib so you’ll have to poll the resource’s endpoint again.
Type: str
-
date_expires
¶ Unix timestamp until this mods’s statistics are considered stale. Endpoint should be polled again when this expires.
Type: datetime.datetime
-
-
class
modio.entities.
GameStats
(**attrs)[source]¶ A stat object containing the stats specific to games
-
date_expires
¶ The date at which the stats are considered “stale” and no longer accurate.
Type: datetime.datetime
-
-
class
modio.entities.
Theme
(**attrs)[source]¶ Object representing a game’s theme. This is mostly useful if you desire to create a visual interface for a game or one of its mods. All attributes are hex color codes.
-
primary
¶ Primary color of the game
Type: string
-
dark
¶ The “dark” color of the game
Type: string
-
light
¶ The “light” color of the game
Type: string
-
success
¶ The color of a successful action with the game interface
Type: string
-
warning
¶ The color of a warning with the game interface
Type: string
-
danger
¶ The color of a danger warning with the game interface
Type: string
-
-
class
modio.entities.
Tag
[source]¶ mod.io Tag objects are represented as dictionnaries and are returned as such by the function of this library, each entry of in the dictionnary is composed of the tag name as the key and the date_added as the value. Use dict.keys() to access tags as a list.
Filter-Only Attributes
These attributes can only be used at endpoints which return instances of this class and takes filter arguments. They are not attached to the object itself and trying to access them will cause an AttributeError
- date : datetime.datetime
- Unix timestamp of date tag was added.
- tag : str
- String representation of the tag.
-
class
modio.entities.
MetaData
[source]¶ mod.io MetaData objects are represented as dictionnaries and are returned as such by the function of this library, each entry of in the dictionnary is composed of the metakey as the key and the metavalue as the value.
-
class
modio.entities.
Dependencies
[source]¶ mod.io Depedencies objects are represented as dictionnaries and are returned as such by the function of this library, each entry of in the dictionnary is composed of the dependency (mod) id as the key and the date_added as the value. Use dict.keys() to access dependencies as a list.
-
class
modio.entities.
User
(**attrs)[source]¶ Represents a modio user.
-
name_id
¶ Subdomain name of the user. For example: https://mod.io/members/username-id-here. Filter attribute.
Type: str
-
last_online
¶ Unix timestamp of date the user was last online.
Type: datetime.datetime
-
lang
¶ Users language preference. See localization for the supported languages. Filter attribute.
Type: str
-
mute
()[source]¶ Mute a user, this will hide all mods authored by them from the authenticated user.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
unmute
()[source]¶ Unmute a user, this will show all mods authored by them from the authenticated user.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
async_report
(name: str, summary: str, report_type: modio.enums.Report = <Report.generic: 0>)¶
-
report
(name: str, summary: str, report_type: modio.enums.Report = <Report.generic: 0>)¶ Report a this game, make sure to read mod.io’s ToU to understand what is and isnt allowed.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: Returns: The returned message on the success of the query.
Return type:
-
-
class
modio.entities.
TeamMember
(**attrs)[source]¶ Inherits from User. Represents a user as part of a team. .. rubric:: Filter-Only Attributes
These attributes can only be used at endpoints which return instances of this class and takes filter arguments. They are not attached to the object itself and trying to access them will cause an AttributeError
- user_id : int
- Unique id of the user.
- username : str
- Username of the user.
-
name_id
¶ Subdomain name of the user. For example: https://mod.io/members/username-id-here. Filter attribute.
Type: str
-
last_online
¶ Unix timestamp of date the user was last online.
Type: datetime.datetime
-
lang
¶ Users language preference. See localization for the supported languages. Filter attribute.
Type: str
-
team_id
¶ The id of the user in the context of their team, not the same as user id. Filter attribute.
Type: int
-
date
¶ Unix timestamp of the date the user was added to the team. Filter attribute.
Type: datetime.datetime
-
async_mute
()¶
-
async_report
(name: str, summary: str, report_type: modio.enums.Report = <Report.generic: 0>)¶
-
async_unmute
()¶
-
mute
()¶ Mute a user, this will hide all mods authored by them from the authenticated user.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
-
report
(name: str, summary: str, report_type: modio.enums.Report = <Report.generic: 0>)¶ Report a this game, make sure to read mod.io’s ToU to understand what is and isnt allowed.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: Returns: The returned message on the success of the query.
Return type:
-
unmute
()¶ Unmute a user, this will show all mods authored by them from the authenticated user.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.