classCurseForge#
- class CurseForge( )#
CurseForge. Requires an API key from console.curseforge.com.
- Parameters:
- api_key#
The API key.
- base_url#
The API’s base URL.
- Raises:
PlatformError – The API key is empty.
- search(
- query: str,
- *,
- project_type: Literal['mod', 'modpack', 'resourcepack', 'shader'] = 'modpack',
- game_version: str | None = None,
- loader: str | None = None,
- offset: int = 0,
- limit: int = 20,
Search CurseForge’s catalogue.
- Parameters:
query (str) – The search text.
project_type (Literal['mod', 'modpack', 'resourcepack', 'shader']) – The kind of project to find.
game_version (str | None) – Only match this Minecraft version.
loader (str | None) – Only match this mod loader.
offset (int) – How many results to skip.
limit (int) – The maximum number of results to return.
- Returns:
One page of results.
- Raises:
NetworkError – CurseForge could not be reached.
- Return type:
- get_project( ) Project#
Look up a project by id, slug or URL.
- Parameters:
- Returns:
The project.
- Raises:
PlatformError – No project has that slug.
NetworkError – CurseForge could not be reached or does not know the id.
- Return type:
- iter_releases(
- project: Project,
- *,
- game_version: str | None = None,
- loader: str | None = None,
- release_only: bool = False,
Yield a project’s releases, newest first, reading pages as needed.
Server packs are left out. CurseForge serves at most 10,000 files per project, so older releases of a larger project are not listed.
- Parameters:
- Yields:
Each release, once.
- Raises:
NetworkError – CurseForge could not be reached.
- resolve(
- pack: Modpack,
Look up download details for a CurseForge pack.
A file whose author disallows third-party downloads stays unresolved and carries a
manual_url. A file CurseForge no longer lists also stays unresolved, with nomanual_url.- Parameters:
pack (Modpack) – The modpack.
- Returns:
The modpack with resolved entries.
- Raises:
NetworkError – CurseForge could not be reached.
- Return type: