Python wrapper for the PaperMC Downloads API (https://papermc.io)
Using PyPI:
python3 -m pip install python-papermc
import papermc
with papermc.Paper() as paper:
version = paper.get_latest_version()
paper.download_build_to_file("paper-{}.jar".format(version), version, "latest")
-
Paper()
,Waterfall()
andTravertine()
provide the following functions:get_versions()
- Returns a
list
of available versions
- Returns a
get_latest_version()
- Returns the latest version
get_builds(version)
- Returns a
list
of builds forversion
- Returns a
get_latest_build(version)
- Returns the latest build for
version
- Returns the latest build for
download_build(version, build)
- Both
version
andbuild
can be set tolatest
- Returns the corresponding JAR file's
bytes
- Both
download_build_to_file(filepath, version, build)
- Same as above but writes the JAR file's bytes to
filepath
instead of returning them
- Same as above but writes the JAR file's bytes to
-
get_from_name(project_name)
- Returns the corresponding class from the project name (e.g.
paper
will return aPaper()
object) - Raises a
ProjectNotFoundError
if the project name is invalid
- Returns the corresponding class from the project name (e.g.