Package: eorzeaenv
EorzeaEnvCHANGELOGInstallationpip install eorzeaenvUsagefromEorzeaEnvimportEorzeaLang,EorzeaTime,EorzeaWeather,EorzeaPlaceNameEorzea Language enumsupport_langs=[EorzeaLang.EN,EorzeaLang.JA,EorzeaLang.DE,EorzeaLang.FR,EorzeaLang.ZH_SC,EorzeaLang.KO,]Eorzea Time>>>EorzeaTime.now()'EorzeaTime(Sixth Embral Moon, 11, 21, 56, Phase:0.50, Althyk)'>>>EorzeaTime.now().moon'Sixth Embral Moon'>>>EorzeaTime.now().sun11>>>EorzeaTime.now().hour21>>>EorzeaTime.now().minute56>>>EorzeaTime.now().phase0.50

>>>EorzeaTime.now().guardian'Althyk'Get the unix timestamp (int not float)>>>EorzeaTime.now().get_unix_time()1661114514Get the eorzea timestamp (int not float)>>>EorzeaTime.now().get_eorzea_time()34177649220Weather ForecastUsing 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))# Use EorzeaPlaceName to ensure the place is valid or# you can directly pass the place string to forecast.place_name=EorzeaPlaceName('Eureka Pyros')# Defalut lang is 'en'# Defalut strict is `True` for strict mode `False` for fuzzy mode.# eg. `eurekaa puros` is valid in fuzzy mode.# In fuzzy mode, you can set the cutoff score to prevent unexpected place name to be passed.# default value is 80. (100 >= value >= 0)EorzeaWeather.set_fuzzy_cutoff(95)weather_en=EorzeaWeather.forecast(place_name,t,strict=True)weather_ja=EorzeaWeather.forecast(place_name,t,lang=EorzeaLang.JA,strict=True)weather_de=EorzeaWeather.forecast(place_name,t,lang=EorzeaLang.DE,strict=True)weather_fr=EorzeaWeather.forecast(place_name,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-loopweather_en=[]fortinEorzeaTime.weather_period(step=3):w=EorzeaWeather.forecast('Eureka Pyros',t)weather_en.append(w)>>>print(weather_en)['Thunder','Snow','Blizzards']Provide a desired base time to calculate.fortinEorzeaTime.weather_period(step=3,from_=datetime(2025,10,25).timestamp()):w=EorzeaWeather.forecast('Eureka Pyros',t)print(w)Using period generator directlyweather=EorzeaWeather.forecast('Eureka Pyros',EorzeaTime.weather_period(step=3))>>>print(weather_en)['Thunder','Snow','Blizzards']Eorzea place nameAn instance of EorzeaPlaceName would be always a valid place name in this pacakge.An invalid place name will raisesInvalidEorzeaPlaceNameerror.place_name=EorzeaPlaceName('The Ruby Sea',# `False` to fuzzy mode, default is `True`strict=True,# Stricted scope for validation of place name.# default is all supports locale.locale_scopes=[EorzeaLang.EN,EorzeaLang.JA,EorzeaLang.FR,EorzeaLang.DE],# Used in fuzzy mode to cut-off the result under the score.# default is `80`.fuzzy_cutoff=80)>>>place_name
EorrzeaPlaceName('The Ruby Sea')>>>print(place_name)'TheRubySea`Belowings are valid place names in strict mode with full locale scopes (default settings).EorzeaPlaceName('The Ruby Sea')# valid `The Ruby Sea`EorzeaPlaceName('the ruby sea')# valid `The Ruby Sea`EorzeaPlaceName('ruby sea')# valid `The Ruby Sea`EorzeaPlaceName('rubinsee')# valid `Rubinsee`EorzeaPlaceName('紅玉海')# valid `紅玉海`With stricted scopes.scopes=[EorzeaLang.JA,EorzeaLang.DE]EorzeaPlaceName('The Ruby Sea',locale_scopes=scopes)# raises errorEorzeaPlaceName('the ruby sea',locale_scopes=scopes)# raises errorEorzeaPlaceName('ruby sea',locale_scopes=scopes)# raises errorEorzeaPlaceName('rubinsee',locale_scopes=scopes)# valid `Rubinsee`EorzeaPlaceName('紅玉海',locale_scopes=scopes)# valid `紅玉海`In fuzzy mode.EorzeaPlaceName('the ruby see',strict=False)# valid `The Ruby Sea`EorzeaPlaceName('ruby see',strict=False)# valid `The Ruby Sea`EorzeaPlaceName('rubisee',strict=False)# valid `Rubinsee`EorzeaPlaceName('紅玉貝',strict=False)# raises errorEorzeaPlaceName('紅玉貝',strict=False,fuzzy_cutoff=66)# valid `紅玉海`Eorzea rainbow predictUse EorzeaRainbow to predict when will the rainbow appears.fromdatetimeimportdatetimefromEorzeaEnvimportEorzeaPlaceName,EorzeaRainbow,EorzeaTime,EorzeaWeatherrainbow_times:list[datetime]=[]place=EorzeaPlaceName("東ラノシア")the_rainbow=EorzeaRainbow(place_name=place)fortinEorzeaTime.weather_period(step='inf'):the_rainbow.append(t,EorzeaWeather.forecast(place,t,raw=True))ifthe_rainbow.is_appear:rainbow_times.append(datetime.fromtimestamp(t))iflen(rainbow_times)==20:breakprint(rainbow_times)ErrorsfromEorzeaEnv.errorsimport\EorzeaEnvError,\InvalidEorzeaPlaceName,\WeatherRateDataErrorException
    |- EorzeaEnvError
        |- InvalidEorzeaPlaceName
        |- WeatherRateDataErrorThanksRogueadyn-SaintCoinach