Skip to main content

FFXIV weather forecast library for Python applications.

Project description

ffxivweather-py

FFXIV weather forecast library for Python applications.

Credit to Garland Tools for crowdsourced 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


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.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

ffxivweather-1.0.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file ffxivweather-1.0.0.tar.gz.

File metadata

  • Download URL: ffxivweather-1.0.0.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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for ffxivweather-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0e9d993d4733d9aa2b1009869323c870fde9feb1982bceb2164d4d5aad169bef
MD5 9cf0176cb9a7c957467f193177c85324
BLAKE2b-256 9880aa1ac90bf30838e6ae049a2b6721032434ab45bbabcfd2845658468d3968

See more details on using hashes here.

File details

Details for the file ffxivweather-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ffxivweather-1.0.0-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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for ffxivweather-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3494fd0ca11df2417ba2b577e6252cb2529acf70fdc22d1ed2202b96356d18c
MD5 a178c2f62409f6bcb8c27aaa1f536b8b
BLAKE2b-256 b6308e5571740ef366a898829ae5c0220125c81a9a28b05da370df32bee6264b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page