A comprehensive Python wrapper around OpenWeatherMap web APIs providing weather data, forecasts, air pollution, UV index, and agricultural information
—
Weather map tiles for visualization including precipitation, wind, temperature, and pressure layers. Enables integration of weather overlays into mapping applications.
class TileManager:
def __init__(self, API_key: str, layer_name: str, config: dict): ...
def get_tile(self, x: int, y: int, zoom: int) -> Tile:
"""
Retrieve weather map tile.
Parameters:
- x: Tile X coordinate in OWM reference system
- y: Tile Y coordinate in OWM reference system
- zoom: Zoom level for the tile
Returns:
Tile object with image data
"""
@property
def map_layer(self) -> str:
"""The map layer type for tiles"""
@property
def API_key(self) -> str:
"""The API key"""from pyowm import OWM
from pyowm.tiles.enums import MapLayerEnum
owm = OWM('your-api-key')
# Get precipitation tile manager
precip_mgr = owm.tile_manager(MapLayerEnum.PRECIPITATION)
tile = precip_mgr.get_tile(x=1, y=1, zoom=1)
# Get wind tile manager
wind_mgr = owm.tile_manager(MapLayerEnum.WIND)
wind_tile = wind_mgr.get_tile(x=2, y=2, zoom=2)class MapLayerEnum:
PRECIPITATION = "precipitation"
WIND = "wind"
TEMPERATURE = "temperature"
PRESSURE = "pressure"class Tile:
def __init__(self, x: int, y: int, zoom: int, layer_name: str, image_data, last_update_time: int): ...
@property
def x(self) -> int: ...
@property
def y(self) -> int: ...
@property
def zoom(self) -> int: ...
@property
def layer_name(self) -> str: ...
@property
def image_data(self): # Image data
"""Image data"""
@property
def last_update_time(self) -> int: ...Install with Tessl CLI
npx tessl i tessl/pypi-pyowm