BlueMapWrapper

bluemap logo BlueMapWrapper

Discord Link Buy Me a Coffee at ko-fi.com

An open-sourced API wrapper for BlueMap for Python!!

This wrapper is used for getting information from existing Blue Maps, NOT to create one.

Installation

Windows

pip install BlueMapWrapper

Linux

python -m pip install BlueMapWrapper

Quick Example

import asyncio
from BlueMapWrapper import AsyncClient, KEYS


async def main():
  # printing out all players and lands plugin markers

  # Setting up Async Client, AsyncClient Object
  client = AsyncClient(base_url='http://map.eldrath.com:20098')

  # Fetching player and marker Collection from map, Collection Object
  collection = await client.fetch_collection('world')

  for player in collection.player_collection:  # Iterate through all players
    print(f"Player: {player.name}\nPosition: {player.position}")

  # Getting MarkerCollection Object from Collection
  marker_collection = collection.marker_collection

  # Getting Marker for Lands Plugin   
  lands = marker_collection.from_key(KEYS.LANDS)

  for marker in lands:  # Iterate though markers in lands
    print(f"Name: {marker.label}\nPosition: {marker.position}")

  await client.close()  # Close client after use


if __name__ == '__main__':
  asyncio.run(main())

Documentation Contents