Skip to main content

Generate and plot North-Indian Lagna Kundali charts using pyswisseph. Flexible astrokundali package with Different house calculation methods and interpretation JSONs

Project description

AstroKundali Icon

AstroKundali

AstroKundali is a lightweight and modular Python library for generating Vedic astrology charts using Swiss Ephemeris. It supports traditional North Indian chart plotting, divisional charts (D1 to D60), planetary dispositions, drishti (aspect) logic, and advanced calculations like Ashtakavarga. Designed for flexibility and clarity, it enables both astrologers and developers to compute and visualize personalized Kundalis with precision.

Request: If anyone would like to collaborate or discuss new features, please send me an email. I will get in touch with you.
If you want access to this project's source code, please do the same. I am planning to make this project fully open source in the near future.


USER OPTIONS

Ayanāṃśa Options

  • fagan_bradley
    Fagan–Bradley Ayanāṃśa: a Western sidereal offset fixed at 24°02′31″ (January 1 1950) and widely used in Western sidereal astrology.

  • lahiri (default)
    Lahiri (Chitra‑Paksha/Rohini) Ayanāṃśa: India’s official Vedic ayanāṃśa, zeroed at Spica (Chitra), and by far the most prevalent in Hindu astrology.

  • deluce
    de Luce Ayanāṃśa: proposed by Robert DeLuce (1877–1964), theoretically set to 1 CE but in practice anchored to ~26°24′47″ (1900) using Newcomb’s precession theory.

  • raman
    Raman Ayanāṃśa: introduced by B. V. Raman to better align with traditional nakṣatra positions, favored by his school of Vedic astrology.

  • krishnamurti
    Krishnamurti (KP) Ayanāṃśa: developed by K. S. Krishnamurti for the KP system, emphasizing precise divisional‑chart timing.

  • sassanian
    Sassanian Ayanāṃśa: reconstructs pre‑Islamic Persian/Sassanian zodiac data (via Al‑Biruni), often used with whole‑sign houses for ancient chart revival.

  • aldebaran
    Aldebaran Ayanāṃśa: fixes zero at the bright star Aldebaran (15° Taurus), popular in fixed‑star and esoteric charting.

  • galcenter
    Galcenter Ayanāṃśa: anchors the zodiac at the Milky Way’s center (~5° Sagittarius), used in modern “galactic” sidereal astrology.

House‑System Options

  • equal
    Equal Houses: twelve 30° houses measured from the exact Ascendant degree, offering simplicity and uniformity across latitudes.

  • whole_sign (default)
    Whole‑Sign: the sign containing the Ascendant becomes the 1st house, the next sign the 2nd, etc.; the oldest division from Hellenistic to Vedic traditions.

  • porphyry
    Porphyry: each quadrant (Ascendant→MC, MC→Descendant, etc.) is trisected into three equal parts, creating houses by trisection of angle arcs; described by Vettius Valens in the 2nd CE.

  • placidus
    Placidus: the most common Western quadrant system, trisecting diurnal/nocturnal arcs between the four angles to set cusps; can fail near polar circles.

  • koch
    Koch: a time‑based quadrant method dividing right‑ascension arcs equally between angles; popular in research and German circles, defined only within ~66° latitude.

  • campanus
    Campanus: divides the prime vertical into twelve equal segments, projecting them onto the ecliptic; emphasizes Earth‑centered spatial divisions.

  • regiomontanus
    Regiomontanus: splits the celestial equator into twelve equal arcs then projects those onto the ecliptic; a medieval Renaissance favorite attributed to Johann Müller.

Example Usage

  pip install astrokundali
  or
  !pip install astrokundali [Notebook]
    

Configure AstroData

    from astrokundali import AstroData
    data = AstroData(2009,3,30,9,36,0,5,30,19.0760,72.8777,ayanamsa='lahiri')
  

Plot Lagna Chart

    from astrokundali import plot_lagna_chart
    houses = plot_lagna_chart(data, house_system= 'whole_sign') 
      or 
    houses = plot_lagna_chart(data) 
  

Plot Moon/Chandra Chart

from astrokundali import plot_moon_chart
houses = plot_moon_chart(data, house_system= 'whole_sign')
or
houses = plot_moon_chart(data)
Plot Navamsa/Navamsha/D9 Chart

    from astrokundali import plot_navamsa_chart
    houses = plot_navamsa_chart(data, house_system= 'whole_sign') 
      or 
    houses = plot_navamsa_chart(data)
  

Read Astrokundali House Objects

   from astrokundali import format_houses        
   import json
   readable = format_houses(houses) 
   print(json.dumps(readable, indent=2))
  

Get Planetary Positions and Dispositions

    from astrokundali import get_dispositions
    import json
    disp = get_dispositions(data, house_system= 'whole_sign')
      or
    disp = get_dispositions(data)
    print(json.dumps(report, ensure_ascii=False, indent=2)) 
  

Get Interpretation Report

    from astrokundali import generate_report, json_sanitize
    import json
    report  = json_sanitize(generate_report(data, house_system= 'whole_sign'))
      or
    report  = json_sanitize(generate_report(data))
    print(json.dumps(report, ensure_ascii=False, indent=2))
  
  • to use json_sanitize function please install ftfy using pip install ftfy
    Marriage Matching
    from astrokundali import AstroData, match_kundli
    boy = AstroData(1990,1,1,10,0,0,5,30,19.07,72.88)
    girl = AstroData(1992,6,15,16,30,0,5,30,28.61,77.23)
    from pprint import pprint
    pprint(match_kundli(boy, girl))
      or
    from astrokundali import AstroData, match_kundli
    boy = AstroData(1990,1,1,10,0,0,5,30,19.07,72.88,ayanamsa='lahiri')
    girl = AstroData(1992,6,15,16,30,0,5,30,28.61,77.23,ayanamsa='lahiri')
    from pprint import pprint
    pprint(match_kundli(boy, girl, house_system= 'whole_sign')) [Version should be >=0.2.1]
  

Format Match Table in Pandas DataFrame

    from astrokundali import AstroData, match_kundli
    boy = AstroData(1990,1,1,10,0,0,5,30,19.07,72.88)
    girl = AstroData(1992,6,15,16,30,0,5,30,28.61,77.23)
    astro_match = match_kundli(boy, girl)
    print(astro_match['interpretation'])
    import pandas as pd
    df = pd.DataFrame(astro_match['table'])
    df
  

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

astrokundali-0.2.6.tar.gz (78.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

astrokundali-0.2.6-py3-none-any.whl (86.3 kB view details)

Uploaded Python 3

File details

Details for the file astrokundali-0.2.6.tar.gz.

File metadata

  • Download URL: astrokundali-0.2.6.tar.gz
  • Upload date:
  • Size: 78.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for astrokundali-0.2.6.tar.gz
Algorithm Hash digest
SHA256 07b460b306454d2f849cb2dbddc4f0b9e15aec024a023e6f9f0d8c6cff3425fe
MD5 ba75e0c3dbb7ae729f9585d0e9efe510
BLAKE2b-256 c4dbbc50916ec456055e897ccc427de253391357c3785c50df52a84ecadce47a

See more details on using hashes here.

File details

Details for the file astrokundali-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: astrokundali-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 86.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for astrokundali-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 aa82822729201a184934909084eaa233e419648671706d62fed67f720a87314e
MD5 7c0bdd81fb777ccc7a2e6f9d11fa1678
BLAKE2b-256 ddb58503818e5c15618c96e14a0e69d9271a1d942e0e3bb6200940ba0b8d06c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page