kundli-rs computes a kundli from astronomical inputs.
The most ergonomic entrypoints are [calculate_kundli] and the crate-root
re-exported request/config/result types. Use [calculate_kundli_with_engine]
when you want to inject a custom [AstroEngine] implementation for testing
or alternative data sources.
Quick start
use kundli_rs::{AstroRequest, ChartLayer, ChartSpec, KundliConfig, calculate_kundli};
let request = AstroRequest::new(2451545.0, 37.5665, 126.9780);
let config = KundliConfig::from_request(&request).with_charts(&[
ChartSpec::d1(),
ChartSpec::d9(),
ChartSpec::vimshottari_dasha(),
]);
let result = calculate_kundli(request, config)?;
let d1 = result
.chart(ChartSpec::d1())
.and_then(ChartLayer::as_chart)
.unwrap();
println!("Lagna sign: {:?}", d1.lagna.sign);
# Ok::<(), kundli_rs::KundliError>(())
API overview
A typical workflow is:
- Build an [
AstroRequest]. - Choose a [
KundliConfig]. - Call [
calculate_kundli] or [calculate_kundli_with_engine]. - Inspect the returned [
KundliResult].
[AstroRequest] and [KundliConfig] both carry zodiac, ayanamsha,
house-system, and node-type settings. Use [KundliConfig::from_request]
when you want those duplicated settings to match by construction.