Metadata-Version: 2.4
Name: squaremapapi
Version: 1.1.1
Summary: A simple python library that allows interfacing with squaremap
Author: cautionarytale08
Author-email: cautionarytale08@outlook.com
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 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](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/](https://pypi.org/project/squaremapapi/)
