### Install flatlib on Windows with C Compiler Source: https://github.com/flatangle/flatlib/blob/master/docs/source/installation.md Use this command to install flatlib on Windows when a C compiler is required. Ensure Visual C++ 2010 is installed first. ```bash set CL=-DWIN32 py -m pip install flatlib ``` -------------------------------- ### Start Live HTML Build Server Source: https://github.com/flatangle/flatlib/blob/master/docs/README.md Run 'make livehtml' to start a local server that rebuilds documentation on changes. Access it at localhost:8000. Press Ctrl+C or Command+C to quit. ```bash make livehtml ``` -------------------------------- ### Install Sphinx Source: https://github.com/flatangle/flatlib/blob/master/docs/README.md Install Sphinx using pip. Use 'py pip' on Windows. ```bash pip install sphinx ``` ```bash py pip install sphinx ``` -------------------------------- ### Install Sphinx-autobuild Source: https://github.com/flatangle/flatlib/blob/master/docs/README.md Install sphinx-autobuild using pip. Use 'py pip' on Windows. ```bash pip install sphinx-autobuild ``` ```bash py pip install sphinx-autobuild ``` -------------------------------- ### Test flatlib Installation in Python Interpreter Source: https://github.com/flatangle/flatlib/blob/master/docs/source/installation.md Verify that flatlib has been successfully installed by importing it in the Python interactive interpreter. ```python >>> import flatlib >>> flatlib ``` -------------------------------- ### Create Astrology Chart and Get Sun Position Source: https://github.com/flatangle/flatlib/blob/master/README.md Demonstrates how to create a date and position object, initialize a Chart, and retrieve the Sun's position. Ensure Datetime and GeoPos are imported. ```python >>> date = Datetime('2015/03/13', '17:00', '+00:00') >>> pos = GeoPos('38n32', '8w54') >>> chart = Chart(date, pos) >>> sun = chart.get(const.SUN) >>> print(sun) ``` -------------------------------- ### Generic Object Access Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Uses the generic 'get' method to access objects, houses, angles, or fixed stars from the Chart object. ```python moon = chart.get(const.MOON) print(moon) ``` -------------------------------- ### Get Moon Phase Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Retrieve the current phase of the moon for the chart using the getMoonPhase() function. Returns a string representing the phase. ```default >>> chart.getMoonPhase() 'Third Quarter' ``` -------------------------------- ### Access Object Functions Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Calls functions on a celestial object to get its orbital period, mean motion, movement direction, gender, element, or if it's fast-moving. ```python sun.orb() sun.meanMotion() sun.movement() sun.gender() sun.element() sun.isFast() ``` -------------------------------- ### Get Part Longitude with Flatlib Source: https://context7.com/flatangle/flatlib/llms.txt Retrieves and prints the sign and longitude of specific parts from a natal chart. This is useful for analyzing specific astrological points. ```python parts = [ arabicparts.PARS_SPIRIT, arabicparts.PARS_FAITH, arabicparts.PARS_SUBSTANCE, arabicparts.PARS_WEDDING_MALE, arabicparts.PARS_WEDDING_FEMALE, arabicparts.PARS_SONS, arabicparts.PARS_FATHER, arabicparts.PARS_MOTHER, arabicparts.PARS_BROTHERS, arabicparts.PARS_DISEASES, arabicparts.PARS_DEATH, arabicparts.PARS_TRAVEL, arabicparts.PARS_FRIENDS, arabicparts.PARS_ENEMIES, ] for part_id in parts: part = arabicparts.getPart(part_id, chart) print(f'{part_id}: {part.sign} {part.signlon:.2f}°') # Get just the longitude of a part lon = arabicparts.partLon(arabicparts.PARS_SPIRIT, chart) print(f'Pars Spirit longitude: {lon:.4f}°') ``` -------------------------------- ### Access House from Chart Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Retrieves a specific house (e.g., 1st House) using its identifier from the Chart object via the generic 'get' method. ```python house1 = chart.get(const.HOUSE1) print(house1) ``` -------------------------------- ### Build HTML Documentation Source: https://github.com/flatangle/flatlib/blob/master/docs/README.md Execute 'make html' in the docs directory to build the HTML documentation. The output will be in docs/build/html. ```bash make html ``` -------------------------------- ### Create and Inspect a Chart Source: https://github.com/flatangle/flatlib/blob/master/docs/source/index.md Demonstrates creating a celestial chart with a specific date, time, and location, and then retrieving and printing the Sun's position. ```python >>> date = Datetime('2015/03/13', '17:00', '+00:00') >>> pos = GeoPos('38n32', '8w54') >>> chart = Chart(date, pos) >>> sun = chart.get(const.SUN) >>> print(sun) ``` -------------------------------- ### Create a Chart Object Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Initializes a Datetime, GeoPos, and Chart object. Ensure you have the necessary imports. ```python from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.chart import Chart date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) ``` -------------------------------- ### Create Basic Chart Object Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Construct a basic Chart object by providing Datetime and GeoPos objects. This creates a chart with default settings for planets and house system. ```python >>> # Set datetime and position >>> from flatlib.datetime import Datetime >>> from flatlib.geopos import GeoPos >>> date = Datetime('2015/03/13', '17:00', '+00:00') >>> pos = GeoPos('38n32', '8w54') >>> # Finally create the chart >>> from flatlib.chart import Chart >>> chart = Chart(date, pos) ``` -------------------------------- ### Get Object's House Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Retrieve the specific house an object resides in using the getObjectHouse function from the chart.houses list. This requires a pre-defined object, such as 'sun'. ```default >>> house = chart.houses.getObjectHouse(sun) >>> print(house) ... ``` -------------------------------- ### Upgrade flatlib on Windows Source: https://github.com/flatangle/flatlib/blob/master/docs/source/installation.md Command to upgrade flatlib to the latest version on Windows systems. ```bash py pip install flatlib --upgrade ``` -------------------------------- ### Create and Analyze Astrological Chart Source: https://github.com/flatangle/flatlib/blob/master/README.rst Demonstrates how to create a chart object with a specific date, time, and location, and then retrieve information about celestial bodies like the Sun. Ensure Datetime, GeoPos, Chart, and const are imported. ```python from flatlib import Datetime, GeoPos, Chart, const date = Datetime('2015/03/10', '14:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) sun = chart.get(const.SUN) print(sun) ``` -------------------------------- ### Import and Use Math Module Functions in Python Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/intro-python.md Import the 'math' module using the `import` command to access its mathematical functions, such as factorial and logarithm. ```python >>> import math >>> math.factorial(10) 3628800 >>> math.log(20) 2.995732273553991 ``` -------------------------------- ### Get HourTable Object and Details Source: https://context7.com/flatangle/flatlib/llms.txt Retrieves an HourTable object to access planetary hour information for a given date and position. Use this to inspect day/night rulers, current ruler, and detailed info about specific planetary hours. ```python ht = planetarytime.getHourTable(date, pos) print('Day ruler:', ht.dayRuler()) # e.g. 'Sun' (Sunday) print('Night ruler:', ht.nightRuler()) # Night ruler for this day print('Current ruler:', ht.currRuler()) # Day or Night ruler now print('Hour ruler:', ht.hourRuler()) # Planetary hour ruler right now # Detailed info about the current planetary hour info = ht.currInfo() print(info['mode']) # 'Day' or 'Night' print(info['hourNumber']) # Hour number (1–12) print(info['hourRuler']) # Planet ruling this hour print(info['start']) # Datetime when this hour started print(info['end']) # Datetime when this hour ends # Info for a specific table index (0–23) info_3 = ht.indexInfo(2) # 3rd diurnal hour print(info_3) ``` -------------------------------- ### Generate Solar Return Chart Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Create a solar return chart for a specified year using the solarReturn() function. This function takes the year as an argument and returns a new chart object. ```default >>> srchart = chart.solarReturn(2020) >>> print(srchart.date) <2020/03/12 22:01:59 00:00:00> ``` -------------------------------- ### Create Chart with Custom House System Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Build a Chart object specifying a custom house system, such as Regiomontanus, by importing the `const` module and passing the `hsys` argument. ```python >>> from flatlib import const >>> # Build a chart with Regiomontanus houses >>> chart = Chart(date, pos, hsys=const.HOUSES_REGIOMONTANUS) ``` -------------------------------- ### solarReturn(year) Source: https://context7.com/flatangle/flatlib/llms.txt Computes a solar return chart for a given year. ```APIDOC ## Chart.solarReturn(year) ### Description Returns a new `Chart` for the moment the Sun returns to its natal longitude in the given year, using the same geographic position and house system as the natal chart. ### Parameters - **year** (int) - The year for which to compute the solar return. ### Returns - `Chart`: A new `Chart` object representing the solar return. ### Example ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const date = Datetime('1980/06/15', '12:00', '+00:00') pos = GeoPos('51n30', '0w10') natal = Chart(date, pos) # Solar return for 2024 sr = natal.solarReturn(2024) print(sr.date) # Date of the 2024 solar return sun_sr = sr.get(const.SUN) print(sun_sr) # Sun at ~natal longitude asc_sr = sr.get(const.ASC) print(asc_sr) # SR Ascendant ``` ``` -------------------------------- ### Upgrade flatlib on Linux/macOS Source: https://github.com/flatangle/flatlib/blob/master/docs/source/installation.md Command to upgrade flatlib to the latest version on Linux and macOS systems. ```bash pip3 install flatlib --upgrade ``` -------------------------------- ### Uninstall flatlib on Windows Source: https://github.com/flatangle/flatlib/blob/master/docs/source/installation.md Command to uninstall flatlib from Windows systems. ```bash py pip uninstall flatlib ``` -------------------------------- ### Create Datetime Object (List Arguments) Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Instantiate a Datetime object using lists for date and time components, including the UTC offset sign and hour. ```python >>> # Build date with date and time lists >>> date = Datetime([2015,3,13], ['+',17,0,0]) >>> date.jd 2457095.2083333335 ``` -------------------------------- ### Create GeoPos Object (List Arguments) Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Instantiate a GeoPos object using lists for latitude and longitude, specifying sign, degrees, and minutes. ```python >>> # Using angle lists >>> pos = GeoPos(['+',38,32], ['-',8,54]) >>> pos.lat, pos.lon (38.53333333333333, -8.9) ``` -------------------------------- ### Uninstall flatlib on Linux/macOS Source: https://github.com/flatangle/flatlib/blob/master/docs/source/installation.md Command to uninstall flatlib from Linux and macOS systems. ```bash pip3 uninstall flatlib ``` -------------------------------- ### Create Chart with Specific Objects Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Construct a Chart object containing only a specified subset of objects, like the Sun and Moon, by providing a list of their constants to the `IDs` argument. ```python >>> # Build a chart with only the Sun and Moon >>> chart = Chart(date, pos, IDs=[const.SUN, const.MOON]) ``` -------------------------------- ### Create Chart with All Objects Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Generate a Chart object that includes all predefined objects, including modern planets, by passing `const.LIST_OBJECTS` to the `IDs` argument. ```python >>> # Build a chart including modern planets >>> chart = Chart(date, pos, IDs=const.LIST_OBJECTS) ``` -------------------------------- ### Compute Traditional Almutem Table Source: https://context7.com/flatangle/flatlib/llms.txt Computes the traditional Almutem table using the almutem protocol. This involves scoring planets across hylegic points, house positions, and planetary time rulers. Requires a Chart object. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.protocols import almutem date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) # Compute the full Almutem table table = almutem.compute(chart) # The table keys: 'Sun', 'Moon', 'Asc', 'Pars Fortuna', 'Syzygy', # 'Houses', 'Rulers', 'Score' # Each maps to a dict of { planet_id: { 'string': '+5+3...', 'score': 8 } } # Find the overall Almutem Figuris (highest total score) scores = table['Score'] almutem_planet = max(scores, key=lambda p: scores[p]['score']) print('Almutem Figuris:', almutem_planet) print('Score:', scores[almutem_planet]['score']) print('Breakdown:', scores[almutem_planet]['string']) # Inspect individual hylegic point scores sun_row = table[const.SUN] for planet, vals in sun_row.items(): if vals['score']: print(f' {planet}: {vals["string"]} = {vals["score"]}') ``` -------------------------------- ### arabicparts module Source: https://context7.com/flatangle/flatlib/llms.txt Computes Arabic Parts (Lots) using traditional diurnal/nocturnal formulas that adapt to whether the chart is a day or night chart. ```APIDOC ## arabicparts module ### Description Computes Arabic Parts (Lots) using traditional diurnal/nocturnal formulas that adapt to whether the chart is a day or night chart. Includes Pars Fortuna, Pars Spirit, and many others. ### Functions - `arabicparts.getPart(part_id, chart)`: Computes and returns the specified Arabic Part. - `part_id`: The ID of the Arabic Part to compute (e.g., `arabicparts.PARS_FORTUNA`). - `chart`: The `Chart` object for which to compute the part. - Returns a `Part` object with `sign` and `lon` attributes. ``` -------------------------------- ### Print a String in Python Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/intro-python.md Use the `print()` command to display text or variable contents in the Python interpreter. Ensure strings are enclosed in quotation marks. ```python >>> print('Hello, world!') Hello, world! ``` -------------------------------- ### Assign and Print Variables in Python Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/intro-python.md Assign values of different types (integer, float, string) to variables using the equals sign (=) and print their values using the `print()` command. ```python >>> number = 100 >>> miles = 1000.0 >>> name = "John" >>> print(number) 100 >>> print(miles) 1000.0 >>> print(name) John ``` -------------------------------- ### Create and use Chart objects Source: https://context7.com/flatangle/flatlib/llms.txt Computes a complete astrological chart for a given Datetime and GeoPos. Supports multiple house systems and custom object lists. Provides access to planets, houses, angles, and fixed stars. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') # Default chart with traditional objects and Alcabitus houses chart = Chart(date, pos) # Access a planet sun = chart.get(const.SUN) print(sun) # print(sun.sign) # Pisces print(sun.signlon) # 22.79... print(sun.lon) # 352.79... # Access a house house1 = chart.get(const.HOUSE1) print(house1) # # Access an angle asc = chart.get(const.ASC) print(asc) # # Specify a different house system and custom object list chart2 = Chart(date, pos, hsys=const.HOUSES_PLACIDUS, IDs=[const.SUN, const.MOON, const.MERCURY, const.VENUS, const.MARS]) # Chart properties print(chart.isDiurnal()) # True/False print(chart.getMoonPhase()) # 'First Quarter', 'Second Quarter', etc. # Fixed stars sirius = chart.getFixedStar(const.STAR_SIRIUS) print(sirius) # # Get all fixed stars stars = chart.getFixedStars() for star in stars: print(star) ``` -------------------------------- ### Create GeoPos Object (Angle Strings) Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Create a GeoPos object using angle strings with explicit signs for latitude and longitude. ```python >>> # Using angle strings >>> pos = GeoPos('+38:32','-8:54') >>> pos.lat, pos.lon (38.53333333333333, -8.9) ``` -------------------------------- ### Essential Dignities Module Source: https://context7.com/flatangle/flatlib/llms.txt Functions for calculating traditional essential dignities of celestial bodies, including ruler, exaltation, triplicity, term, and face. ```APIDOC ## Essential Dignities Module Provides lookup functions for traditional essential dignities (ruler, exaltation, triplicity, term, face, exile, fall) and scores. Supports Egyptian, Tetrabiblos, and Lilly term variants, and Chaldean or Triplicity face variants. ### Functions - **`ruler(sign)`**: Returns the ruler of a given sign. - `sign`: The sign identifier. - Returns: The planet identifier for the ruler. - **`exalt(sign)`**: Returns the planet in exaltation within a given sign. - `sign`: The sign identifier. - Returns: The planet identifier in exaltation. - **`dayTrip(sign)`**: Returns the diurnal triplicity ruler of a given sign. - `sign`: The sign identifier. - Returns: The planet identifier for the diurnal triplicity ruler. - **`nightTrip(sign)`**: Returns the nocturnal triplicity ruler of a given sign. - `sign`: The sign identifier. - Returns: The planet identifier for the nocturnal triplicity ruler. - **`exile(sign)`**: Returns the planet in exile within a given sign. - `sign`: The sign identifier. - Returns: The planet identifier in exile. - **`fall(sign)`**: Returns the planet in fall within a given sign. - `sign`: The sign identifier. - Returns: The planet identifier in fall. - **`term(sign, signlon)`**: Returns the term ruler for a specific longitude within a sign. - `sign`: The sign identifier. - `signlon`: The longitude within the sign. - Returns: The planet identifier for the term ruler. - **`face(sign, signlon)`**: Returns the face ruler for a specific longitude within a sign. - `sign`: The sign identifier. - `signlon`: The longitude within the sign. - Returns: The planet identifier for the face ruler. - **`getInfo(sign, signlon)`**: Returns a dictionary containing all essential dignity information for a given position. - `sign`: The sign identifier. - `signlon`: The longitude within the sign. - Returns: A dictionary with dignity information (e.g., `{'ruler': 'Jupiter', 'exalt': 'Venus', ...}`). - **`score(planet_id, sign, signlon)`**: Calculates the essential dignity score for a planet at a specific position. - `planet_id`: The identifier of the planet. - `sign`: The sign identifier. - `signlon`: The longitude within the sign. - Returns: The essential dignity score (integer). - **`isPeregrine(planet_id, sign, signlon)`**: Checks if a planet is peregrine (lacks essential dignities) at a given position. - `planet_id`: The identifier of the planet. - `sign`: The sign identifier. - `signlon`: The longitude within the sign. - Returns: `True` if peregrine, `False` otherwise. - **`almutem(sign, signlon)`**: Returns the ID of the planet with the highest essential dignity score at a given position. - `sign`: The sign identifier. - `signlon`: The longitude within the sign. - Returns: The planet identifier of the almutem. ### `EssentialInfo` Class A convenience class to get essential dignity information for a celestial object. - **`__init__(obj)`**: Initializes the `EssentialInfo` object with a celestial object. - **`ruler`**: The sign ruler of the object's position. - **`score`**: The object's essential dignity score. - **`almutem`**: The almutem at the object's position. - **`getDignities()`**: Returns a list of dignities belonging to the planet. - **`isPeregrine()`**: Returns `True` if the object is peregrine, `False` otherwise. ### Configuration - **`setTerms(terms_table)`**: Sets the table used for term calculations. - `terms_table`: The desired terms table (e.g., `essential.LILLY_TERMS`). - **`setFaces(faces_table)`**: Sets the table used for face calculations. - `faces_table`: The desired faces table (e.g., `essential.TRIPLICITY_FACES`). ### Example Usage ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const from flatlib.dignities import essential date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) asc = chart.get(const.ASC) # Individual dignity lookups by sign print(essential.ruler(asc.sign)) # e.g. 'Mercury' print(essential.exalt(asc.sign)) # Planet in exaltation print(essential.dayTrip(asc.sign)) # Diurnal triplicity ruler print(essential.nightTrip(asc.sign)) # Nocturnal triplicity ruler print(essential.exile(asc.sign)) # Planet in exile print(essential.fall(asc.sign)) # Planet in fall # Term and Face for a specific longitude within a sign sun = chart.get(const.SUN) print(essential.term(sun.sign, sun.signlon)) # Term ruler print(essential.face(sun.sign, sun.signlon)) # Face ruler # Full dignity info dict info = essential.getInfo(sun.sign, sun.signlon) # {'ruler': 'Jupiter', 'exalt': 'Venus', 'dayTrip': ..., 'term': ..., ...} # Dignity score for a planet score = essential.score(const.SUN, sun.sign, sun.signlon) print(score) # e.g. 5 (ruler), 4 (exalt), negative for exile/fall # Check if planet is peregrine print(essential.isPeregrine(const.SUN, sun.sign, sun.signlon)) # True/False # Almutem for a position almutem_id = essential.almutem(sun.sign, sun.signlon) print(almutem_id) # Planet with highest score at this position # EssentialInfo convenience class info_obj = essential.EssentialInfo(sun) print(info_obj.ruler) # sign ruler print(info_obj.score) # planet's essential dignity score print(info_obj.almutem) # almutem at the position print(info_obj.getDignities()) # list of dignities belonging to the planet print(info_obj.isPeregrine()) # True/False # Switch term/face tables essential.setTerms(essential.LILLY_TERMS) essential.setFaces(essential.TRIPLICITY_FACES) ``` ``` -------------------------------- ### Arabic Parts Calculation in Python Source: https://context7.com/flatangle/flatlib/llms.txt Computes Arabic Parts (Lots) using traditional diurnal/nocturnal formulas. This module adapts to day or night charts and includes calculations for Pars Fortuna, Pars Spirit, and others. Requires a Chart object. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.tools import arabicparts date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) pars_fortuna = arabicparts.getPart(arabicparts.PARS_FORTUNA, chart) print(pars_fortuna) print(pars_fortuna.sign) print(pars_fortuna.lon) ``` -------------------------------- ### Access Datetime Properties Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Retrieve and print the date, time, and UTC offset from a Datetime object. Also demonstrates accessing other properties like day of the week and time as a list. ```python >>> # Print date, time and offset >>> print(date.date) <2015/03/13> >>> print(date.time) <17:00:00> >>> print(date.utcoffset) <00:00:00> >>> # Other properties >>> date.date.dayofweek() 5 # 5 is Friday >>> date.time.toList() ['+', 17, 0, 0] ``` -------------------------------- ### Perform Basic Arithmetic Operations in Python Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/intro-python.md Perform addition, subtraction, multiplication, and division on numeric variables. The results are displayed directly in the interpreter. ```python >>> num1 = 10 >>> num2 = 20 >>> num1 + num2 30 >>> num1 - num2 -10 >>> num1 * num2 200 >>> num1 / num2 0.5 ``` -------------------------------- ### Compute Essential Dignities of Planets Source: https://context7.com/flatangle/flatlib/llms.txt Use this module to determine traditional essential dignities like ruler, exaltation, triplicity, term, and face. Supports various calculation variants and provides a dignity score. Requires importing `essential` and `const` from `flatlib`. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const from flatlib.dignities import essential date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) asc = chart.get(const.ASC) # Individual dignity lookups by sign print(essential.ruler(asc.sign)) # e.g. 'Mercury' print(essential.exalt(asc.sign)) # Planet in exaltation print(essential.dayTrip(asc.sign)) # Diurnal triplicity ruler print(essential.nightTrip(asc.sign)) # Nocturnal triplicity ruler print(essential.exile(asc.sign)) # Planet in exile print(essential.fall(asc.sign)) # Planet in fall # Term and Face for a specific longitude within a sign sun = chart.get(const.SUN) print(essential.term(sun.sign, sun.signlon)) # Term ruler print(essential.face(sun.sign, sun.signlon)) # Face ruler # Full dignity info dict info = essential.getInfo(sun.sign, sun.signlon) # {'ruler': 'Jupiter', 'exalt': 'Venus', 'dayTrip': ..., 'term': ..., ...} # Dignity score for a planet score = essential.score(const.SUN, sun.sign, sun.signlon) print(score) # e.g. 5 (ruler), 4 (exalt), negative for exile/fall # Check if planet is peregrine print(essential.isPeregrine(const.SUN, sun.sign, sun.signlon)) # True/False # Almutem for a position almutem_id = essential.almutem(sun.sign, sun.signlon) print(almutem_id) # Planet with highest score at this position # EssentialInfo convenience class info_obj = essential.EssentialInfo(sun) print(info_obj.ruler) # sign ruler print(info_obj.score) # planet's essential dignity score print(info_obj.almutem) # almutem at the position print(info_obj.getDignities()) # list of dignities belonging to the planet print(info_obj.isPeregrine()) # True/False # Switch term/face tables essential.setTerms(essential.LILLY_TERMS) essential.setFaces(essential.TRIPLICITY_FACES) ``` -------------------------------- ### Create and use GeoPos objects Source: https://context7.com/flatangle/flatlib/llms.txt Stores latitude and longitude as floats, accepting compass-direction strings or decimal degrees. Used as the location argument when constructing a Chart. ```python from flatlib.geopos import GeoPos pos = GeoPos('38n32', '8w54') # Lisbon area print(pos) # <38N32:00 8W54:00> print(pos.lat) # 38.533... print(pos.lon) # -8.9... # Decimal degrees also accepted pos2 = GeoPos(51.5074, -0.1278) # London print(pos2) # <51N30:26 0W07:40> ``` -------------------------------- ### Compute a solar return chart Source: https://context7.com/flatangle/flatlib/llms.txt Returns a new Chart object for the moment the Sun returns to its natal longitude in a specified year. Uses the same geographic position and house system as the natal chart. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const date = Datetime('1980/06/15', '12:00', '+00:00') pos = GeoPos('51n30', '0w10') natal = Chart(date, pos) # Solar return for 2024 sr = natal.solarReturn(2024) print(sr.date) # Date of the 2024 solar return sun_sr = sr.get(const.SUN) print(sun_sr) # Sun at ~natal longitude asc_sr = sr.get(const.ASC) print(asc_sr) # SR Ascendant ``` -------------------------------- ### Create GeoPos Object Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Instantiate a GeoPos object using latitude and longitude strings. The latitude and longitude can be accessed directly via `pos.lat` and `pos.lon` attributes. ```python >>> from flatlib.geopos import GeoPos >>> pos = GeoPos('38n32', '8w54') >>> pos.lat 38.53333333333333 >>> pos.lon -8.9 ``` -------------------------------- ### Access Object Properties Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Retrieves properties like longitude, latitude, sign, sign longitude, and speed for a celestial object. ```python sun.lon sun.lat sun.sign sun.signlon sun.lonspeed ``` -------------------------------- ### Access Fixed Star Properties and Functions Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Retrieves properties like magnitude and calls functions such as 'orb()' on a fixed star object. ```python spica.mag # magnitude spica.orb() ``` -------------------------------- ### Create Datetime Object Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Instantiate a Datetime object for a specific date, time, and UTC offset. The Julian Date can be accessed via the `jd` attribute. ```python >>> from flatlib.datetime import Datetime >>> date = Datetime('2015/03/13', '17:00', '+00:00') >>> date.jd 2457095.2083333335 ``` -------------------------------- ### Create GeoPos Object (Float Values) Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Create a GeoPos object directly using float values for latitude and longitude. ```python >>> # Using the float values >>> pos = GeoPos(38.53333333333333, -8.9) >>> pos.lat, pos.lon (38.53333333333333, -8.9) ``` -------------------------------- ### Create and use Datetime objects Source: https://context7.com/flatangle/flatlib/llms.txt Encapsulates calendar date, local time, and UTC offset. Internally stores Julian Day number for calculations. Accepts string dates, times, and UTC offsets. ```python from flatlib.datetime import Datetime # Create a datetime for March 13 2015 at 17:00 UTC+0 dt = Datetime('2015/03/13', '17:00', '+00:00') print(dt) # <2015/03/13 17:00:00 +00:00> print(dt.jd) # Julian Day: 2457094.208333... # Convert to UTC representation utc = dt.getUTC() print(utc) # <2015/03/13 17:00:00 +00:00> # Build from Julian Day dt2 = Datetime.fromJD(2457094.2083, '+01:00') print(dt2) # <2015/03/13 18:00:00 +01:00> ``` -------------------------------- ### Access House Properties Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Retrieves properties of a house, such as longitude, sign, sign longitude, and size. ```python house1.lon house1.sign house1.signlon house1.size ``` -------------------------------- ### Create Datetime Object (No UTC Offset) Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/create-chart.md Create a Datetime object without specifying a UTC offset, defaulting to the system's local time or a standard interpretation. ```python >>> # No UTC Offset argument >>> date = Datetime('2015/03/13', '17:00') >>> date.jd 2457095.2083333335 ``` -------------------------------- ### Compute Annual Profections Chart Source: https://context7.com/flatangle/flatlib/llms.txt Calculates an annual profection chart by rotating the natal chart 30° per year. Supports rotating objects or keeping them fixed. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.predictives import profections from flatlib import const # Natal chart natal_date = Datetime('1985/04/20', '10:30', '+02:00') pos = GeoPos('48n52', '2e20') natal = Chart(natal_date, pos) # Profect to a current date (age ~39) current_date = Datetime('2024/06/15', '12:00', '+00:00') profected = profections.compute(natal, current_date) # The profected Ascendant shows the active house asc = profected.get(const.ASC) print('Profected Asc:', asc.sign) # Active sign for the year # Keep natal objects fixed, only rotate houses profected_fixed = profections.compute(natal, current_date, fixedObjects=True) house1 = profected_fixed.get(const.HOUSE1) print('Profected House 1:', house1.sign) ``` -------------------------------- ### Accidental Dignity Analysis in Python Source: https://context7.com/flatangle/flatlib/llms.txt Computes accidental dignities for a planet, covering house placement, solar relations, light, orientality, haiz, Void of Course, mutual receptions, and aspects. Use this to understand a planet's strength and condition within a chart. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const from flatlib.dignities.accidental import AccidentalDignity date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) moon = chart.get(const.MOON) ad = AccidentalDignity(moon, chart) print(ad.house()) print(ad.houseScore()) print(ad.sunRelation()) print(ad.isCazimi()) print(ad.isCombust()) print(ad.isUnderSun()) print(ad.light()) print(ad.orientality()) print(ad.inHouseJoy()) print(ad.inSignJoy()) print(ad.haiz()) print(ad.isVoc()) print(ad.isFeral()) print(ad.aspectBenefics()) print(ad.aspectMalefics()) print(ad.isAuxilied()) print(ad.isSurrounded()) print(ad.reMutualReceptions()) score_dict = ad.getScoreProperties() print(score_dict) active = ad.getActiveProperties() print(active) print(ad.score()) ``` -------------------------------- ### Compute Solar Return Chart Source: https://context7.com/flatangle/flatlib/llms.txt Calculates the next or previous solar return chart, which is when the transiting Sun returns to its natal degree. Uses the natal chart's location and house system. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.predictives import returns from flatlib import const natal_date = Datetime('1985/04/20', '10:30', '+02:00') pos = GeoPos('48n52', '2e20') natal = Chart(natal_date, pos) current_date = Datetime('2024/01/01', '00:00', '+00:00') # Next solar return after current_date sr_next = returns.nextSolarReturn(natal, current_date) print('Next SR date:', sr_next.date) print('SR Asc:', sr_next.get(const.ASC)) print('SR Sun:', sr_next.get(const.SUN)) # Previous solar return before current_date sr_prev = returns.prevSolarReturn(natal, current_date) print('Prev SR date:', sr_prev.date) ``` -------------------------------- ### Access House Functions Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/chart-properties.md Calls functions on a house to determine its condition (e.g., 'Angular') or gender. ```python house1.condition() house1.gender() ``` -------------------------------- ### Chart Dynamics and Mutual Receptions in Python Source: https://context7.com/flatangle/flatlib/llms.txt Analyzes dynamic relationships between planets, including dignities, receptions, dispositor relationships, and aspect categorization. Useful for determining chart flow and planetary strength. Requires a Chart object. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const from flatlib.tools.chartdynamics import ChartDynamics date = Datetime('2015/03/13', '17:00', '+00:00') pos = GeoPos('38n32', '8w54') chart = Chart(date, pos) dyn = ChartDynamics(chart) print(dyn.inDignities(const.SUN, const.JUPITER)) print(dyn.receives(const.SUN, const.MOON)) print(dyn.disposits(const.JUPITER, const.SUN)) print(dyn.mutualReceptions(const.SUN, const.SATURN)) print(dyn.reMutualReceptions(const.MOON, const.VENUS)) asps = dyn.aspectsByCat(const.MOON, const.MAJOR_ASPECTS) print(asps['Applicative']) print(asps['Separative']) print(asps['Exact']) sep, app = dyn.immediateAspects(const.MOON, const.MAJOR_ASPECTS) if sep: print('Last separation from:', sep['id'], 'via', sep['asp']) if app: print('Next application to:', app['id'], 'via', app['asp']) print(dyn.isVOC(const.MOON)) ``` -------------------------------- ### Solar Returns Source: https://context7.com/flatangle/flatlib/llms.txt Computes the next or previous solar return chart. The solar return occurs when the transiting Sun returns to its natal degree. ```APIDOC ## Solar Returns Computes the next or previous solar return chart (the moment the transiting Sun returns to its natal degree), using the natal chart's location and house system. ### Method `returns.nextSolarReturn(natal_chart, current_date)` `returns.prevSolarReturn(natal_chart, current_date)` ### Parameters - **natal_chart** (Chart) - The natal chart object. - **current_date** (Datetime) - The reference date to find the next or previous solar return. ### Request Example ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib.predictives import returns from flatlib import const natal_date = Datetime('1985/04/20', '10:30', '+02:00') pos = GeoPos('48n52', '2e20') natal = Chart(natal_date, pos) current_date = Datetime('2024/01/01', '00:00', '+00:00') # Next solar return after current_date sr_next = returns.nextSolarReturn(natal, current_date) print('Next SR date:', sr_next.date) print('SR Asc:', sr_next.get(const.ASC)) print('SR Sun:', sr_next.get(const.SUN)) # Previous solar return before current_date sr_prev = returns.prevSolarReturn(natal, current_date) print('Prev SR date:', sr_prev.date) ``` ``` -------------------------------- ### AccidentalDignity Source: https://context7.com/flatangle/flatlib/llms.txt Computes accidental dignities and their scores for a planet in a chart, covering house placement, solar relations, light, haiz, Void of Course, mutual receptions, and aspects to benefics/malefics. ```APIDOC ## AccidentalDignity ### Description Computes accidental dignities and their scores for a planet in a chart. Covers house placement, solar relations (cazimi, combust, under the Sun), light (augmenting/diminishing), orientality, haiz, Void of Course, mutual receptions, aspects to benefics/malefics, and more. ### Methods - `AccidentalDignity(planet, chart)`: Initializes the AccidentalDignity object. - `house()`: Returns the House object the planet is in. - `houseScore()`: Returns the numerical score for house placement. - `sunRelation()`: Returns the relation to the Sun ('Cazimi', 'Combust', 'Under the Sun', or None). - `isCazimi()`: Returns True if the planet is Cazimi, False otherwise. - `isCombust()`: Returns True if the planet is Combust, False otherwise. - `isUnderSun()`: Returns True if the planet is Under the Sun, False otherwise. - `light()`: Returns the light status ('Augmenting Light' or 'Diminishing Light'). - `orientality()`: Returns the orientality ('Oriental' or 'Occidental'). - `inHouseJoy()`: Returns True if the planet is in its traditional house of joy. - `inSignJoy()`: Returns True if the planet is in its traditional sign of joy. - `haiz()`: Returns the haiz status ('Haiz', 'Contra-Haiz', or None). - `isVoc()`: Returns True if the planet is Void of Course. - `isFeral()`: Returns True if the planet has no aspects. - `aspectBenefics()`: Returns a list of aspects to benefics (Venus/Jupiter). - `aspectMalefics()`: Returns a list of aspects to malefics (Mars/Saturn). - `isAuxilied()`: Returns True if the planet is separating from and applying to a benefic. - `isSurrounded()`: Returns True if the planet is separating from and applying to a malefic. - `reMutualReceptions()`: Returns ruler/exaltation mutual receptions with other planets. - `getScoreProperties()`: Returns a dictionary of all accidental dignity score properties. - `getActiveProperties()`: Returns a list of non-zero accidental dignity properties. - `score()`: Returns the total accidental dignity score. ``` -------------------------------- ### Access List Elements by Index in Python Source: https://github.com/flatangle/flatlib/blob/master/docs/source/tutorials/intro-python.md Access individual elements of a list using zero-based index numbers within square brackets. Basic arithmetic can be performed on numeric list elements. ```python >>> mylist = [-5, 0.3, 2.5, 33] >>> mylist[0] -5 >>> mylist[1] 0.3 >>> mylist[0] + mylist[1] -4.7 ``` -------------------------------- ### Primary Directions Table Computation Source: https://context7.com/flatangle/flatlib/llms.txt Implements primary directions using the proportional semi-arc method to compute arcs between promissors and significators. Supports in-mundo and in-zodiaco calculations. ```python from flatlib.chart import Chart from flatlib.datetime import Datetime from flatlib.geopos import GeoPos from flatlib import const from flatlib.predictives.primarydirections import PrimaryDirections, PDTable natal_date = Datetime('1985/04/20', '10:30', '+02:00') pos = GeoPos('48n52', '2e20') natal = Chart(natal_date, pos) # Build the full primary directions table with major aspects pd_table = PDTable(natal, aspList=const.MAJOR_ASPECTS) # View directions within an arc range (approximate age range) # Arc ~1° per year: view ages 35–45 directions_35_45 = pd_table.view(35, 45) for d in directions_35_45: arc, prom_id, sig_id, method = d print(f'Arc {arc:.2f}° | {prom_id} → {sig_id} ({method})') # Directions to the Ascendant (significator) asc_dirs = pd_table.bySignificator(const.ASC) for d in asc_dirs[:5]: print(f'Arc {d[0]:.2f}° | {d[1]} → Asc ({d[3]})') # Directions from the Sun (promissor) sun_dirs = pd_table.byPromissor(const.SUN) for d in sun_dirs[:5]: print(d) # Manual arc computation between specific objects pd = PrimaryDirections(natal) mc = natal.get(const.MC) sun = natal.get(const.SUN) prom = pd.N(const.SUN) # Sun as promissor (conjunction) sig = pd.N(const.ASC) # ASC as significator arc_result = pd.getArc(prom, sig) print(f'In-mundo arc: {arc_result["arcm"]:.4f}°') print(f'In-zodiaco arc: {arc_result["arcz"]:.4f}°') ```