Skip to main content

Provides data on people, places and more on the EarthMC Minecraft server.

Project description

EarthMC-PY

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.

Install

$ pip install EarthMC

Initialize Map(s)

from EarthMC import Maps

Aurora = Maps.Aurora()
Nova = Maps.Nova()

Usage Example

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())

Methods

Players

Base Reference

ap = Aurora.Players
print(ap.all()) # => Outputs all players. (Townless and Residents)

All (List)

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. 

Get (Object)

op = ap.online.get('PlayerName')
tp = ap.townless.get('PlayerName')
res = ap.residents.get('ResidentName') 

Official API

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') 

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

EarthMC-3.5.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

EarthMC-3.5.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file EarthMC-3.5.0.tar.gz.

File metadata

  • Download URL: EarthMC-3.5.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for EarthMC-3.5.0.tar.gz
Algorithm Hash digest
SHA256 91d0f18dc860187173a6e2e298cd21a7f9f49ce9aa80ae31ffe625da6e98ca65
MD5 4e8d6bd9bd0f6aa2fff2c54db55fef7f
BLAKE2b-256 5e10aef036dbc304086411a28cdfb5f71a7fa6df9f94b1611e3e1c7c9f32ebc9

See more details on using hashes here.

File details

Details for the file EarthMC-3.5.0-py3-none-any.whl.

File metadata

  • Download URL: EarthMC-3.5.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for EarthMC-3.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba3d1a92f992d91b1387059fe217e1a6c4cef6935b33f17ae18e0f729d340c2e
MD5 ad0a10802a714c34559e3fa174f7d6b3
BLAKE2b-256 569b4a107b02ab38b6eef4be64d09dba1277657b2668464ae09eea9e1a07670b

See more details on using hashes here.

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