Skip to main content

A simple python library that allows interfacing with squaremap

Project description

squaremap-api

A simple python library that allows interfacing with squaremap.

Examples

Tiles API

import squaremapapi

squaremapinstance = squaremapapi.SquareMapInstance("https://map.earthmc.net/")
world = squaremapinstance.tiles.getworld("minecraft_overworld")
zoomlevel = world.getzoomlevel(0)

tile = zoomlevel.gettile(0, 0)
open("output.png", "wb").write(tile)

This script outputs a image of the tile 0_0.png at zoom level 0 on the earthmc map.

Player Tracking

import squaremapapi

squaremapinstance = squaremapapi.SquareMapInstance("https://map.earthmc.net/")
coordinates = squaremapinstance.players.findplayer("cautionarytale08")

print(coordinates)

This script outputs the coordinates of the player cautionarytale08. If the player is not online or is not visible on the map the findplayer() function will output None. If the player is visible on the map then it returns a dictionary with uuid, name, coordinates and yaw. Here is an example function output: {'world': 'minecraft_overworld', 'name': 'cautionarytale08', 'x': 50961, 'y': 69, 'z': 11272, 'display_name': 'cautionarytale08', 'uuid': '36b4f689cac04a11a52b9c4da432e3bc', 'yaw': -160}

Source code

This source code for this library is available on github at: https://github.com/cautionarytale09/squaremap-api.

PyPi package

This project is hosted on PyPi and can be installed with pip install squaremapapi. https://pypi.org/project/squaremapapi/

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

squaremapapi-1.1.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

squaremapapi-1.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file squaremapapi-1.1.1.tar.gz.

File metadata

  • Download URL: squaremapapi-1.1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for squaremapapi-1.1.1.tar.gz
Algorithm Hash digest
SHA256 4d9e7e586dee54292375c32cb4fe3e54ef94ec2d281f11250428f4fed8b3e494
MD5 672bef2a6d4a9aa8625c98f04b71fe37
BLAKE2b-256 65a02096ba416503c3ecc7f99f674ea5264fd66b4780c698d1bf465ace92bef6

See more details on using hashes here.

File details

Details for the file squaremapapi-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: squaremapapi-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for squaremapapi-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4d2881c3c4998f9cad32992f161bca1f71ca6ae3be683369f2e8a7bfe9a8053
MD5 658d92a8b2ad2ad21f131a32d1228315
BLAKE2b-256 8d84ff7f2068e55b3ff90b0d2c4a04a738d89805436251137bc09942d46e8c59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page