Games¶
Documentation on the object representing a mod.io Game
Games are the umbrella entities under which all mods are stored.
-
class
modio.game.
Game
(**attrs)[source]¶ Represents an instance of a Game. Do not create manually.
-
status
¶ Status of the game. (see status and visibility for details) Filter attribute.
Type: Status
-
date
¶ UNIX timestamp of the date the game was registered. Filter attribute.
Type: datetime.datetime
-
updated
¶ UNIX timestamp of the date the game was last updated. Filter attribute.
Type: datetime.datetime
-
live
¶ UNIX timestamp of the date the game went live. Filter attribute.
Type: datetime.datetime
-
presentation
¶ Presentation style used on the mod.io website. Filter attribute.
Type: Presentation
-
submission
¶ Submission process modders must follow. Filter attribute.
Type: Submission
-
maturity_options
¶ Switch to allow developers to select if they flag their mods as containing mature content. Filter attribute.
Type: MaturityOptions
-
ugc
¶ Word used to describe user-generated content (mods, items, addons etc). Filter attribute.
Type: str
-
name_id
¶ sub_domain name for the game (https://name_id.mod.io). Filter attribute.
Type: str
-
instructions
¶ Instructions on uploading mods for this game, only applicable if
submission
equals 0Type: str
-
instructions_url
¶ Link to a mod.io guide, your modding wiki or a page where modders can learn how to make and submit mods to your games profile. Filter attribute.
Type: str
-
platforms
¶ Platforms this games supports
Type: List[GamePlatform]
-
get_mod
(mod_id: int) → modio.mod.Mod[source]¶ Queries the mod.io API for the given mod ID and if found returns it as a Mod instance. If not found raises NotFound.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: mod_id (int) – The ID of the mod to query the API for Raises: NotFound
– A mod with the supplied id was not found.Returns: The mod with the given ID Return type: class: Mod
-
get_mods
(*, filters: modio.objects.Filter = None) → modio.objects.Returned[modio.mod.Mod][modio.mod.Mod][source]¶ Gets all the mods available for the game. Returns a named tuple with parameters results and pagination. This method takes filtering arguments
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: filters (Optional[Filter]) – A instance of Filter to be used for filtering, paginating and sorting results Returns: The results and pagination tuple from this request Return type: Returned[List[Mod], Pagination]
-
get_mod_events
(*, filters: modio.objects.Filter = None) → modio.objects.Returned[modio.entities.Event][modio.entities.Event][source]¶ Gets all the mod events available for this game sorted by latest event first. This method takes filtering arguments
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: filters (Optional[Filter]) – A instance of Filter to be used for filtering, paginating and sorting results Returns: The results and pagination tuple from this request Return type: Returned[List[Event], Pagination]
-
get_tag_options
(*, filters: modio.objects.Filter = None)[source]¶ Gets all the game tags available for this game. Updates the tag_option attribute. This method takes filtering arguments
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: filters (Optional[Filter]) – A instance of Filter to be used for filtering, paginating and sorting results Returns: The results and pagination tuple from this request Return type: Returned[List[TagOption], Pagination]
-
get_stats
(*, filters: modio.objects.Filter = None)[source]¶ Get the stats for the game. This method takes filtering arguments
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: filter (Optional[Filter]) – A instance of Filter to be used for filtering, paginating and sorting results Returns: The stats for the game. Return type: GameStats
-
get_mods_stats
(*, filters: modio.objects.Filter = None)[source]¶ Gets the stat for all the mods of this game. This method takes filtering arguments
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: filter (Optional[Filter]) – A instance of Filter to be used for filtering, paginating and sorting results Returns: The results and pagination tuple from this request Return type: Returned[List[ModStats], Pagination]
-
add_mod
(mod: modio.objects.NewMod) → modio.mod.Mod[source]¶ Add a mod to this game.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: mod (NewMod) – The mod to be submitted Raises: ValueError
– One of the requirements for a parameter has not been met.Returns: The newly created mod Return type: Mod
-
add_media
(*, logo: str = None, icon: str = None, header: str = None)[source]¶ Upload new media to to the game. This function can take between 1 to 3 arguments depending on what media you desire to upload/update.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: - logo (Optional[str]) – Path to the file that you desire to be the game’s logo. Dimensions must be at least 640x360 and we recommended you supply a high resolution image with a 16 / 9 ratio. mod.io will use this logo to create three thumbnails with the dimensions of 320x180, 640x360 and 1280x720.
- icon (Optional[str]) – Path to the file that you desire to be the game’s icon. Must be gif, jpg or png format and cannot exceed 1MB in filesize. Dimensions must be at least 64x64 and a transparent png that works on a colorful background is recommended. mod.io will use this icon to create three thumbnails with the dimensions of 64x64, 128x128 and 256x256.
- header (Optional[str]) – Path to the file that you desire to be the game’s header. Must be gif, jpg or png format and cannot exceed 256KB in filesize. Dimensions of 400x100 and a light transparent png that works on a dark background is recommended.
Returns: A message containing the result of the query if successful.
Return type:
-
add_tag_options
(name: str, *, tags: Optional[List[str]] = None, hidden: Optional[bool] = False, locked: Optional[bool] = False, tag_type: Optional[Literal[dropdown, checkboxes]] = 'dropdown')[source]¶ Add tags which mods can apply to their profiles. If the tag names already exists, settings such as hidden or type will be overwritten to the values provided and all the tags will be added to the group.
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 tag group
- type (Optional[Literal['dropdown', 'checkboxes']]) – Defaults to dropdown dropdown : Mods can select only one tag from this group, dropdown menu shown on site profile. checkboxes : Mods can select multiple tags from this group, checkboxes shown on site profile.
- hidden (Optional[bool]) – Whether or not this group of tags should be hidden from users and mod devs. Defaults to False
- locked (Optional[bool]) – Whether or not mods can assign from this group of tag to themselves. If locked only game admins will be able to assign the tag. Defaults to False.
- tags (Optional[List[str]]) – Array of tags that mod creators can apply to their mod
-
async_add_tag_options
(name: str, *, tags: Optional[List[str]] = None, hidden: Optional[bool] = False, locked: Optional[bool] = False, tag_type: Optional[Literal[dropdown, checkboxes]] = 'dropdown')[source]¶
-
async_get_mod_events
(*, filters: modio.objects.Filter = None) → modio.objects.Returned[modio.entities.Event][modio.entities.Event][source]¶
-
async_get_mods
(*, filters: modio.objects.Filter = None) → modio.objects.Returned[modio.mod.Mod][modio.mod.Mod][source]¶
-
async_get_owner
() → modio.entities.User¶
-
async_report
(name: str, summary: str, report_type: modio.enums.Report = <Report.generic: 0>)¶
-
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
-
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:
-
delete_tag_options
(name: str, *, tags: Optional[List[str]] = None) → bool[source]¶ Delete one or more tags from a tag option.
This method has an async equivalent prefixed with ‘async_’. You must use Client.start before using the async equivalent.
Parameters: Returns: Returns True if the tags were sucessfully removed, False if the requests was sucessful but the tags was not removed (if the tag wasn’t part of the option.)
Return type:
-