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.1.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.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: squaremapapi-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 e583ec07c573068b6143e60931486b8d28e46099ad9cd1a238e780234b380526
MD5 81ffa149361e0e2b73848d0e48dc52a7
BLAKE2b-256 8cf899f624ef76fb7bde2e56123356b7b117e948d6c65a478876d6b8bf984a13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: squaremapapi-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d5472b070a443dac125d00c959d686165b98666e103f9cf2e64b37142e46c68
MD5 5c89079fad6889ad68578727427a7f5d
BLAKE2b-256 802f48d0dc0a31e636a683c850d3cbf7f7b882d60d87381508f69d3f46d4ea3e

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