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.

It aims to make the process of writing scripts that deal with the Hypixel API easier to prevent frustration due to the complexity and inapplicability of the API in its current state.

  • Fast AF (for python) — Fast and lightweight by using built in libraries to achieve async timed lru caching, fast nested dataclass json sterilization, modern sane rate limit handling, etc.

  • 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 coverage and documentation.

Getting Started

Check out the examples and documentation!

Python 3.8+ is required (3.10.8+ recommended)

Installation

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

pip install hypixel.py --upgrade

You can also append [speed] to install optional packages (see below) to enhance aiohttp and json performance automatically. 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 python version 3.8 or higher on Windows, then you must add the following code before you start an event loop (asyncio.run):

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 here

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.3.0.tar.gz (33.8 kB view hashes)

Uploaded Source

Built Distribution

hypixel.py-0.3.0-py3-none-any.whl (44.4 kB view hashes)

Uploaded Python 3

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