Skip to main content

Single interface for several game mod portals

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

Two supported patterns are available: an async context manager or a manually closed client.

import asyncio

from modmux import ModID, Muxer, Provider

mod_id = ModID(provider=Provider.MODRINTH, id="fabric-api")


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


asyncio.run(run())
import asyncio

from modmux import ModID, Muxer, Provider

mod_id = ModID(provider=Provider.MODRINTH, id="fabric-api")


async def run() -> None:
    mux = Muxer()
    try:
        mod = await mux.get_mod(Provider.MODRINTH, mod_id)
    finally:
        await mux.aclose()
    print(mod.name)


asyncio.run(run())

The modmux_client(...) helper remains available as a convenience wrapper around Muxer for existing code.

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.1.tar.gz (14.8 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.1-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: modmux-0.1.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for modmux-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a78ed9a05abf8167147a31b8d7768347bcbc45d4b0080401dd282c76f5bd0c43
MD5 4c54d703f3710ebf73c794cf589d3fd9
BLAKE2b-256 50e0bc8ccfb63333d8f6f6b934018e0d376ab7b13c5519c2dffd79aa5c23741e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: modmux-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for modmux-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1634441bf2b9e010b25a462597df21aac7575d5fcf2e7dc7b82068519420272
MD5 319fdb00f77aa2078ec805b0d51f3c57
BLAKE2b-256 572d8ef881296e7cca831551ef1085f391f44f07122c88a191a0abbd8fdce096

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