Skip to main content

An async Python wrapper for the Mojang API.

Project description

Async-Mojang is a Python package for accessing Mojang's services. This library can be used to convert UUIDs, get a profile's information, change your Minecraft username or skin, and much more.

There is one component to this package:

  • Public API - Used to parse information about Minecraft profiles and more. Authentication is not required.

Installation

Python 3.7 or higher is required.

The easiest way to install the library is using pip. Just run the following console command:

pip install async-mojang

Public API Quickstart

import asyncio
from async_mojang import API

async def get_uuid(username: str):
    async with API() as api:
        uuid = await api.get_uuid(username)
        return uuid

async def get_stripped_uuid(username: str):
    async with API() as api:
        stripped_uuid = await api.get_stripped_uuid(username)
        return stripped_uuid

async def get_username(uuid: str):
    async with API() as api:
        username = await api.get_username(uuid)
        return username

async def get_profile(uuid: str):
    async with API() as api:
        profile = await api.get_profile(uuid)
        return profile

async def get_blocked_servers():
    async with API() as api:
        blocked_servers = await api.get_blocked_servers()
        return blocked_servers

async def main():
    uuid = await get_uuid("FroostySnoowman")
    print(uuid)

    stripped_uuid = await get_stripped_uuid("FroostySnoowman")
    print(stripped_uuid)

    username = await get_username(uuid)
    print(username)

    profile = await get_profile(uuid)
    print(profile)

    blocked_servers = await get_blocked_servers()
    print(blocked_servers)

if __name__ == "__main__":
    asyncio.run(main())

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

async_mojang-1.0.5.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

async_mojang-1.0.5-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file async_mojang-1.0.5.tar.gz.

File metadata

  • Download URL: async_mojang-1.0.5.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for async_mojang-1.0.5.tar.gz
Algorithm Hash digest
SHA256 ae518fb57a48111b2731570658d5ddb8bc40c456ba2c4f89c228a0ec781d42c0
MD5 83ae4d6bfb276e38bc202006926382f3
BLAKE2b-256 2aaa102f01c11c7fa78871675a871d438c36ec5c223a134e50ddc5c256c88fe2

See more details on using hashes here.

File details

Details for the file async_mojang-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: async_mojang-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for async_mojang-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7c3f97f856fc91cf6fed6f022c6bd68329b65e747b69dc9d374dc9991b7748dd
MD5 57ce6547d4883e6a808ec5f5d0a3c703
BLAKE2b-256 c2be2050aaa6c7819195f7caffc8fd2a4451398af7abf270f2d6ee0a506ecc38

See more details on using hashes here.

Supported by

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