Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrf0rtuna4/modrinthpy
🏗 The python wrapper for ModrinthAPI
https://github.com/mrf0rtuna4/modrinthpy
modrinth modrinth-api wrapper-api
Last synced: about 2 months ago
JSON representation
🏗 The python wrapper for ModrinthAPI
- Host: GitHub
- URL: https://github.com/mrf0rtuna4/modrinthpy
- Owner: mrf0rtuna4
- License: mit
- Created: 2024-09-27T16:44:17.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-10-17T18:11:02.000Z (3 months ago)
- Last Synced: 2024-10-20T03:22:15.201Z (3 months ago)
- Topics: modrinth, modrinth-api, wrapper-api
- Language: Python
- Homepage: https://modrinth.com
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ModrinthPy
> [!WARNING]
> This library is under development and may contain errors!**ModrinthPy** is an unofficial Python API client for interacting with the [Modrinth](https://modrinth.com/) platform.
## Installation
You can install the library using pip:
```bash
pip install modrinthpy
```## Usage Examples
### Mod Search
You can easily search for mods on Modrinth by name, ID or filters:
```python
from modrinthpy import ModrinthClientclient = 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:
```python
from modrinthpy import ModrinthClientclient = 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`.
1. Forks Repository
2. Create a new branch for your changes (`git checkout -b feature/YourFeature`)
3. Make the changes
4. Open Pull Request## License
This project is licensed under the MIT license. For more details see file [LICENSE](https://github.com/mrf0rtuna4/modrinthpy/blob/main/LICENSE).