modrinth4py
A Python API client for the Modrinth API.
Installation
pip install modrinth4py
Usage
from modrinth4py import ModrinthClient, NewProject, SideSupport, ProjectType
client = ModrinthClient(token="your-modrinth-pat")
project = client.get_project("sodium")
print(project["title"])
Creating a project
from modrinth4py import NewProject, SideSupport, ProjectType, RequestedStatus
new_project = NewProject(
slug="my-mod",
title="My Mod",
description="A short description",
categories=["utility"],
client_side=SideSupport.REQUIRED,
server_side=SideSupport.OPTIONAL,
body="## My Mod\nLong-form description here.",
project_type=ProjectType.MOD,
)
result = client.create_project(new_project)
Uploading a version
from pathlib import Path
from modrinth4py import NewVersion, VersionType
version = NewVersion(
name="1.0.0",
version_number="1.0.0",
project_id="your-id",
game_versions=["1.21"],
loaders=["fabric"],
version_type=VersionType.RELEASE,
changelog="Initial release.",
)
client.create_version(version, file_paths=[Path("my-mod-1.0.0.jar")])
Modifying a project
from modrinth4py import ModrinthClient, ProjectUpdate
client.modify_project("your-slug", ProjectUpdate(
discord_url="https://discord.gg/your-invite",
license_id="MIT",
))
Parallel requests
projects = ModrinthClient.parallel_requests([
lambda: client.get_project("sodium"),
lambda: client.get_project("lithium"),
lambda: client.get_project("iris"),
])
Logging
modrinth4py uses Python's standard logging module under the modrinth4py.client logger.
Pass debug=True to ModrinthClient to enable debug output, or configure your own handler:
import logging
logging.basicConfig(level=logging.DEBUG)
License
MIT
Metadata
Release files for modrinth4py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| modrinth4py-0.1.0.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| modrinth4py-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / modrinth4py-0.1.0.tar.gz
| Download URL | modrinth4py-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e573b516f53e02137f596f09b80efa3f92548c61a17b62bf63ec3cdc36bf84c5
|
|
BLAKE2b-256 checksum How to use checksums |
092473bacd567548340002e9fb2cf809120d8e0ba736fcb58ed0697812a463d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / modrinth4py-0.1.0-py3-none-any.whl
| Download URL | modrinth4py-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20e313c3c0ee0f68adf49828307dce3960b12eab93f50b09fc2b632fd4d57030
|
|
BLAKE2b-256 checksum How to use checksums |
01bd5bade4b4a6a6968f5717b5dd6442b158c67aa9105f48766ad6d7d5a17ce3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency log