Skip to main content

A Python wrapper for the Hypixel API

Project description

PyPI downloads PyPI version info License Documentation Status

Hypixel.py is a modern, asynchronous, feature-rich, Hypixel API wrapper for Python.

The purpose of this project is to simplify the task of writing scripts that interact with the Hypixel API by converting responses into organized python models and abstracting requests into asynchronous functions, while also offering customization options and useful features.

  • Blazing fast (for python) — Prioritizes speed and efficiency by using built in libraries to achieve asynchronous timed caching, quick nested dataclass sterilization, and modern rate limit handling.

  • More asynchronous than online learning — Has full asynchronicity and uses modern pythonic async and await syntax.

  • Cleaner than your room — Uses object oriented pythonic dot syntax for all of its models, so you can easily access any data point without worrying about dictionaries, strings, and any random inconsistencies you may encounter using the raw API.

  • S Tier Docs — Highly maintained documentation with an ample amount of examples to get you started. It also has the highest player model and coverage documentation.

Getting Started

Check out the examples and documentation!

Python 3.8+ is required (3.10.8+ recommended)

Installation

To install hypixel.py, install it from pypi under the name hypixel.py with pip or your favorite package manager.

pip install hypixel.py --upgrade

You can append [speed] to install optional packages (see below) to improve the performance of aiohttp and json. Warning: cchardet does not support python 3.10+ and subsequently will not be installed using [speed] if you’re on 3.10 or higher.

pip install hypixel.py[speed] --upgrade

Optional Packages

To ehnahce aiohttp performance:

To enhance json decoding (up to 4x faster):

Warning

If you are running a Python version older than 3.10.8 on Windows, you must run the following code before calling asyncio.run:

# This is because of a bug in the Windows Proactor Event Loop Policy
# which is the default on Windows.
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

Quick Example

import hypixel
from hypixel import HypixelException
import asyncio

async def main():
    client = hypixel.Client('api-key')
    async with client:
        try:
            player = await client.player('gamerboy80')
            print(f'[{player.bedwars.level}✫] [{player.rank}] {player.name}')
        except HypixelException as error:
            print(error)

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

You can find more examples in the documentation

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

hypixel.py-0.4.2.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

hypixel.py-0.4.2-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file hypixel.py-0.4.2.tar.gz.

File metadata

  • Download URL: hypixel.py-0.4.2.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for hypixel.py-0.4.2.tar.gz
Algorithm Hash digest
SHA256 4c13f98c3fbe82b87c2a4f214a752bea8cf73191b09a706ba8f68a2daca49146
MD5 7ba8d0aad8d5cd846299a6673e31fb30
BLAKE2b-256 3eb2560b1ccc5c8324e78d610aeb54685f1501a4c14f473f741c3db194dc0a02

See more details on using hashes here.

File details

Details for the file hypixel.py-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: hypixel.py-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for hypixel.py-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8803d381d5b19fc2faf8c93e59c1370681a4dc8673ceedd82023fe891398eb61
MD5 8bf47536716b4e10661a8f8077cca5a4
BLAKE2b-256 a59b574d0960d32218fe0294afe66e8cf9fcab2816257df40d7dfa6920d3889a

See more details on using hashes here.

Supported by

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