๐ novauniverse.py#
A modern & maintained wrapper for the Nova Universe API written in Python.
What is NovaUniverse.py?#
NovaUniverse.py is a API wrapper for โNova Universeโ (minecraft event hosting group) that allows you to interface with the Nova Universe API in a fast object oriented way natively within Python. One of the bonuses is that it was developed by ME, an admin at NovaUniverse.
โ Install/Set Up:#
Install package from pypi. (In development so no PyPi package yet, install via GitHub instead.):
#Windows/Linux pip install novauniverse
Thatโs It! - Brief Example Below:
from novauniverse import EventClient, Events, NovaOnlinePlayer client = EventClient() @client.on_event(Events.CLIENT_READY) def client_is_ready(): print("Client is ready!") @client.on_event(Events.PLAYER_JOIN) def on_player_join(player: NovaOnlinePlayer): print(f"{player.username} joined {player.server_name}!") client.start()
Examples:#
Some quick short examples to get started with NovaUniverse.py. ๐ After you have a read here please do check out
This is what we call interfaces. Interfaces are used toโฆ wellโฆ interface! ha ha, yesโฆ they are how you interface with the Nova Universe API.
Getting tournament results:
from novauniverse import NovaGames, MCF # Get the latest Nova Games tournament. nova_games = NovaGames().get_latest() # Prints out how much each player scored in that tournament and also how many kills they achieved. for player in nova_games.players: print(f"'{player.username}' got {player.kills} kill(s) and scored {player.score} point(s) in the Nova Games hosted on {nova_games.date.date()}.")Neat right ๐.
Note
Learn more about interfaces over here.
Searching for a specific mcf tournament:
from novauniverse import MCF, Search mcf = MCF().search(Search(id=17)) for player in mcf.players: print(f"'{player.username}' got {player.kills} kill(s) and scored {player.score} point(s) in the MCF hosted on {mcf.date.date()}.")Note
More at search interfaces.