Skip to content

Open Source Python library for interfacing with the Scenic Weather API

License

Notifications You must be signed in to change notification settings

ScenicWeather/pyScenicWeather

Repository files navigation

pyScenicWeather

Open Source client wrapper in Python for interfacing with the Scenic Weather data REST API

PyPi version: 0.0.2 Python Versions: 3.7|3.8|3.9 Windows Build Status Linux Build Status MIT License Coverage Status Average time to resolve an issue Percentage of issues still open

Getting started

Installation

Python 3.7 or higher is required.

pyScenicWeather is available on Pypi and can be installed with pip:

# Linux

pip install pyScenicWeather
# Windows

$ pip install pyScenicWeather

Quick Example

With a free Scenic Weather API Key:

from scenic import Scenic

current_weather = None
with Scenic('your-API-key') as weatherBy: # You MUST provide a valid API key
    # Search for current weather in Toronto (Canada)
    # Defaults to current weather measurement
    current_weather = weatherBy.city(city='Toronto', country='CA')  

    if current_weather is not None:
        print(current_weather)

        # Weather details
        print(f"Temperature: {current_weather.temperature}")
        print(f"Humidity: {current_weather.humidity}")
        print(f"Wind Speed: {current_weather.wind.speed}")
        print(f"Wind Direction: {current_weather.wind.direction}")

        print(current_weather.__readings__)

        # Get the current weather at lat=43.65N, lon=79.38W (Toronto, Canada)
        observation = weatherBy.lat_lon(latitude=43.65, longitude=-79.38, metric_units=False).forecast(plus_hour=1)
        print(observation)

You can find more examples in our examples directory.

API key

As Scenic Weather APIs require a valid API key to allow responses, pyScenicWeather will not work without one. You can get a free API key on the Scenic website Do note that free API subscription plans are subject to requests throttling.

Documentation

The library software API documentation is available on Read the Docs.

Learn More

License

Licensed under the MIT License.

Releases

No releases published

Packages

No packages published

Languages