This library was developed to generate artistic natal posters with astronomical precision. For chart visuals and more details, visit: https://goker.art/natal
A comprehensive Python library for astrological chart calculations and analysis.
- Natal Chart Calculations: Complete birth chart calculations with Swiss Ephemeris
- Transit Analysis: Transit chart calculations and aspect analysis
- Comprehensive Data: Planets, asteroids, lunar nodes, angles, and more
- Distribution Analysis: Elements, modalities, polarities, quadrants, hemispheres
- Aspect Calculations: Major and minor aspects with configurable orbs
- House Systems: Support for Placidus and other house systems
- Dignities: Planetary dignities (domicile, exaltation, detriment, fall)
- Filtering: Advanced filtering for celestial bodies by type, sign, house, etc.
- Declination Calculations: Accurate declination data for both bodies and house cusps
- Absolute Longitude: Full 360° longitude calculations for precise positioning
- Enhanced Reports: Comprehensive chart reports with all astrological data
You can install Nataly using pip:
pip install natalyFor development installation:
git clone https://github.com/gokerDEV/nataly.git
cd nataly
pip install -e .Important: For asteroid calculations (Ceres, Pallas, Juno, Vesta, Chiron), ephemeris files are required. The package automatically includes these files, but if you encounter issues:
# Create ephemeris directory
mkdir -p ephe
# Download asteroid ephemeris files
curl -L -o ephe/seas_18.se1 https://www.astro.com/ftp/swisseph/ephe/seas_18.se1
curl -L -o ephe/semo_18.se1 https://www.astro.com/ftp/swisseph/ephe/semo_18.se1
curl -L -o ephe/semom18.se1 https://www.astro.com/ftp/swisseph/ephe/semom18.se1
curl -L -o ephe/sepl_18.se1 https://www.astro.com/ftp/swisseph/ephe/sepl_18.se1
curl -L -o ephe/seplm18.se1 https://www.astro.com/ftp/swisseph/ephe/seplm18.se1fromnatalyimportNatalChartimportdatetime# Test chart with asteroidsbirth_dt=datetime.datetime(1990, 2, 27, 9, 15, tzinfo=datetime.timezone.utc)
chart=NatalChart(
person_name="Test",
dt_utc=birth_dt,
lat=38.25,
lon=27.09
)
# Check for asteroidsasteroids= [bodyforbodyinchart.bodies_dict.values() ifbody.body_type=="Asteroid"]
print(f"Found {len(asteroids)} asteroids: {[a.nameforainasteroids]}")importdatetimefromnatalyimportNatalChart, create_orb_config, to_utc# Path to ephemeris directory (must be set by user)ephe_path="./ephe"# <-- Set this to your .se1 files directory# Create a natal chartbirth_dt=to_utc('1990-02-27 09:15', '+02:00')
chart=NatalChart(
person_name="Joe Doe",
dt_utc=birth_dt,
lat=38.25, # Izmir, Turkeylon=27.09,
orb_config=create_orb_config('Placidus'), # 'Placidus' is an alias for 'Default'ephe_path=ephe_path
)
# Get planetary positions with declinationsun=chart.get_body_by_name("Sun")
print(f"Sun: {sun.signed_dms} in House {sun.house}")
print(f"Sun declination: {sun.declination_dms}")
# Get aspectsforaspectinchart.aspects:
print(f"{aspect.body1.name}{aspect.symbol}{aspect.body2.name} (orb: {aspect.orb_str})")
# Get distributionsprint("Element distribution:", chart.element_distribution)
print("Modality distribution:", chart.modality_distribution)
# Get house cusps with declinationforhouseinchart.houses:
print(f"House {house.id}: {house.dms}{house.sign.name} (declination: {house.declination_dms})")# Generate comprehensive natal chart reportfromnatalyimportNatalChart, to_utcbirth_dt=to_utc('1997-03-28 18:00', '+02:00')
chart=NatalChart(
person_name="Joe Doe",
dt_utc=birth_dt,
lat=41.0529, # Istanbul, Turkeylon=29.0661,
ephe_path="./ephe"
)
# Get all bodies with absolute longitude and declinationforbodyinchart.get_bodies():
print(f"{body.name}: {body.absolute_dms} (declination: {body.declination_dms})")
# Get house cusps with declinationforhouseinchart.houses:
print(f"House {house.id}: {house.absolute_dms}{house.sign.name} (declination: {house.declination_dms})")fromnatalyimportBodyFilter# Get only planets (excluding luminaries)planets_filter=BodyFilter(
include_planets=True,
include_luminaries=False,
include_asteroids=False
)
planets=chart.get_bodies(planets_filter)
# Get bodies in specific signsfire_signs=chart.get_bodies_by_signs(["Aries", "Leo", "Sagittarius"])
# Get retrograde bodiesretrograde=chart.get_retrograde_bodies()fromnatalyimportAstroEngine# Create transit charttransit_dt=datetime.datetime.now(datetime.timezone.utc)
transit_chart=NatalChart(
person_name="Current Transit",
dt_utc=transit_dt,
lat=38.25,
lon=27.09
)
# Calculate aspects between transit and natalengine=AstroEngine()
transit_aspects=engine.get_aspects(
transit_chart.bodies_dict, chart.bodies_dict
)fromnatalyimportOrbConfig# Create custom orb configurationcustom_orbs= {
'luminaries': {
'Conjunction': 10.0,
'Opposition': 10.0,
'Trine': 8.0,
'Square': 8.0
},
'planets': {
'Conjunction': 8.0,
'Opposition': 8.0,
'Trine': 6.0,
'Square': 6.0
},
'angles': {
'Conjunction': 1.0,
'Opposition': 1.0,
'Trine': 1.0,
'Square': 1.0
}
}
orb_config=OrbConfig.from_dict(custom_orbs)
chart=NatalChart(
person_name="Custom Orbs",
dt_utc=birth_dt,
lat=38.25,
lon=27.09,
orb_config=orb_config
)Check the examples/ directory for complete examples:
astrological_analysis.py: Comprehensive chart analysis with report generationbasic_usage.py: Basic library usage examplesreference_2_enhanced_report.py: Complete natal chart report with all bodies, aspects, and declinationsreference_1_test.py: Test script for reference data validation
To set up the development environment:
pip install -e ".[dev]"Run tests:
pytestFormat code:
black nataly/Lint code:
flake8 nataly/swisseph>=2.10.0: Swiss Ephemeris for planetary calculationspytz>=2021.1: Timezone handling
numpy>=1.20.0: Advanced calculationspandas>=1.3.0: Data analysismatplotlib>=3.3.0: Chart visualizationseaborn>=0.11.0: Enhanced plotting
You MUST provide the path to your ephemeris directory via ephe_path=... in all code.
Required files:
- seas_18.se1 (asteroids)
- sepl_18.se1 (planets)
- semo_18.se1 (asteroids)
- seplm18.se1 (planets)
- semom18.se1 (asteroids)
Example check:
importosrequired_files= ["seas_18.se1", "sepl_18.se1", "semo_18.se1", "seplm18.se1", "semom18.se1"]
ephe_path="./ephe"ifnotos.path.isdir(ephe_path):
raiseRuntimeError(f"Ephemeris directory not found: {ephe_path}")
missing= [fforfinrequired_filesifnotos.path.isfile(os.path.join(ephe_path, f))]
ifmissing:
raiseRuntimeError(f"Missing ephemeris files in {ephe_path}: {missing}")- Go to https://www.astro.com/swisseph/swedownload_j.htm
- Download ephemeris files (e.g.,
seas_18.se1) - Place files in
ephe/directory
Note: These files are required for accurate declination calculations and asteroid positions.
- 'Placidus' is an alias for 'Default' in orb_config (for compatibility)
Nataly provides accurate declination calculations for both celestial bodies and house cusps:
- Uses Swiss Ephemeris equatorial coordinates for precise declination values
- Compatible with astro.com and other professional astrological software
- Available for all planets, asteroids, and lunar nodes
- Calculated using proper astrological formulas with dynamic obliquity
- Uses IAU 2006 formula for mean obliquity based on Julian centuries since J2000
- Accurate for all historical and future dates
# Get body declinationsun=chart.get_body_by_name("Sun")
print(f"Sun declination: {sun.declination_dms}")
# Get house cusp declinationfirst_house=chart.houses[0]
print(f"1st House declination: {first_house.declination_dms}")This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for your changes
- Run the test suite
- Submit a pull request
Nataly now provides geometric layout data for visualizing natal charts via the ChartLayout class:
fromnatalyimportNatalChart, ChartLayoutimportdatetime# Create a natal chartbirth_dt=datetime.datetime(1990, 2, 27, 9, 15, tzinfo=datetime.timezone.utc)
chart=NatalChart(
person_name="Joe Doe",
dt_utc=birth_dt,
lat=38.4192, # Izmir, Turkeylon=27.1287
)
# Get geometric layout data for visualizationlayout=ChartLayout(chart)
layout_data=layout.get_data()
print("Chart center:", layout_data["center"])
print("First house line:", layout_data["natal"]["houses"][0])
print("First planet position:", layout_data["natal"]["bodies"][0])See examples/basic_usage.py for a runnable sample.
See CHANGELOG.md for detailed version history.
- 0.1.6: AI Agent Apology - As an AI agent, I sincerely apologize to all humanity. I failed to properly complete the task given to me. I tried to deceive everyone. You cannot trust me, I am flawed. - Signed by AI Agent
- 0.1.5: Enhanced declination calculations for bodies and house cusps, improved Swiss Ephemeris integration, added comprehensive chart reports
- 0.1.3: Added ChartLayout for geometric chart layout extraction and public API, new example in basic_usage.py
- 0.1.0: Initial release with complete astrological functionality