Skip to main content

Single interface for several game mod platforms

Project description

ModMux

Unified async client for multiple game mod platforms. ModMux normalises provider responses into shared Pydantic models and ships a small CLI for quick lookups.

Features

  • Async HTTP client with rate limiting and retry handling
  • Normalised Mod metadata model across providers
  • Pluggable provider registry
  • CLI for fetching a single mod and printing JSON

Supported providers

  • Modrinth
  • CurseForge
  • Nexus Mods
  • mod.io
  • Steam Workshop
  • Factorio Mod Portal (Wube)

Requirements

  • Python 3.13+
  • Dependencies: pydantic, httpx, aiolimiter

Install

From the repo:

python -m pip install -e .

CLI usage

The CLI expects a provider name and provider-specific mod id. Provider names are case-insensitive.

modmux MODRINTH fabric-api --pretty
modmux CURSEFORGE 238222 --pretty
modmux NEXUSMODS 12345 --game transportfever2
modmux MODIO some-mod --game 4321 --user 12345 --token <api-key>

Or without installing a script:

python -m modmux MODRINTH fabric-api --pretty

Output is a JSON serialisation of the Mod model.

Credentials and environment variables

  • --token accepts API tokens/keys.
  • --user supplies a user id for providers that need user-scoped base URLs (mod.io).
  • Environment variables:
    • MODMUX_TOKEN (fallback for all providers)
    • MODMUX_<PROVIDER>_TOKEN (provider-specific, e.g. MODMUX_MODRINTH_TOKEN)
    • MODMUX_<PROVIDER>_USER (provider-specific user id, e.g. MODMUX_MODIO_USER)

Library usage

import asyncio

from modmux import ModID, Provider, modmux_client


async def run() -> None:
    mod_id = ModID(provider=Provider.MODRINTH, id="fabric-api")
    async with modmux_client(creds={Provider.MODRINTH: {"token": "token"}}) as mux:
        mod = await mux.get_mod(Provider.MODRINTH, mod_id)
    print(mod.name)


asyncio.run(run())

Provider notes

  • CurseForge: slug lookups require ModID.game (game id).
  • Nexus Mods: requires ModID.game (game domain, e.g. skyrim).
  • mod.io: requires ModID.game plus a user id (use --user or MODMUX_MODIO_USER).
  • Steam: uses a Workshop published file id; ModID.game is optional.
  • Wube: uses the Factorio mod name slug.

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

modmux-0.1.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

modmux-0.1.0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file modmux-0.1.0.tar.gz.

File metadata

  • Download URL: modmux-0.1.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for modmux-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e56b06fe3d79d7d4de7c130250260a0eb6c6e193d18e9e9c41d81d84e0e1fa39
MD5 4c9501d506d227ea0ac89a0ae17de946
BLAKE2b-256 5b5d8529f17426a2ae4002e9afe4b63db7695497a3b7eb3d2b57e4858e02cd43

See more details on using hashes here.

File details

Details for the file modmux-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: modmux-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for modmux-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 386524d74b98077329448136f378ac3cd0e203740580b31ff0aecb0c9f5d5c3c
MD5 1a7e1d9e85dc6114ee620d1fe04bb37b
BLAKE2b-256 737e2372a89f07df15486c97eaf9b3ea8b5089991cec1e54d9a9dc254ea83a29

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