A Python client for the Modrinth API
Project description
ModrinthPy
[!WARNING] This library is under development and may contain errors!
ModrinthPy is an unofficial Python API client for interacting with the Modrinth platform.
Installation
You can install the library using pip:
pip install modrinthpy
Usage Examples
Mod Search
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))
Getting information about project
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())
Contributing
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
License
This project is licensed under the MIT license. For more details see file LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file modrinthpy-0.1.0.tar.gz
.
File metadata
- Download URL: modrinthpy-0.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5bc9bf4f792b89b4fe4d435ed4fa09bb23ef996ddbbbb0ffa3514d030c26fee |
|
MD5 | 89e7481ee187f3f369b85c63c334597c |
|
BLAKE2b-256 | 4a7bdf85f41c9e2002835d07449c3da9ac25a1b85a07efff86f768d1ec62e711 |
File details
Details for the file modrinthpy-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: modrinthpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63c184c19fc20b089ab43bffa10531f789a04d3da17913870fc9749d8b1b2958 |
|
MD5 | 7e0bb1bd72c5621ad26ed681a25bc92a |
|
BLAKE2b-256 | 880387575e39c7789251b4c4e0d2fad39b5df6287647d6331b6dfbb8e5491724 |