API Documentation¶
A python wrapper for the Nexus API.
-
exception
pynxm.
LimitReachedError
[source]¶ Exception raised when the request rate limit has been reached.
-
class
pynxm.
Nexus
(api_key)[source]¶ The class used for connecting to the Nexus API. Requires an API key from your Nexus account.
-
classmethod
sso
(app_slug, sso_token, sso_id=None)[source]¶ Application login via Single Sign-On (SSO).
Parameters: - app_slug – A string with the application slug.
- sso_token – A string with the connection token.
- sso_id – An optional string with an id used in previous connections.
Returns: A ‘Nexus’ instance, ready to be used.
-
colour_schemes_list
()[source]¶ Returns a list of all colour schemes, including the primary, secondary and ‘darker’ colours.
-
user_tracked_add
(game, mod_id)[source]¶ Tracks this mod with the current user.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
-
user_tracked_delete
(game, mod_id)[source]¶ Stop tracking this mod with the current user.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
-
game_details
(game)[source]¶ Returns specified game, along with download count, file count and categories.
Parameters: game – A string with Nexus’ game domain.
-
game_list
(include_unapproved=False)[source]¶ Returns a list of all games.
Parameters: include_unapproved – A boolean on whether to include unapproved games.
-
game_updated_list
(game, period)[source]¶ Returns a list of mods that have been updated in a given period, with timestamps of their last update.
Parameters: - game – A string with Nexus’ game domain.
- period – Acceptable values: ‘1d’ (1 day), ‘1w’ (1 week) or ‘1m’ (1 month).
-
game_latest_added_list
(game)[source]¶ Retrieve 10 latest added mods for a specified game.
Parameters: game – A string with Nexus’ game domain.
-
game_latest_updated_list
(game)[source]¶ Retrieve 10 latest updated mods for a specified game.
Parameters: game – A string with Nexus’ game domain.
-
game_trending_list
(game)[source]¶ Retrieve 10 trending mods for a specified game.
Parameters: game – A string with Nexus’ game domain.
-
mod_details
(game, mod_id)[source]¶ Retrieve specified mod details, from a specified game.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
-
mod_search
(game, md5_hash)[source]¶ Searches for a mod given its md5 hash.
Parameters: - game – A string with Nexus’ game domain.
- md5_hash – Mod md5 hash.
-
mod_endorse
(game, mod_id)[source]¶ Endorse a mod.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
-
mod_abstain
(game, mod_id)[source]¶ Abstain from endorsing a mod.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
-
mod_file_list
(game, mod_id, categories=None)[source]¶ Lists all files for a specific mod.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
- categories – Filter file category. Accepts either a list of categories or a comma-separated string of categories. Possible categories: ‘main’, ‘update’, ‘optional’, ‘old_version’ and ‘miscellaneous’.
-
mod_file_details
(game, mod_id, file_id)[source]¶ View a specified mod file, using a specified game and mod.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
- file_id – A string with the file id.
-
mod_file_download_link
(game, mod_id, file_id, nxm_key=None, expires=None)[source]¶ Generate download link for mod file.
Note: For non-premium users, see the Nexus API docs on how to obtain the key/expires strings.
Parameters: - game – A string with Nexus’ game domain.
- mod_id – A string the mod id.
- file_id – A string with the file id.
- nxm_key – A string with the nxm file key.
- expires – A string with the nxm expires.
-
classmethod