Mojang-API-Wrapper
Overview
- Pythonic wrapper making use of
awaitandasnyc - 100% Coverage of Mojang's API and Authentication API
Examples
Accessing a players skin
from MojangAPI import Client
import asyncio
async def main():
user = await Client.User.createUser('Minecraft playername')
profile = await user.getProfile()
print(profile.skin) # Will print the skins URL
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Changing a players skin
Note
Please note that Mojang's API may not trust your IP. To check if this is the case run the following code:
from MojangAPI import Client
import asyncio
async def main():
user = await Client.User.createUser('Minecraft playername')
await user.authenticate('Mojang Email', 'Mojang password')
await user.checkForSecurityQuestions()
# Will raise an error if untrusted
If your IP is untrusted you can complete security challenges to become trusted (I believe you only need to do this once). To get the security questions your Mojang account will need them active (refer to https://help.minecraft.net/hc/en-us/articles/360034686852-Resetting-Security-Questions). After which run questions = await user.getSecurityQuestions() to get the questions, and then await user.sendSecurityAnswers(answers) with the answers in the form refered to in the API's documentation (https://wiki.vg/Mojang_API#Send_back_the_answers).
from MojangAPI import Client
import asyncio
async def main():
user = await Client.User.createUser('Minecraft playername')
await user.authenticate('Mojang Email', 'Mojang password')
await user.changeSkin('Skin url', slim_model = True)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Getting sales data
from MojangAPI import DataService
import asyncio
async def main():
data = await DataService.Data.getStatistics(prepaid_card_redeemed_minecraft=True)
# Valid keyword arguments can be found at https://wiki.vg/Mojang_API#Payload_4
print(data)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Metadata
Release files for MojangAPI 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| MojangAPI-0.0.5.tar.gz | 5.8 kB | Without provenance | Details for MojangAPI-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| MojangAPI-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for MojangAPI-0.0.5-py3-none-any.whl |
Total release size: 12.8 kB
Release files / MojangAPI-0.0.5.tar.gz
| Download URL | MojangAPI-0.0.5.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6eaa1e40425523ee81be67ea54db0e7d0e765fb795828639398562b34dd27257
|
|
BLAKE2b-256 checksum How to use checksums |
b34a2d2c51e89317e359433c0eb13b5b683968f1d58ec7fff565b949d94bc033
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
|
Release files / MojangAPI-0.0.5-py3-none-any.whl
| Download URL | MojangAPI-0.0.5-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e027977373d254045a1e40c0157449a9a0fb3593cc78db42995bc3d7b92bba4e
|
|
BLAKE2b-256 checksum How to use checksums |
d63f77585954279d07fbdfb0907afc29205bb1254edd47dee3136e69bf55fdc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2
|
Security for MojangAPI 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.