maps

from instahashtag import Maps

Python wrapper for the Maps API call.

class Maps
__init__(self, x1: float, y1: float, x2: float, y2: float, zoom: int, aio: bool = False) → None

Initializes a new map object.

from instahashtag import Maps

# Coordinates designate to Miami, FL.
maps = Maps(
    x1=-80.48712034709753,
    y1=25.750749758162012,
    x2=-79.82794065959753,
    y2=25.854604964203453,
    zoom=12
)
x1

Top left x-coordinate corner of the map.

maps.x1 # >>> -80.48712034709753
y1

Top left y-coordinate corner of the map.

maps.y1 # >>> 25.750749758162012
x2

Bottom right x-coordinate corner of the map.

maps.x2 # >>> -79.82794065959753
y2

Bottom right y-coordinate corner of the map.

maps.y2 # >>> 25.854604964203453
zoom

Number from 2 to 16 that designates the zoom factor.

maps.zoom # >>> 12
count

Number of hashtags in the resulting query.

maps.count # >>> 91
tags

List of hashtags.

maps.tags # >>> [MapTag(tag=..., centroid=[..., ...], weight=...), ...]
tag = maps.tags[0]
class MapsTag(centroid: List[float], tag: str, weight: int)

Object that represents the individiual items inside the Maps.tags list.

centroid

List of floats that contains the location of the tag in the map (lon, lat).

tag.centroid # >>> [25.801775593361942, -80.20252247848369]
tag

Hashtag name.

tag.tag # >>> igersmiami
weight

Weight of the hashtag on the map.

tag.weight # >>> 49
__gt__(self, other: Result) → bool

Allows comparisson of MapsTags objects by their weight.

Note

This function allows the user to utilize the Python built-in functions.

from instahashtag import Maps

# Coordinates designate to Miami, FL.
maps = Maps(
    x1=-80.48712034709753,
    y1=25.750749758162012,
    x2=-79.82794065959753,
    y2=25.854604964203453,
    zoom=12
)

min(maps.tags)
max(maps.tags)
sort(maps.tags)
async call(self) → None

Asynchronously queries the API.

See note on the top of the wrapper documentation.