@@ -9,6 +9,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
1010### Added
1111
12+ #### Data Analysis Module (December 11, 2025)
13+
14+ New ` stellium.analysis ` package for large-scale astrological data analysis. Requires optional dependency: ` pip install stellium[analysis] `
15+
16+ - ** BatchCalculator** : Efficiently calculate 100s-1000s of charts at once
17+ - Factory methods: ` from_registry() ` (with filters), ` from_natives() ` , ` from_iterable() `
18+ - Fluent configuration: ` .with_house_systems() ` , ` .with_aspects() ` , ` .add_analyzer() `
19+ - Generator-based ` .calculate() ` for memory efficiency or ` .calculate_all() ` for convenience
20+ - Progress tracking via ` .with_progress(callback) `
21+
22+ - ** DataFrame Builders** : Convert charts to pandas DataFrames in three schemas
23+ - ` charts_to_dataframe() ` : One row per chart (sun/moon signs, element counts, patterns, etc.)
24+ - ` positions_to_dataframe() ` : One row per celestial position (for position distribution analysis)
25+ - ` aspects_to_dataframe() ` : One row per aspect (for aspect frequency analysis)
26+
27+ - ** ChartQuery** : Fluent interface for filtering chart collections by astrological criteria
28+ - Position filters: ` where_sun() ` , ` where_moon() ` , ` where_planet() ` , ` where_angle() `
29+ - Aspect filters: ` where_aspect(obj1, obj2, aspect=, orb_max=) `
30+ - Pattern filters: ` where_pattern("Grand Trine") `
31+ - Element/modality: ` where_element_dominant() ` , ` where_modality_dominant() `
32+ - Custom predicates: ` where_custom(lambda chart: ...) `
33+ - Results: ` .results() ` , ` .count() ` , ` .first() ` , ` .to_dataframe() `
34+
35+ - ** ChartStats** : Statistical aggregation across chart collections
36+ - Distributions: ` element_distribution() ` , ` modality_distribution() ` , ` sign_distribution() `
37+ - Frequencies: ` aspect_frequency() ` , ` pattern_frequency() ` , ` retrograde_frequency() `
38+ - Cross-tabulation: ` cross_tab("sun_sign", "moon_sign") ` returns pandas contingency table
39+ - Summary: ` summary() ` returns comprehensive statistics dict
40+
41+ - ** Export Utilities** : Save chart data to files
42+ - ` export_csv(charts, path, schema="charts"|"positions"|"aspects") `
43+ - ` export_json(charts, path, lines=False) ` - standard JSON or JSON Lines
44+ - ` export_parquet(charts, path, schema=...) ` - columnar format for big data
45+
46+ - ** 36 comprehensive tests** in ` tests/test_analysis.py `
47+
48+ - ** Interactive Jupyter Notebook Cookbook** : ` examples/analysis_cookbook.ipynb `
49+ - BatchCalculator usage patterns
50+ - DataFrame conversion examples with pandas
51+ - ChartQuery filtering examples
52+ - ChartStats statistical analysis
53+ - Export utilities
54+ - Full workflow examples (element distribution in scientists vs artists, etc.)
55+
56+ Example usage:
57+
58+ ``` python
59+ from stellium.analysis import BatchCalculator, ChartQuery, ChartStats, charts_to_dataframe
60+
61+ # Calculate charts for all scientists in the registry
62+ charts = (BatchCalculator
63+ .from_registry(category = " scientist" , verified = True )
64+ .with_aspects()
65+ .calculate_all())
66+
67+ # Convert to DataFrame
68+ df = charts_to_dataframe(charts)
69+ print (df[' sun_sign' ].value_counts())
70+
71+ # Query for specific criteria
72+ grand_trines = ChartQuery(charts).where_pattern(" Grand Trine" ).results()
73+
74+ # Statistical analysis
75+ stats = ChartStats(charts)
76+ print (stats.element_distribution())
77+ print (stats.sign_distribution(" Sun" ))
78+ ```
79+
1280### Changed
1381
1482### Fixed
0 commit comments