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.

code

An http response code

Type:int
message

The server response to the request

Type:str
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.

filename

Name of the file

Type:str
original

Link to the original file

Type:str
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
medium

A link to a medium version of the image, processed by Size varies based on the object being processed. Can be None.

Type:str
large

A link to a large 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.
id

Unique ID of the event. Filter attribute.

Type:int
mod

ID of the mod this event is from. Filter attribute.

Type:int
user

ID of the user that made the change. Filter attribute.

Type:int
date

UNIX timestamp of the event occurrence. Filter attribute.

Type:datetime.datetime
type

Type of the event. Filter attribute.

Type:EventType
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.

id

ID of the comment. Filter attribute.

Type:int
resource_id

The parent resource. Filter attribute.

Type:int
user

Istance of the user that submitted the comment. Filter attribute.

Type:User
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
karma

Total karma received for the comment. Filter attribute.

Type:int
karma_guest

Total karma received from guests for this comment

Type:int
content

Content of the comment. Filter attribute.

Type:str
children

List of comment replying to this one

Type:List[Comment]
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
async_add_negative_karma()[source]
async_add_positive_karma()[source]
async_delete()[source]

Remove the comment.

This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.

async_edit(content)[source]
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.

id

ID of the modfile. Filter attribute.

Type:int
mod

ID of the mod it was added for. Filter attribute.

Type:int
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
virus

True if a virus was detected, False if it wasn’t. Filter attribute.

Type:bool
virus_hash

VirusTotal proprietary hash to view the scan results.

Type:str
size

Size of the file in bytes. Filter attribute.

Type:int
hash

MD5 hash of the file. Filter attribute.

Type:str
filename

Name of the file. Filter attribute.

Type:str
version

Version of the file. Filter attribute.

Type:str
changelog

Changelog for the file. Filter attribute.

Type:str
metadata

Metadata stored by the game developer for this file. Filter attribute.

Type:str
url

url to download file

Type:str
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:

ModFile

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_delete()[source]
async_edit(**fields)[source]
async_get_owner() → modio.entities.User
get_owner() → modio.entities.User

Get the original submitter of the resource.

This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.

Returns:The original submitter
Return type:User
class modio.entities.ModMedia(**attrs)[source]

Represents all the media for a mod.

youtube

A list of youtube links

Type:List[str]
sketchfab

A list of SketchFab links

Type:List[str]
images

A list of image objects (gallery)

Type:List[Image]
class modio.entities.BasePlatform(**attrs)[source]

Base class for a platform.

class modio.entities.GamePlatform(**attrs)[source]

The platform for a game.

platform

The platform

Type:TargetPlatform
label

The human readable platform label

Type:str
moderated

Whether the platform is moderated by game admins

Type:bool
class modio.entities.ModPlatform(**attrs)[source]

The platform for a mod

platform

The platform

Type:TargetPlatform
modfile_live

The ID of the modfile currently live for that platform.

Type:int
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.

name

Name of the tag group

Type:str
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
hidden

Whether or not the tag is only accessible to game admins, used for internal mod filtering.

Type:bool
locked

Whether or not mods can self assign from this tag option.

Type:bool
tags

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

game_id

The ID of the game the rated mod is for.

Type:int
mod_id

The ID of the mod that was rated

Type:int
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

id

Mod ID of the stats. Filter attribute.

Type:int
rank

Current rank of the mod. Filter attribute.

Type:int
rank_total

Number of ranking spots the current rank is measured against. Filter attribute

Type:int
downloads

Amount of times the mod was downloaded. Filter attribute

Type:int
subscribers

Amount of subscribers. Filter attribute

Type:int
total

Number of times this item has been rated.

Type:int
positive

Number of positive ratings. Filter attribute

Type:int
negative

Number of negative ratings. Filter attribute

Type:int
percentage

Percentage of positive rating (positive/total)

Type:int
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
is_stale() → bool

Returns a bool depending on whether or not the stats are considered stale.

Returns:True if stats are expired, False else.
Return type:bool
class modio.entities.GameStats(**attrs)[source]

A stat object containing the stats specific to games

id

The id of the game

Type:int
mods_count_total

The total count of mods for this game

Type:int
mods_download_today

The amount of mod downloaded today

Type:int
mods_download_total

The amount of mods downloaded all times

Type:int
mods_download_daily_avg

Average daily mod downlaods

Type:int
mods_subscribers_total

Total amount of subscribers to all mods

Type:int
date_expires

The date at which the stats are considered “stale” and no longer accurate.

Type:datetime.datetime
is_stale() → bool

Returns a bool depending on whether or not the stats are considered stale.

Returns:True if stats are expired, False else.
Return type:bool
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.

id

ID of the user. Filter attribute.

Type:int
name_id

Subdomain name of the user. For example: https://mod.io/members/username-id-here. Filter attribute.

Type:str
username

Name of the user. Filter attribute.

Type:str
last_online

Unix timestamp of date the user was last online.

Type:datetime.datetime
avatar

Contains avatar data

Type:Image
tz

Timezone of the user, format is country/city. Filter attribute.

Type:str
lang

Users language preference. See localization for the supported languages. Filter attribute.

Type:str
profile

URL to the user’s mod.io profile.

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_mute()[source]
async_report(name: str, summary: str, report_type: modio.enums.Report = <Report.generic: 0>)
async_unmute()[source]
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:
  • name (str) – Name of the report
  • summary (str) – Detailed description of your report. Make sure you include all relevant information and links to help moderators investigate and respond appropiately.
  • report_type (Report) – Report type
Returns:

The returned message on the success of the query.

Return type:

Message

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.
id

ID of the user. Filter attribute.

Type:int
name_id

Subdomain name of the user. For example: https://mod.io/members/username-id-here. Filter attribute.

Type:str
username

Name of the user. Filter attribute.

Type:str
last_online

Unix timestamp of date the user was last online.

Type:datetime.datetime
avatar

Contains avatar data

Type:Image
tz

Timezone of the user, format is country/city. Filter attribute.

Type:str
lang

Users language preference. See localization for the supported languages. Filter attribute.

Type:str
profile

URL to the user’s mod.io profile.

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
level

Permission level of the user

Type:Level
date

Unix timestamp of the date the user was added to the team. Filter attribute.

Type:datetime.datetime
position

Custom title given to the user in this team. Filter attribute.

Type:str
mod

The mod object the team is attached to.

Type:Mod
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:
  • name (str) – Name of the report
  • summary (str) – Detailed description of your report. Make sure you include all relevant information and links to help moderators investigate and respond appropiately.
  • report_type (Report) – Report type
Returns:

The returned message on the success of the query.

Return type:

Message

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.