User Documentation

This section of this wrapper focuses on player names, uuids and name history. This section has 2 classes, Users and Players.

Basic Example:

import aiomojang
import asyncio


async def get_user_history():
 user = aiomojang.Player("Example")  # You can get a users information by passing it into the class.
 # you can get a user's uuid using: aiomojang.Player("Name").uuid
 # you can get a user's name using: aiomojang.Player("Name").name
 # However, you CANNOT run .uuid with a uuid and CANNOT run .name with a name.
 return await user.get_history()  # you can get the user's name history with get_history()


asyncio.run(get_user_history())  # Running the function

Player

This focuses on individual players, and will take only one name.

class aiomojang.api.Player(profiles: str, at: Optional[int] = 0)

Gets information on a user’s profile.

profile

The user’s profile you want to search up, eg. User(“SomeRandomPerson”)

Type

str

at

The person who had the name at the given timestamp. Defaults to 0

Type

int

async get_cape(unsigned: Optional[bool] = False)

Get’s the current cape that the player has on. .. attribute:: unsigned

Defaults to True, the mod in which to access the information in.

Returns

The link to their cape.

Return type

str

async get_history(num: Optional[int] = None)dict

Gets the name history for the user. :returns: Returns the name history for the given user at the given timestamp. :rtype: dict

async get_raw_data(unsigned: bool = True)

Returns raw json for a skin or a cape .. attribute:: unsigned

Defaults to True, the mod in which to access the information in.

Returns

The raw data.

Return type

dict

async get_skin(unsigned: Optional[bool] = False)

Get’s the current skin that the player has on. .. attribute:: unsigned

Defaults to True, the mod in which to access the information in.

Returns

The link to their skin.

Return type

str

property is_demo

Returns if the account is a demo account (unpaid). :returns: Returns True if the account is a demo account (unpaid). :rtype: bool

property is_legacy

Returns if the account is legacy. :returns: Returns True if the account is legacy. :rtype: bool

property name

Gets the name for the user. :returns: Returns the name of the user. :rtype: str

Raises

BadRequestError – If no user with these parameters can be found.

async signature(unsigned: Optional[bool] = False)

Returns the requester’s base64 signature.

Will only work if unsigned is False. :returns: The base64 signature. :rtype: str

async timestamp(unsigned: Optional[bool] = False)

Returns the formatted timestamp in which the data has been requested at. :returns: The formatted timestamp. :rtype: str

property uuid

Gets the uuid for the user. :returns: Returns the uuid of the user. :rtype: str

Raises

BadRequestError – If no user with these parameters can be found.

Users

This class focuses on getting information on multiple users. As such, it can take multiple users in the constructor and returns a list of the requested information.

class aiomojang.api.Players

Gets information on a list of users.

async get_names(*queries)list

Returns a list of names obtained using Mojang’s API. :returns: The names obtained. :rtype: list

async get_uuids(*queries)list

Returns a list of uuids obtained using Mojang’s API. :returns: The uuids obtained. :rtype: list