ModrinthPy
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.
Metadata
Release files for modrinthpy 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 | Provenance | Actions |
|---|---|---|---|---|
| modrinthpy-0.1.0.tar.gz | 10.2 kB | Without provenance | Details for modrinthpy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| modrinthpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for modrinthpy-0.1.0-py3-none-any.whl |
Total release size: 19.8 kB
Release files / modrinthpy-0.1.0.tar.gz
| Download URL | modrinthpy-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5bc9bf4f792b89b4fe4d435ed4fa09bb23ef996ddbbbb0ffa3514d030c26fee
|
|
BLAKE2b-256 checksum How to use checksums |
4a7bdf85f41c9e2002835d07449c3da9ac25a1b85a07efff86f768d1ec62e711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / modrinthpy-0.1.0-py3-none-any.whl
| Download URL | modrinthpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63c184c19fc20b089ab43bffa10531f789a04d3da17913870fc9749d8b1b2958
|
|
BLAKE2b-256 checksum How to use checksums |
880387575e39c7789251b4c4e0d2fad39b5df6287647d6331b6dfbb8e5491724
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for modrinthpy 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.