Skip to main content

minecraftstats

Downloads Downloads/Month PyPI Version Last Commit Repository Size License MIT Discord Profile

Minecraftstats is an API wrapper for the Minecraft server Hypixel. The library only currently allows the user to get duel and bedwars stats.

installation

using pip

pip install minecraftstats

using setup.py to install

git clone https://github.com/justbennnn/minecraftstats.git
cd minecraftstats
python setup.py install

usage

Important: An API key can be obtained by logging onto the Hypixel server, and typing /api new.
Note: The main framework for this project is Pydantic.
Side Note: Any stats that return hearts are measured in halves.

general

This example shows how to access general data from the Hypixel lobby.

import minecraftstats as ms

ms.set_username("username") #the username for the account that you want to get the stats from
ms.set_api_key("your_api_key")

stats = ms.get_user_stats()

print(list(stats.general.__fields__.keys())) #show all available attributes for general stats

first_login = stats.general.first_login #returns a datetime object
print("First login (day/month/year):", str(first_login.day) + "/" + str(first_login.month) + "/" + str(first_login.year))
print("Achievements:", stats.general.achievement_points)
print("Hypixel level:", stats.general.level)

The next set of examples will show how to get stats from different game modes.

duels

import minecraftstats as ms

ms.set_username("username") #the username for the account that you want to get the stats from
ms.set_api_key("your_api_key")

stats = ms.get_user_stats()

print(list(stats.overall_duels.__fields__.keys())) #show all available functions for overall_duels

print("Total wins:", stats.overall_duels.wins)
print("Total kills:", stats.overall_duels.kills)
print("Most recent game mode played:", stats.overall_duels.recent_games[0])

The best way to retrieve stats is by creating a variable which uses ms.get_user_stats() to get the Hypixel user's data, and then accessing different stats as attributes to the variable.

The next examples show how those attributes can be accessed.

print(list(stats.uhc_duels.__fields__.keys())) #show all available stats for uhc_duels

print("UHC wins:", stats.uhc_duels.wins)
print("Best UHC winstreak:", stats.uhc_duels.best_winstreak)
print("UHC golden apples eaten", stats.uhc_duels.golden_apples_eaten)

bedwars

print(list(stats.overall_bedwars.__fields__.keys())) #show all available functions for overall_bedwars

print("Total wins:", stats.overall_bedwars.wins)
print("Total kills:", stats.overall_bedwars.kills)
print("Total beds broken:", stats.overall_bedwars.beds_broken)

As shown above, all of the key concepts are the same as the duels stats example.

bedwars practice mode

print(list(stats.practice_bedwars.__fields__.keys())) #show all available functions for practice_bedwars

print("Bridging record:", stats.practice_bedwars.records.bridging_record)
print("Bridging blocks placed:", stats.practice_bedwars.bridging.blocks_placed)
print("Successful MLG attempts:",stats.practice_bedwars.mlg.successful_attempts)

skywars

print(list(stats.overall_skywars.__fields__.keys()))

print("Wins:", stats.overall_skywars.wins)
print("Games played:", stats.overall_skywars.games_played)
print("Coins:", stats.overall_skywars.coins)

CHANGELOG

1.1.6

  • Capture The Flag Trios Duels stats added.

1.1.5

  • Skywars stats updates:

    • Created a Solo Skywars stats class.
    • Added a Skywars level stat.
  • Added more stats to the General stats file.

  • Created more efficient models.

  • Added the following Bedwars stats classes:

    • Solo
    • Duos
    • Trios
    • Squads
    • Four Versus Four
  • Added the following Duels stats classes:

    • OP Doubles
    • UHC Meetup(Deathmatch)

1.1.4

  • The API link now uses the user's uuid instead of player name.

  • Created a General Hypixel stats file.

  • Removed unnecessary imports from __init__.py.

  • Updated annotations on several files.

  • Added mojang library to requirements.txt.

1.1.3

  • Fixed Practice stats bug.

1.1.2

  • Added UHC and Bridge double stats.

1.1.1

  • Added Bedwars cosmetic stats.

1.1.0

  • Added Bedwars practice stats.
  • Small changes to utils.py.

1.0.9

  • Added StatsModel class to utils.py.

1.0.8

  • The user no longer has to create an instance of the class model.
  • Fixed bridge_duel suffix typo.

1.0.7

  • Fixed kwarg filter error.

1.0.6

  • Created stats model and kwarg filter(for prefixes/suffixes).
  • Created requirements.txt.

1.0.5

  • Created CHANGELOG.
  • Added SkyWars duel stats.

1.0.4

  • Changed mainframe to Pydantic.
  • Removed the available_functions variables.

Metadata

Release files for minecraftstats 1.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for minecraftstats 1.1.6
File Size Uploaded
minecraftstats-1.1.6.tar.gz 12.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for minecraftstats 1.1.6
File Interpreter ABI Platform
minecraftstats-1.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / minecraftstats-1.1.6.tar.gz

Download URL minecraftstats-1.1.6.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
11ab78f44239805ad81397a93d530223a73a3cd380e6bb94ff7ea1c96b895f58
BLAKE2b-256 checksum
How to use checksums
f0f629733d5f37eb38a9920295492f018b13dadd5bda9072c8177ac33a83aa40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release files / minecraftstats-1.1.6-py3-none-any.whl

Download URL minecraftstats-1.1.6-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9845ecb677b0db6426abfc3a3367f2f52d13219e33a7d9d026d9af0c7a9a7619
BLAKE2b-256 checksum
How to use checksums
039e6ac8b700366b8188e4dd256e371d4ab0b86bdfad2b4774e2ea72e6f4f8de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.1.6 This release

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page