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.14.tar.gz
(43.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ffxivweather-1.0.14.tar.gz.
File metadata
- Download URL: ffxivweather-1.0.14.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfe4eb4fa54bec5b08d8d7e1616c671039d4e8a35a2908092c14ffee652565ff
|
|
| MD5 |
5fde45377ffe7928d6de2a8a7a557267
|
|
| BLAKE2b-256 |
d3df897a81faec51dc7bfefb3497d2341fb8f1f82a2f32045e1fd1ba1c9ae54e
|
File details
Details for the file ffxivweather-1.0.14-py3-none-any.whl.
File metadata
- Download URL: ffxivweather-1.0.14-py3-none-any.whl
- Upload date:
- Size: 43.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e900c3c24be54612e86b446a43ee5f4b801b3a662d314e34cc74c436169c9716
|
|
| MD5 |
644eabc4fba5626cb775a5843094e491
|
|
| BLAKE2b-256 |
ad02d3ace22bbceeb5f979cdc6faf3ea7d6bbede0f680d5a78e3d010eb6efbc7
|