๐Ÿ 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:#

  1. Install package from pypi. (In development so no PyPi package yet, install via GitHub instead.):

    #Windows/Linux
    
    pip install novauniverse
    
  2. 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.

Configuration Reference#

class novauniverse.configuration.Config[source]#

Bases: object

NovaUniverse.py config.

property performance_mode: bool#

When enabled some unnecessary features are disabled in favour for performance.

WARNING: This will make the api wrapper less stable and friendly. So watch out it may bite ๐Ÿ˜ณ๐Ÿป.

Errors Reference#

exception novauniverse.errors.NovaError(message: str, logger: Logger = None)[source]#

Bases: DevGoldyUtilsError

The base class of all NovaUniverse.py errors.

Indices and tables#