Warning
This library is under development and may contain errors!
ModrinthPy is an unofficial Python API client for interacting with the Modrinth platform.
You can install the library using pip:
pip install modrinthpy
You can easily search for mods on Modrinth by name, ID or filters:
from modrinthpy import ModrinthClient
client = ModrinthClient()
def display_search_results(results):
if not results:
print("No projects found.")
else:
print(f"Found {len(results)} projects:")
for project in results:
print(f"Slug: {project.slug} | Title: {project.title}")
async def run_search(search_query):
results = await client.search_projects(search_query)
display_search_results(results)
search = input("Write Prompt: ")
client.run(run_search(search))
You can also get information about a particular project by knowing its ID or Slug:
from modrinthpy import ModrinthClient
client = ModrinthClient()
async def get():
mod = await client.get_project(slug="sodium")
print(mod.title)
print(mod.description)
print(mod.downloads)
client.run(get())
All forms of participation in the project are welcome! If you find a bug or want to suggest improvements, create an Issue
or make a Pull Request
.
- Forks Repository
- Create a new branch for your changes (
git checkout -b feature/YourFeature
) - Make the changes
- Open Pull Request
This project is licensed under the MIT license. For more details see file LICENSE.