Skip to content

Hades1232/mojang_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mojang_python

Maybe Easy Mojang API Python Wrapper.

(Korean is here)

How to install

pip install mojang_python 

Example

# import class in module

from mojang_python.info import UserInfo
from mojang_python.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

About

Easy Mojang Api Wrapper

Resources

License

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages