FFXIV weather forecast library for Python applications.
Project description
ffxivweather-py
FFXIV weather forecast library for Python applications.
Credit to Garland Tools for weather data, and XIVAPI and FFCafe for game data.
Installation
pip install ffxivweather
Documentation
This package only exposes two methods:
def get_forecast(place_name: str=None,
terri_type_id: int=None,
terri_type: str=None,
count: int=1,
second_increment: float=WEATHER_PERIOD,
initial_offset: float=0 * MINUTES,
lang: LangKind=LangKind.EN) -> list:
"""Returns the next count forecast entries for the provided territory, at a
separation defined by second_increment and from the provided initial offset in seconds.
Forecast entries are tuples in which the first item is the weather, and the second item
is the start time of that weather."""
def get_current_weather(place_name: str=None,
terri_type_id: int=None,
terri_type: str=None,
initial_offset: float=0 * MINUTES,
lang: LangKind=LangKind.EN):
"""Returns the current weather and its start time, relative to the provided
offset in seconds, for the specified territory type."""
Example
Code:
import datetime
import ffxivweather
zone = "Eureka Pyros"
forecast = ffxivweather.forecaster.get_forecast(place_name=zone, count=15)
print("Weather for " + zone + ":")
print("|\tWeather\t\t|\tTime\t|")
print("+-----------------------+---------------+")
for weather, start_time in forecast:
fmt1 = weather["name_en"]
if (len(weather["name_en"]) < 8):
fmt1 += "\t"
fmt2 = str(round((start_time - datetime.datetime.utcnow()).total_seconds() / 60))
print("|\t" + fmt1 + "\t|\t" + fmt2 + "m\t|")
Output:
Weather for Eureka Pyros:
| Weather | Time |
+-----------------------+---------------+
| Snow | -13m |
| Heat Waves | 10m |
| Thunder | 33m |
| Heat Waves | 57m |
| Fair Skies | 80m |
| Umbral Wind | 103m |
| Snow | 127m |
| Umbral Wind | 150m |
| Thunder | 173m |
| Thunder | 197m |
| Umbral Wind | 220m |
| Snow | 243m |
| Heat Waves | 267m |
| Blizzards | 290m |
| Thunder | 313m |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ffxivweather-1.0.1.tar.gz
(36.9 kB
view details)
Built Distribution
File details
Details for the file ffxivweather-1.0.1.tar.gz
.
File metadata
- Download URL: ffxivweather-1.0.1.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be211f1dac11d1fcc565d0f6b64df56085648de7f20e330fdd9a47099189d10 |
|
MD5 | e98ba084ecbd3adf1f46aa42910c4f35 |
|
BLAKE2b-256 | c44a650c291009f81f38a31a610f155677681b1b143c1997f9a41f1b28874fd5 |
File details
Details for the file ffxivweather-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: ffxivweather-1.0.1-py3-none-any.whl
- Upload date:
- Size: 36.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdf851780b2939cdced2f0cc5b8521865a64607128150a0638c1670c6c3bd78b |
|
MD5 | 2d8f1d99c1dee93cd9e995c88c4b140f |
|
BLAKE2b-256 | b8961e93a5f38e9135cbba271f7738d65dfc5254d604d6af7bd8a5ee5fa30645 |