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.0.0.tar.gz (2.7 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.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for squaremapapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 494f2d92968a4ef249eff27bb139809967d7449f2545bd38e6a4ed0128ce27c4
MD5 694502f066f03bf63207eebde119902f
BLAKE2b-256 0ec32fb54c5a9e64e0f49901f12d7b534e6963f3d9b086f774f47edeab84b319

See more details on using hashes here.

File details

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

File metadata

  • Download URL: squaremapapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f06c7af6e9aa71aefaf927f480c3c29b98b87dcd9295a77f189f3f090fbd26a9
MD5 0552135e95af795095cee9413d1f5022
BLAKE2b-256 2b2d3e5e7c92f53fefa0533ff2c8ebc2e60a4fe8acaabf97a1c7b36b8ab0e746

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