Skip to main content

Easy Mojang API Wrapper

Project description

Mojang_python

Maybe Easy Mojang API Python Wrapper.

(Korean is here)

How to install

git clone https://github.com/Hades1232/mojang_python.git
pip install mojang_python 

Example

# import class in module

from mojang_python.src.info import UserInfo
from mojang_python.src.optifine import Cape

async def example():
   
   # Get uuid from username
   uuid = await UserInfo.get_uuid("Dangk_")
   print(f"UUID : {uuid}")

   
   # Get Profile
   class_name = UserInfo(uuid)
   profile = await class_name.get_account_profile()
   print(f'Profile URL : {profile["textures"]["SKIN"]["url"]}')


   
   # Get Cape (with get_account_profile)
   optifine_cape = await Cape.get_optifine_cape("Dangk_")
   

   if "CAPE" in profile["textures"]:
      cape = profile["textures"]["CAPE"]["url"]
      if optifine_cape != None:
         print(f"Cape URL : {cape} (Minecraft) / Cape URL : {optifine_cape} (Optifine)\n")
      else:
           print(f"Cape URL : {cape} (Minecraft)\n")

   elif optifine_cape != None:
      print(f"Cape URL : {optifine_cape} (Optifine) \n")

   else:
     print("Cape URL : None\n")


# Run with coroutine
import asyncio

asyncio.run(example())

if you want more information, check this

Result

image

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

mojang_python-1.2.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

mojang_python-1.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mojang_python-1.2.0.tar.gz.

File metadata

  • Download URL: mojang_python-1.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for mojang_python-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e7ec7a6a5bf04c6a64439eaafef535417fb6d9443237cacd1964342b4a67f1fd
MD5 a49dce72a8ac66a084ffb2f76acab50a
BLAKE2b-256 77d85f3edd35f1e2f7c2933a1fa2f70e8602e3ff17721a24808753b296cf8d3f

See more details on using hashes here.

File details

Details for the file mojang_python-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: mojang_python-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0

File hashes

Hashes for mojang_python-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60145baa5d7f69b3c7031d3373d4564a23f937495ca56938047753abc89655b1
MD5 5c2140dd6abf1a4fef1f51e50ac354c5
BLAKE2b-256 bf651ba58986973ed72b574d860d621db97b254837b3e8316557c182a75584b0

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