Skip to main content

A scrapper for ModDB Mod and Game pages

Project description

ModDB Reader

Library is now stable

The goal of the library is to be able to navigate ModDB purely programmatically through scraping and parsing of the various models present on the website. This is based off a command of my bot which can parse either a game or a mod, this command gave birth to the original library which was extremely limited in its abilities and only able to parse a few pages with inconsistencies. This library is a much more mature and professional attempt at the whole idea, adding on a much deeper understanding of OOP.

Basic Usage

The simplest way to use this library is to simply pass a ModDB url to the parse function and let the magic happen.

import moddb
mod = moddb.parse_page("http://www.moddb.com/mods/edain-mod")
print(mod.name) #Edain Mod

The library tries to get the type of the url you are passing on its own but due to inconsistencies in the ModDB site this is not always correct, if you desire to be more specific you can pass a ThumbnailType to the function.

import moddb
mod = moddb.parse_page("http://www.moddb.com/mods/edain-mod", page_type=moddb.ThumbnailType.mod)
print(mod.name) #Edain Mod

Advanced Usage

Check out the documentation for more information

Support

Installing

You can get it from pypi: https://pypi.org/project/moddb

pip install moddb

Models

  • Mod
  • Game
  • Engine
  • File
  • Media
  • Addon
  • Article
  • Blog
  • User
  • Team
  • Group
  • Job
  • Search Page
  • Front Page
  • Platforms
  • Software
  • HardwAre
  • Updates
  • Friend Requests
  • Watchers
  • Tags

Maybe

  • Messages
  • Threads

Glossary

  • Partial[Model]: A version of the model which does not contain all the attributes of the full model. Mainly because that model is being displayed as a preview in another page. Not to confuse with Thumbnails, Thumbnails are only guaranteed to contain a name and url of the page.
  • Boxes: Containers present on pages, a div tag which contains information around a certain theme and as such have been grouped into Box Models of such.
  • Pages: Another name for Models.
  • Thumbnails: A very widely used model meant to represent models which are references but not expanded onto. Usually the model in question will only include a url and the name of the page. This is transformed into a thumbnail and the user can then parse it with the built-in method.

Development

requirement.txt file contains the necessary additional libraries for develompment

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moddb-0.8.1.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moddb-0.8.1-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file moddb-0.8.1.tar.gz.

File metadata

  • Download URL: moddb-0.8.1.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for moddb-0.8.1.tar.gz
Algorithm Hash digest
SHA256 cf103b4cb1d43e4fcf2cd9e64ca030767e946fdce2ddb091ab8808ea04781ab8
MD5 5b2a19e8c9bfd6502a4eaaec6277a1d1
BLAKE2b-256 ae7d8d5cf4e2aac9563dc2d6ba6a313aaef89c9f647b7df2e71907971d49e931

See more details on using hashes here.

File details

Details for the file moddb-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: moddb-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.13

File hashes

Hashes for moddb-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b76a4a9b0ba79d658d0c10f0c28366e0c49b271e417aa3cbc08e3ad73270f58
MD5 5475173251c7ddf90a21aab52dd128ff
BLAKE2b-256 cb6837b7e06a24693d804e2b89692a68e37074252de937d509623d8665274e96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page