An unofficial Python package for interacting with both the Official
and Dynmap EarthMC APIs.
This package is part of the EarthMC Toolkit and provides
extensive info on people, places and more.
$ pip install EarthMC
from EarthMC import Maps
Aurora = Maps.Aurora()
Nova = Maps.Nova()
from EarthMC import Maps, OfficialAPI
Aurora = Maps.Aurora()
ops = Aurora.Players.all()
def format(res):
return res.name + ": " + str(round(res.balance))
def onlineBalTop():
residents = []
for op in ops:
res = OfficialAPI.player(op['name'])
residents.append(res)
return list(map(format, sorted(residents, key=lambda r: r.balance, reverse=True)))
print(onlineBalTop())
Players
ap = Aurora.Players
print(ap.all()) # => Outputs all players. (Townless and Residents)
online = ap.online.all() # => Outputs list of online players.
townless = ap.townless.all() # => Outputs list of townless players. (Online without a town)
residents = ap.residents.all() # => Outputs list of residents.
op = ap.online.get('PlayerName')
tp = ap.townless.get('PlayerName')
res = ap.residents.get('ResidentName')
Similarly to the EarthMC NPM library,
it is possible to send calls to EarthMC's Official API.
This includes Towny data like balances, timestamps, perms, ranks and more.
from EarthMC import OfficialAPI
town = OfficialAPI.town('venice')
nation = OfficialAPI.nation('venice')
player = OfficialAPI.player('fix')