Skip to main content

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.

  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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modrinthpy-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

modrinthpy-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

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

Hashes for modrinthpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5bc9bf4f792b89b4fe4d435ed4fa09bb23ef996ddbbbb0ffa3514d030c26fee
MD5 89e7481ee187f3f369b85c63c334597c
BLAKE2b-256 4a7bdf85f41c9e2002835d07449c3da9ac25a1b85a07efff86f768d1ec62e711

See more details on using hashes here.

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

Hashes for modrinthpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63c184c19fc20b089ab43bffa10531f789a04d3da17913870fc9749d8b1b2958
MD5 7e0bb1bd72c5621ad26ed681a25bc92a
BLAKE2b-256 880387575e39c7789251b4c4e0d2fad39b5df6287647d6331b6dfbb8e5491724

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page