### Install jyotishganit Library Source: https://github.com/northtara/jyotishganit/blob/main/README.md Install the jyotishganit library using pip. This is the first step to using the library. ```bash pip install jyotishganit ``` -------------------------------- ### Install Jyotishganit with Development Requirements Source: https://github.com/northtara/jyotishganit/blob/main/README.md Sets up a development environment by cloning the repository and installing necessary development dependencies. This is for contributors who plan to modify the library's code. ```bash git clone https://github.com/northtara/jyotishganit.git cd jyotishganit pip install -r requirements-dev.txt pip install -e . ``` -------------------------------- ### Install jyotishganit for Development Source: https://github.com/northtara/jyotishganit/blob/main/README.md Installs the jyotishganit package in editable mode for development. This allows changes to the source code to be reflected immediately without reinstallation. ```bash git clone https://github.com/northtara/jyotishganit.git cd jyotishganit pip install -e . ``` -------------------------------- ### Calculate and Print Planetary Aspects (Jupiter Example) Source: https://github.com/northtara/jyotishganit/blob/main/README.md Demonstrates how to find houses aspected by Jupiter and planets aspecting Jupiter. Requires a 'chart' object. ```python # Planets aspecting and aspected jupiter = next(p for p in chart.d1_chart.planets if p.celestial_body == "Jupiter") # Houses aspected by Jupiter houses_aspected = [aspect['to_house'] for aspect in jupiter.aspects['gives'] if 'to_house' in aspect] print(f"Jupiter aspects houses: {houses_aspected}") # Planets aspecting Jupiter aspected_by = [aspect['from_planet'] for aspect in jupiter.aspects['receives']] print(f"Jupiter is aspected by: {aspected_by}") ``` -------------------------------- ### Run All Jyotishganit Tests Source: https://github.com/northtara/jyotishganit/blob/main/README.md Executes all test suites for the jyotishganit library using pytest. This is useful for verifying installation and checking for regressions. ```bash python -m pytest tests/ ``` -------------------------------- ### Access and Print Planetary Dignities (Mars Example) Source: https://github.com/northtara/jyotishganit/blob/main/README.md Retrieves the dignities for a specific planet (e.g., Mars) from the D1 chart. Assumes a 'chart' object is available. ```python mars = next(p for p in chart.d1_chart.planets if p.celestial_body == "Mars") print(f"Mars dignities: {mars.dignities}") ``` -------------------------------- ### Calculate and Print Upcoming Vimshottari Dasha Periods Source: https://github.com/northtara/jyotishganit/blob/main/README.md Calculates and prints the start, end, and lord for the first three upcoming Vimshottari Dasha periods. Requires a pre-existing 'chart' object. ```python dashas = chart.dashas print('\n\n'.join(['Mahadasha: %s\n Start: %s\n End: %s' % (lord, md['start'], md['end']) for lord, md in list(dashas.upcoming['mahadashas'].items())[:3]])) ``` -------------------------------- ### Dasha Periods (Planetary Periods) Source: https://github.com/northtara/jyotishganit/blob/main/README.md Retrieves and displays upcoming Vimshottari Dasha periods, including the planetary lord, start date, and end date. ```APIDOC ## Dasha Periods (Planetary Periods) ### Description Retrieves and displays upcoming Vimshottari Dasha periods, including the planetary lord, start date, and end date. ### Method ```python chart.dashas.upcoming['mahadashas'] ``` ### Parameters None ### Request Example ```python dashas = chart.dashas print('\n\n'.join(['Mahadasha: %s\n Start: %s\n End: %s' % (lord, md['start'], md['end']) for lord, md in list(dashas.upcoming['mahadashas'].items())[:3]])) ``` ### Response #### Success Response - Prints upcoming Mahadasha periods, each with its lord, start, and end dates. #### Response Example ``` Mahadasha: Jupiter Start: 2017-06-21 End: 2033-06-22 ``` ``` -------------------------------- ### Get Birth Chart as JSON using jyotishganit API Source: https://github.com/northtara/jyotishganit/blob/main/README.md Shows how to convert a calculated birth chart object into a JSON dictionary or string format. This is useful for data serialization and external use. ```python # JSON output functions json_dict = get_birth_chart_json(chart) # -> Dict[str, Any] json_string = get_birth_chart_json_string(chart) # -> str ``` -------------------------------- ### Calculate Birth Chart using jyotishganit API Source: https://github.com/northtara/jyotishganit/blob/main/README.md Demonstrates the core function for calculating a Vedic birth chart. Requires importing necessary modules and providing birth details. ```python from jyotishganit import calculate_birth_chart, get_birth_chart_json, Person # Main calculation function chart = calculate_birth_chart( birth_date=datetime, # Local birth time latitude=float, # Geographic latitude longitude=float, # Geographic longitude timezone_offset=float, # Hours from UTC (e.g., 5.5 for IST) location_name=str, # Optional location name name=str # Optional person name ) -> VedicBirthChart ``` -------------------------------- ### Running Tests and Checks Source: https://github.com/northtara/jyotishganit/blob/main/README.md Execute various tests and checks for the Jyotishganit project. This includes running all pytest tests, validating the package, checking code formatting with black, and performing type checking with mypy. ```bash pytest tests/ # All tests python validate_package.py # Package validation black jyotishganit/ # Code formatting mypy jyotishganit/ # Type checking ``` -------------------------------- ### Validate Jyotishganit Package Source: https://github.com/northtara/jyotishganit/blob/main/README.md Runs a script to validate the jyotishganit package. This is a separate check from the unit tests. ```bash python validate_package.py ``` -------------------------------- ### Ashtakavarga System Strength Calculation Source: https://github.com/northtara/jyotishganit/blob/main/README.md Calculate strengths using the Ashtakavarga system. This includes Sarvashtakavarga (combined points) and individual planet Ashtakavarga (Bhinnashktakavarga). ```python # Get Sarvashtakavarga (combined points for all planets) sarva = chart.ashtakavarga.sav for sign, points in sarva.items(): print(f"{sign}: {points} points") # Individual planet ashtakavarga (Bhinnashktakavarga) sun_ak = chart.ashtakavarga.bhav['Sun'] print(f"Sun's contribution to each sign: {sun_ak}") ``` -------------------------------- ### Access Divisional Charts (Varga Chakra) Source: https://github.com/northtara/jyotishganit/blob/main/README.md Access any divisional chart from the chart object. Iterate through houses and occupants to find planet details. ```python # Access any divisional chart navamsa = chart.divisional_charts['d9'] for house in navamsa.houses: for planet in house.occupants: print(f"{planet.celestial_body} in {planet.sign}") ``` -------------------------------- ### Run Specific Jyotishganit Test Categories Source: https://github.com/northtara/jyotishganit/blob/main/README.md Executes specific categories of tests within the jyotishganit library using pytest. This allows for targeted testing of different functionalities. ```bash # Run specific test categories python -m pytest tests/test_panchanga.py # Panchanga calculations python -m pytest tests/test_strengths.py # Shadbala calculations python -m pytest tests/test_birth_charts.py # Complete chart generation python -m pytest tests/test_cross_platform.py # Platform compatibility ``` -------------------------------- ### Calculate and Save Vedic Birth Chart Source: https://github.com/northtara/jyotishganit/blob/main/README.md Generate a complete Vedic birth chart using birth details and save the entire chart as a JSON file. Access key astrological data like Ascendant, Moon Sign, and Nakshatra. ```python from datetime import datetime from jyotishganit import calculate_birth_chart, get_birth_chart_json_string # Generate a complete Vedic birth chart chart = calculate_birth_chart( birth_date=datetime(1996, 7, 4, 9, 10, 0), # 4th July 1996 9:10 am latitude=18.404, # Karmala, India longitude=75.195, timezone_offset=5.5, # IST name="Bhampu" ) # Access key astrological data print(f"Ascendant: {chart.d1_chart.houses[0].sign}") print(f"Moon Sign: {chart.d1_chart.planets[1].sign}") # Moon is index 1 print(f"Nakshatra: {chart.panchanga.nakshatra}") # Save the entire chart as JSON with open("birth_chart.json", "w") as json_file: json_file.write(get_birth_chart_json_string(chart)) print("Birth chart saved to birth_chart.json") ``` -------------------------------- ### Access Panchanga Data Source: https://github.com/northtara/jyotishganit/blob/main/README.md Retrieve and print detailed Panchanga (Vedic Almanac) information from a calculated birth chart. This includes Tithi, Nakshatra, Yoga, Karana, and Vaara. ```python panchanga = chart.panchanga print(f"Tithi: {panchanga.tithi}") # Lunar day (1-30) print(f"Nakshatra: {panchanga.nakshatra}") # Moon's constellation print(f"Yoga: {panchanga.yoga}") # Sun-Moon combination print(f"Karana: {panchanga.karana}") # Half lunar day print(f"Vaara: {panchanga.vaara}") # Weekday ``` -------------------------------- ### Calculate Planetary Shadbala Strength Source: https://github.com/northtara/jyotishganit/blob/main/README.md Calculate the Shadbala (Six-Fold Strength) for a planet. This includes total strength, strength in Rupas, and a detailed breakdown of individual strength components. ```python sun = chart.d1_chart.planets[0] # Sun shadbala = sun.shadbala['Shadbala'] print(f"Total Shadbala: {shadbala['Total']:.2f}") print(f"Strength in Rupas: {shadbala['Rupas']:.2f}") # Detailed breakdown print(f"Positional Strength: {shadbala['Sthanabala']:.2f}") print(f"Temporal Strength: {shadbala['Kaalabala']:.2f}") print(f"Directional Strength: {shadbala['Digbala']:.2f}") print(f"Motional Strength: {shadbala['Cheshtabala']:.2f}") print(f"Natural Strength: {shadbala['Naisargikabala']:.2f}") print(f"Aspectual Strength: {shadbala['Drikbala']:.2f}") ``` -------------------------------- ### Graha Drishti (Planetary Aspects) Source: https://github.com/northtara/jyotishganit/blob/main/README.md Retrieves information about traditional Vedic planetary aspects, showing which houses a planet aspects and which planets aspect it. ```APIDOC ## Graha Drishti (Planetary Aspects) ### Description Retrieves information about traditional Vedic planetary aspects, showing which houses a planet aspects and which planets aspect it. ### Method ```python jupiter.aspects['gives'] jupiter.aspects['receives'] ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python # Assuming 'jupiter' is a Planet object # Houses aspected by Jupiter houses_aspected = [aspect['to_house'] for aspect in jupiter.aspects['gives'] if 'to_house' in aspect] print(f"Jupiter aspects houses: {houses_aspected}") # Planets aspecting Jupiter aspected_by = [aspect['from_planet'] for aspect in jupiter.aspects['receives']] print(f"Jupiter is aspected by: {aspected_by}") ``` ### Response #### Success Response - **aspects['gives']** (List[Dict]): A list of aspects the planet is making. Each dictionary may contain 'to_house'. - **aspects['receives']** (List[Dict]): A list of aspects the planet is receiving. Each dictionary may contain 'from_planet'. #### Response Example ``` Jupiter aspects houses: [1, 11, 9] Jupiter is aspected by: ['Mars', 'Saturn', 'Mercury', 'Sun'] ``` ``` -------------------------------- ### calculate_birth_chart Source: https://github.com/northtara/jyotishganit/blob/main/README.md Calculates a complete Vedic birth chart based on provided birth details and location. This is the main function for generating astrological charts. ```APIDOC ## calculate_birth_chart ### Description Calculates a complete Vedic birth chart based on provided birth details and location. This is the main function for generating astrological charts. ### Method ```python calculate_birth_chart( birth_date: datetime, # Local birth time latitude: float, # Geographic latitude longitude: float, # Geographic longitude timezone_offset: float, # Hours from UTC (e.g., 5.5 for IST) location_name: str = None, # Optional location name name: str = None # Optional person name ) -> VedicBirthChart ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from datetime import datetime chart = calculate_birth_chart( birth_date=datetime(1990, 5, 15, 10, 30, 0), latitude=28.6139, longitude=77.2090, timezone_offset=5.5, location_name="New Delhi", name="Example Person" ) ``` ### Response #### Success Response (VedicBirthChart) - **chart.person** (Person): Birth details and location. - **chart.ayanamsa** (Ayanamsa): Calculated ayanamsa value. - **chart.panchanga** (Panchanga): Five-limb almanac data. - **chart.d1_chart** (RasiChart): Primary birth chart (D1). - **chart.divisional_charts** (Dict[str, RasiChart]): D2-D60 charts. - **chart.ashtakavarga** (Dict): Ashtakavarga point system. - **chart.dashas** (Dashas): Vimshottari dasha periods. #### Response Example (See Data Models section for detailed structure of returned objects) ``` -------------------------------- ### Planetary Dignities Source: https://github.com/northtara/jyotishganit/blob/main/README.md Accesses and displays the astrological dignities for a specific planet within the birth chart. ```APIDOC ## Planetary Dignities ### Description Accesses and displays the astrological dignities for a specific planet within the birth chart. ### Method ```python next(p for p in chart.d1_chart.planets if p.celestial_body == "PlanetName").dignities ``` ### Parameters #### Path Parameters - **PlanetName** (str): The name of the planet for which to retrieve dignities (e.g., "Mars"). ### Request Example ```python # Example for Mars mars = next(p for p in chart.d1_chart.planets if p.celestial_body == "Mars") print(f"Mars dignities: {mars.dignities}") ``` ### Response #### Success Response - **dignities** (PlanetDignities): An object containing dignity information. - **dignity** (str): Overall dignity status (e.g., 'neutral', 'exalted'). - **planet_tattva** (str): The elemental nature of the planet. - **rashi_tattva** (str): The elemental nature of the sign the planet is in. - **friendly_tattvas** (List[str]): Elemental natures considered friendly. #### Response Example ``` Mars dignities: PlanetDignities(dignity='neutral', planet_tattva='Fire', rashi_tattva='Earth', friendly_tattvas=['Air', 'Fire']) ``` ``` -------------------------------- ### get_birth_chart_json Source: https://github.com/northtara/jyotishganit/blob/main/README.md Converts a calculated Vedic birth chart object into a JSON dictionary or string format for easier data handling and serialization. ```APIDOC ## get_birth_chart_json ### Description Converts a calculated Vedic birth chart object into a JSON dictionary or string format for easier data handling and serialization. ### Method ```python get_birth_chart_json(chart: VedicBirthChart) -> Dict[str, Any] get_birth_chart_json_string(chart: VedicBirthChart) -> str ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python # Assuming 'chart' is a VedicBirthChart object obtained from calculate_birth_chart json_dict = get_birth_chart_json(chart) json_string = get_birth_chart_json_string(chart) ``` ### Response #### Success Response (Dict or str) - Returns a dictionary representing the birth chart data. - Returns a JSON string representing the birth chart data. #### Response Example ```json { "person": { "name": "Example Person", "birth_date": "1990-05-15T10:30:00", "latitude": 28.6139, "longitude": 77.2090, "timezone_offset": 5.5, "location_name": "New Delhi" }, "ayanamsa": { "name": "Chitra Paksha", "value": 23.77 }, "panchanga": { "tithi": { "name": "Shukla Paksha", "number": 10, "end_time": "1990-05-15T18:00:00" }, "nakshatra": { "name": "Pushya", "pada": 3, "end_time": "1990-05-15T12:00:00" }, "yoga": { "name": "Vyatipata", "end_time": "1990-05-15T09:00:00" }, "karana": { "name": "Gara", "end_time": "1990-05-15T09:00:00" }, "vara": "Tuesday" }, "d1_chart": { "planets": [ { "celestial_body": "Sun", "sign": "Aries", "sign_degrees": 2.5, "nakshatra": "Ashwini", "pada": 1, "house": 1, "dignities": ["detriment", "enemy"], "shadbala": {}, "aspects_houses": [3, 7], "aspected_by": ["Moon"] } // ... other planets ] }, "divisional_charts": {}, "ashtakavarga": {}, "dashas": { "upcoming": { "mahadashas": { "Jupiter": { "start": "2017-06-21", "end": "2033-06-22" } } } } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.