Key Functions

This page documents the functions and objects you will interact with at a high level. They are the most reliable source for obtaining pages and should preffered over passing the html to the models yourself.

parse_page

moddb.base.parse_page(url)[source]

Parse a url and return the appropriate object.

Parameters:

url (str) – The url to parse

Returns:

The parsed page as the instance of the model the page represents, can be anything like Mod or Game

Return type:

Model

parse_results

moddb.base.parse_results(url, *, params={})[source]

Parse a list of results and return them as a list of thumbnails.

Parameters:

url (str) – The url of the result list to parse

Returns:

The list of thumbnails, wrapped in a ResultList so as to benefit from the helper methods that help with navigation

Return type:

ResultList

login

moddb.base.login(username, password)[source]

Login the user to moddb through the library, this allows user to see guest comments and see private groups they are part of.

Parameters:
  • username (str) – The username of the user

  • password (str) – The password associated to that username

Raises:

ValueError – The password or username was incorrect

Returns:

The member you are logged in as

Return type:

Member

logout

moddb.base.logout()[source]

Logs the user out by clearing the cookies, all unapproved guest comments will be hidden and all private groups will be hidden once more

front_page

moddb.base.front_page()[source]

This returns a model representing the front page of May sound fancy but it is no more than a collection of popular mods, files, games and articles. In addition jobs are listed and a poll.

Returns:

The front page object.

Return type:

FrontPage