def __init__(self,DATE,POS): chart = Chart(DATE, POS) sun = chart.getObject(const.SUN) sunSign = sun.sign sunDegree = int(sun.signlon) moon = chart.getObject(const.MOON) moonSign = moon.sign moonDegree = int(moon.signlon) syzygy = chart.getObject(const.SYZYGY) syzygySign = syzygy.sign syzygyDegree = int(syzygy.signlon) self.sun={'sign':sunSign,'degree':sunDegree} self.moon={'sign':moonSign,'degree':moonDegree} self.syzygy={'sign':syzygySign,'degree':syzygyDegree}
def advancedview(): if flask.request.method == "POST": num = flask.request.form.get('choiceit') town = flask.request.form.get('town') country = flask.request.form.get('country') # print('num is:', num) if len(num) > 6: yy, mm, dd = num[:4], num[5:7], num[8:10] tiden = yy + '/' + mm + '/' + dd date = Datetime(tiden, '17:00', '+00:00') geo_coordinates = get_geo_cords(town, country) if not geo_coordinates: return flask.render_template("advanced.html", countries=countries, error="Could not find the city") g0, g1 = float(geo_coordinates[0]), float( geo_coordinates[1].replace('</span>', '')) pos = GeoPos(g0, g1) chart = Chart(date, pos, IDs=const.LIST_OBJECTS) sun = chart.getObject(const.SUN) # print("Your sun sign is: ",sun.sign) #zodiac sign # print("Your zodiac is explained as: ", explain_zodiac(sun.sign)) # print("Your sun movement is: ",sun.movement()) # print("Your sun element is: ",sun.element()) # print("Explained element:", explain_element(sun.element())) # print("Your sun faction is: ",sun.faction()) #print(chart.__dict__) #house is different depending on chart # for merp in const.LIST_HOUSES: # print(merp, 'sign is',chart.getHouse(merp).sign,'The condition is:',chart.getHouse(merp).condition()) # print("This is the",explain_house(merp).get("translated"), " the lating motto for it is '",explain_house(merp).get("Latin motto"),"' It's basicly means: ",explain_house(merp).get('explain')) ##print("Your sun element is: ",chart.getObject(const.SUN).figures()) moon = chart.get(const.MOON) # print("Your moon is in:", moon.sign) # print("Your moon movement is: ",moon.movement()) # print("Your moon element is: ",moon.element()) # print("Explained element:", explain_element(moon.element())) # print("Your moon faction is: ",moon.faction()) # print("Your moon phase:", chart.getMoonPhase()) return flask.render_template("advanced.html", moon=moon, sun=sun, const=const, explain_house=explain_house, chart=chart, explain_zodiac=explain_zodiac, explain_element=explain_element) return flask.render_template("advanced.html", countries=countries)
def get_calendar(start, end): dates = pd.date_range(start=start, end=end) calendar = [] for d in dates: date = Datetime(d.strftime("%Y/%m/%d"), '12:00', '+00:00') pos = GeoPos('51n23', '0w18') chart = Chart(date, pos) moon = chart.getObject(flc.MOON) sun = chart.getObject(flc.SUN) mercury = chart.getObject(flc.MERCURY) venus = chart.getObject(flc.VENUS) mars = chart.getObject(flc.MARS) calendar.append({ 'date': d, 'moon_lon': int(moon.lon), 'sun_lon': int(sun.lon), 'mercury_lon': int(mercury.lon), 'venus_lon': int(venus.lon), 'mars_lon': int(mars.lon) }) calendar = pd.DataFrame(calendar) return calendar
def main(latitude: float, longitude: float, date: datetime): flatlib_datetime = convert_into_stupid_flatlib_format(date) position = GeoPos(latitude, longitude) chart = Chart(flatlib_datetime, position) for planet in planet_symbols.keys(): planet_position = chart.getObject(planet) print( planet_symbols[planet], sign_symbols[planet_position.sign], "℞" if planet_position.movement() == flatlib.const.RETROGRADE else "", end="", ) print()
async def cmd_sun(message): l = message.content.split(' ') try: date = parse(l[1]) datetime = Datetime(date.strftime('%Y/%m/%d')) pos = GeoPos('00n00', '0w00') chart = Chart(datetime, pos) sun = str(chart.getObject(SUN)).split(' ')[1] await send_text( client, message.channel, "If you were born on %s, then you're a %s!" % (date.strftime('%B %d, %Y'), sun)) except Exception as e: logger.info(e) await send_text(client, message.channel, "Invalid date string")
def in_day(year, month, day, hour, minute): """ Função retorna data thelemica de um dia e horário especifico :param year: Ano :param month: Mês :param day: Dia :param hour: Hora :param minute: Minuto :return: a data thelemica dos dados passados """ ev_in_day_weekday = date(year, month, day).weekday() ev_in_day_date = str(date(year, month, day).strftime('%Y/%m/%d')) ev_in_day_time = f'{hour}:{minute}' ev_in_day_na_year = int(year) - 1904 # New Aeon "generation" of 22 years ciclo_i = ev_in_day_na_year // 22 # // Years in the current cycle ciclo_ii = int(year) - 1904 - (ciclo_i * 22) # New Aeon year na_year = numerals[ciclo_ii].upper() + ':' + numerals[ciclo_i] na_date = Datetime(ev_in_day_date, ev_in_day_time, '-03:00') pos = GeoPos('23s39', '46w32') chart = Chart(na_date, pos) sun = chart.getObject(const.SUN) solis = str(sun).split(' ') solis_sign = solis[1] solis_arc = solis[2].split(':')[0].replace('+', '') moon = chart.get(const.MOON) luna = str(moon).split(' ') luna_sign = luna[1] luna_arc = luna[2].split(':')[0].replace('+', '') return (f'☉ in {solis_arc}º {signs[solis_sign]} ' f'☽ in {luna_arc}º {signs[luna_sign]} ' f'Dies {dies[ev_in_day_weekday]} ' f'Anno {na_year} æræ novæ')
def now(): """ Função não recebe parametros :return: a data thelemica atual """ # Era Vulgar Year ev_year = int(date.today().strftime('%Y')) # Whole Years since March Equinox 1904 ev_years_total = ev_year - 1904 # New Aeon "generation" of 22 years ciclo_i = ev_years_total // 22 # // Years in the current cycle ciclo_ii = ev_year - 1904 - (ciclo_i * 22) # New Aeon year na_year = numerals[ciclo_ii].upper() + ':' + numerals[ciclo_i] ev_weekday = date.today().weekday() ev_today = str(date.today().strftime('%Y/%m/%d')) ev_time = str(time.strftime('%H:%M')) na_date = Datetime(ev_today, ev_time, '-03:00') pos = GeoPos('23s39', '46w32') chart = Chart(na_date, pos) sun = chart.getObject(const.SUN) solis = str(sun).split(' ') solis_sign = solis[1] solis_arc = solis[2].split(':')[0].replace('+', '') moon = chart.get(const.MOON) luna = str(moon).split(' ') luna_sign = luna[1] luna_arc = luna[2].split(':')[0].replace('+', '') return (f'☉ in {solis_arc}º {signs[solis_sign]} ' f'☽ in {luna_arc}º {signs[luna_sign]} ' f'Dies {dies[ev_weekday]} ' f'Anno {na_year} æræ novæ')
async def cmd_chart(message): global TZWHERE_INST, GEOLOCATOR l = message.content.split(' ') date = parse(l[1]) time = parse(l[2]) pos = 3 if l[3].lower() == 'am': pos += 1 if l[3].lower() == 'pm': pos += 1 time.replace(hour=time.hour + 12) place = ' '.join(l[pos:]) location = GEOLOCATOR.geocode(place, addressdetails=True) timezone_str = TZWHERE_INST.tzNameAt(location.latitude, location.longitude) timezone = pytz.timezone(timezone_str) offset = str(timezone.utcoffset(date).total_seconds() / 60 / 60).replace( '.', ':') datetime = Datetime(date.strftime('%Y/%m/%d'), time.strftime('%H:%M'), offset) pos = GeoPos(location.latitude, location.longitude) chart = Chart(datetime, pos) response = ["%s, your chart is:" % (message.author.mention)] for const in LIST_OBJECTS: try: response += [ ' %s: %s' % (const, str(chart.getObject(const).sign)) ] except: pass try: url, img = get_chart_image(date, time, location, message) response += [url] response += [img] except Exception as e: logger.critical(e) response += ["Couldn't generate your image :/"] logger.info("Sending message: %s" % '\n'.join(response)) await send_text(client, message.channel, '\n'.join(response))
from flatlib import const from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.tools.chartdynamics import ChartDynamics from flatlib.protocols import almutem # Build a chart for a date and location date = Datetime('2020/01/20', '05:00', '+2:50') pos = GeoPos('39:57', '32:53') chart = Chart(date, pos) sun = chart.getObject(const.SUN) #print("--------------- SUN") print("Güneş Burç :" + sun.sign) #gunes burc moon = chart.getObject(const.MOON) print("Ay Burç :" + moon.sign) #gunes burc #print(sun.signlon)#gunes burc #print(sun.gender())#gunes burc cinsiyet #print(sun) print("------------------EVLER-----------") #Ev listesi homeList = [ const.HOUSE1, const.HOUSE2, const.HOUSE3, const.HOUSE4, const.HOUSE5, const.HOUSE6, const.HOUSE7, const.HOUSE8, const.HOUSE9, const.HOUSE10, const.HOUSE11, const.HOUSE12 ] house1 = chart.get(const.HOUSE12) for i in homeList: print("{0}: {1} ".format(i, chart.get(i).sign)) alm = almutem.compute(chart)
def get_moon_sign(self, chart: Chart) -> str: return chart.getObject(MOON).sign
def get_sun_sign(self, chart: Chart) -> str: return chart.getObject(SUN).sign
from flatlib import const from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.tools.chartdynamics import ChartDynamics # Build a chart for a date and location date = Datetime('1997/01/20', '01:00', '+3:50') pos = GeoPos('38:55', '27:50') chart = Chart(date, pos) sun = chart.getObject(const.SUN) print("--------------- SUN") print(sun.sign) #günes yükselen