astroceleste_engine/lib.rs
1//! astroceleste-engine: astrological chart calculation on JPL ephemerides.
2//!
3//! One implementation shared by the Astroceleste server (Python bindings), desktop and
4//! mobile apps (native) and the web app (WASM), so every platform computes identical charts.
5//!
6//! **Experimental (0.0.x):** the API may change in any release.
7//!
8//! ```no_run
9//! use astroceleste_engine::ephemeris::{Kernel, KernelSet, Spk};
10//! use astroceleste_engine::{calculate_chart, ChartRequest, UtcInstant};
11//!
12//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
13//! // Kernels in preference order: the first one covering a date is used.
14//! let mut kernels = KernelSet::new();
15//! kernels.push(Kernel::new("de440s.bsp", Spk::open("kernels/de440s.bsp")?)?);
16//!
17//! let mut request = ChartRequest::new(UtcInstant::parse("1987-05-17T14:30:00Z")?, 41.9, 12.5);
18//! request.house_system = "P";
19//! request.zodiac_type = "sidereal";
20//! request.ayanamsa = "lahiri";
21//!
22//! let chart = calculate_chart(&kernels, &request)?;
23//! println!("{}", serde_json::to_string_pretty(&chart)?);
24//! # Ok(())
25//! # }
26//! ```
27
28mod almanac;
29mod aspects;
30mod catalog;
31mod chart;
32mod chiron;
33mod constants;
34mod derived;
35pub mod ephemeris;
36mod error;
37mod fixed_stars;
38#[doc(hidden)] // exposed for the reduction tests; not part of the API
39pub mod frames;
40mod horary;
41mod houses;
42mod instant;
43mod lots;
44mod lunar;
45mod planets;
46mod pyfloat;
47mod symbolic;
48mod temperament;
49#[doc(hidden)] // exposed for the reduction tests; not part of the API
50pub mod time;
51mod zodiac;
52
53pub use aspects::{Aspect, CrossAspect};
54pub use catalog::LunarMansion;
55pub use chart::{calculate_chart, Chart, ChartRequest, HouseCusp, Placement};
56pub use derived::{
57 calculate_derived_chart, calculate_synastry, calculate_transit_chart, Synastry, TransitChart,
58};
59pub use error::EngineError;
60pub use fixed_stars::FixedStarPosition;
61pub use horary::{
62 calculate_horary_chart, ApplyingAspect, HoraryChart, HoraryData, MoonStatus, PlanetaryHours,
63 SeparatingAspect, Stricture,
64};
65pub use instant::{ParseError, UtcInstant};
66pub use lots::Lot;
67pub use lunar::LunarStatus;
68pub use temperament::{Factor, Qualities, Scores, Temperament};