A Python wrapper for the Mojang API and Minecraft website
Project description
About
Mojang
is a Python package for accessing Mojang's services. It serves as a simple wrapper around Mojang's API
and can be used to get name drop dates, convert UUIDs, and much more. It does not, however, currently support authentication or login features.
Installation
Python 3.6 or higher is required.
To install the library, you can just run the following console command:
python -m pip install mojang
Quickstart
import time
from mojang import MojangAPI
uuid = MojangAPI.get_uuid("Notch")
if not uuid:
print("Notch does not exist.")
else:
print("Notch's UUID is", uuid)
profile = MojangAPI.get_profile(uuid)
print("Notch's skin URL is", profile.skin_url)
servers = MojangAPI.get_blocked_servers()
print(f"There are {len(servers)} blocked servers on Minecraft.")
drop_timestamp = MojangAPI.get_drop_timestamp("Notch")
if not drop_timestamp:
print("Notch is not dropping")
else:
seconds = drop_timestamp - time.time()
print(f"Notch drops in {seconds} seconds")
To see a complete list of methods, read the documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mojang-0.1.9.tar.gz
(7.9 kB
view hashes)
Built Distribution
mojang-0.1.9-py3-none-any.whl
(9.5 kB
view hashes)