Skip to main content

Final Fantasy XIV weather & time tools.

Project description

Pypi Pypi Build Status PyPI - Downloads

EorzeaEnv

Installation

pip install eorzeaenv

Usage

from EorzeaEnv import EorzeaLang
from EorzeaEnv import EorzeaTime
from EorzeaEnv import EorzeaWeather

Eorzea Time

>>> EorzeaTime.now()
'EorzeaTime(Sixth Embral Moon, 11, 21, 56, Phase:0.50, Althyk)'

>>> EorzeaTime.now().moon
'Sixth Embral Moon'

>>> EorzeaTime.now().sun
11

>>> EorzeaTime.now().hour
21

>>> EorzeaTime.now().minute
56

>>> EorzeaTime.now().phase
0.50

>>> EorzeaTime.now().guardian
'Althyk'

Weather Forecast

  • Using period as tuple or list
# defalut step value is 5
# This method return a generator if you need to re-use it save the values as `tuple` or `list`.
t = tuple(EorzeaTime.weather_period(step=3))

# defalut lang is 'en'
# defalut strict is True for strict mode
# False for fuzzy mode: `adsfEureka Pyrosadsf` is valid
weather_en = EorzeaWeather.forecast('Eureka Pyros', t, strict=True)
weather_ja = EorzeaWeather.forecast('Eureka Pyros', t, lang=EorzeaLang.JA, strict=True)
weather_de = EorzeaWeather.forecast('Eureka Pyros', t, lang=EorzeaLang.DE, strict=True)
weather_fr = EorzeaWeather.forecast('Eureka Pyros', t, lang=EorzeaLang.FR, strict=True)
>>> print(weather_en)
['Thunder', 'Snow', 'Blizzards']

>>> print(weather_ja)
['雷', '雪', '吹雪']

>>> print(weather_de)
['Gewittrig', 'Schnee', 'Schneesturm']

>>> print(weather_fr)
['Orages', 'Neige', 'Blizzard']
  • Using period in for-loop
weather_en = []
for t in EorzeaTime.weather_period(step=3):
    w = EorzeaWeather.forecast('Eureka Pyros', t)
    weather_en.append(w)
>>> print(weather_en)
['Thunder', 'Snow', 'Blizzards']
  • Using period generator directly
weather = EorzeaWeather.forecast('Eureka Pyros', EorzeaTime.weather_period(step=3))
>>> print(weather_en)
['Thunder', 'Snow', 'Blizzards']
  • Also support float type
weather = EorzeaWeather.forecast('Eureka Pyros', 1603644000.0)
>>> print(weather)
'Thunder'

Thanks

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

EorzeaEnv-1.5.1.tar.gz (15.1 kB view hashes)

Uploaded Source

Built Distribution

EorzeaEnv-1.5.1-py3-none-any.whl (17.7 kB view hashes)

Uploaded Python 3

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