astro-core
Minimal Rust wrapper around the Swiss Ephemeris C library for computing Sun, Moon, and Ascendant signs from UTC birth data and location.
Features
- Safe Rust API (
calculate_core_chart) returning Sun, Moon, and Ascendant signs. - Uses vendored Swiss Ephemeris C sources compiled via
ccinbuild.rs. - Configurable ephemeris data path (
set_ephe_path); defaults to current dir.
Getting Started
Usage
use ;
If the birth time is unknown, you can use a date-only helper. It returns Sun
sign from the date and leaves Moon/Asc as None:
use ;
Ephemeris Data
- C sources are vendored under
src/swissephand compiled automatically. - Ephemeris data files are not included in the published crate to stay under the crates.io size limit. Download them from the upstream Swiss Ephemeris project (https://github.com/aloistr/swisseph) and point to the directory with
set_ephe_path("/path/to/ephe"). - Swiss Ephemeris is licensed separately; review
src/swisseph/LICENSE.
Development
- Formatting/lint:
cargo fmt,cargo clippy -- -D warnings. - Example run:
cargo run --example basic. - Warnings from the Swiss Ephemeris C code are upstream and expected; silence with
.warnings(false)inbuild.rsif needed.
Author
Volodymyr Lekhman — LinkedIn