Metadata-Version: 2.1
Name: yggdrasil-mc
Version: 0.1b4
Summary: A simple Python lib to get player info and texture from Mojang and Yggdrasil APIs.
Project-URL: Homepage, https://github.com/jinzhijie/yggdrasil-mc
Project-URL: Bug Tracker, https://github.com/jinzhijie/yggdrasil-mc/issues
Author-email: Xiao_Jin <i@xiaojin233.cn>
License-File: LICENSE
Keywords: api,blessing skin,minecraft,mojang,yggdrasil
Classifier: Development Status :: 4 - Beta
Classifier: Natural Language :: Chinese (Simplified)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: httpx
Requires-Dist: pydantic
Description-Content-Type: text/markdown

# yggdrasil-mc

![GitHub Repo stars](https://img.shields.io/github/stars/jinzhijie/yggdrasil-mc?style=social) ![PyPI](https://img.shields.io/pypi/v/yggdrasil-mc?style=flat-square) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/yggdrasil-mc?style=flat-square) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/jinzhijie/yggdrasil-mc/main?style=flat-square) ![GitHub](https://img.shields.io/github/license/jinzhijie/yggdrasil-mc?style=flat-square)

A simple Python lib to get player info and texture from Mojang and Yggdrasil APIs.

一个简单的 Python 库，可从 Mojang 和 Yggdrasil APIs 获取玩家的信息和材质。

## Attention

This package can run in **Python 3.10+ ONLY**.

## Usage

1. Download the package from PyPI

    ```bash
    pip3 install -U yggdrasil-mc
    ```

2. ```python
    from yggdrasil_mc import YggPlayerUuid, YggPlayerProfile

    player_name = "w84"
    player = YggPlayerUuid().getMojang(player_name)
    if player.existed:
        print(YggPlayerProfile().getMojang(player.id))
    ```

After you run these snippet, you will get the following output:

```plain
id='ca244462f8e5494791ec98f0ccf505ac' name='w84' properties=Properties(...
```

Note that this package also provide the asyncio version which is powered by aiohttp:

```python
from yggdrasil_mc import YggPlayerUuid, YggPlayerProfile

player_name = "w84"
player = await YggPlayerUuid().getMojangAsync(player_name)
if player.existed:
    print(await YggPlayerProfile().getMojangAsync(player.id))
```
