Stats
natal.stats
This module provides statistical analysis for natal charts.
It contains the Stats class, which calculates and presents various astrological statistics for a single natal chart or a comparison between two charts.
StatData
Bases: NamedTuple
A named tuple representing statistical data with a title and grid.
Attributes:
Name | Type | Description |
---|---|---|
title |
str
|
The title of the statistical data. |
grid |
Grid
|
A grid containing the statistical information. |
Source code in natal/stats.py
Stats
Statistics for a natal chart data.
This class calculates and presents various astrological statistics for a single natal chart or a comparison between two charts.
Attributes:
Name | Type | Description |
---|---|---|
data1 |
Data
|
The primary natal chart data. |
data2 |
Data | None
|
The secondary natal chart data for comparisons (optional). |
Source code in natal/stats.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
|
aspect: StatData
property
Generate a grid of aspects for the primary chart.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of aspect data, where the grid includes body 1, aspect type, body 2, phase, and orb. |
basic_info: StatData
property
Generate basic information about the provided data.
Returns:
Type | Description |
---|---|
StatData
|
The title and grid of basic information data, where the grid includes name, location coordinates, and UTC time. |
celestial_body: StatData
property
Generate a grid of celestial body positions for the primary chart.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of celestial body data, where the grid includes body name, sign, house, and dignity. |
composite_aspect: StatData
property
Generate a grid of composite aspects between two charts.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of composite aspect data, where the grid includes body names from both charts, aspect type, phase, and orb. |
Raises:
Type | Description |
---|---|
AttributeError
|
If no secondary chart (data2) is available. |
cross_ref: StatData
property
Generate a grid for aspect cross-reference between charts or within a single chart.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of aspect cross-reference data, where the grid shows aspect connections between bodies, with a sum column. |
data2_celestial_body: StatData
property
Generate a grid of celestial body positions for the secondary chart.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of celestial body data for the secondary chart, showing its bodies in the primary chart's context. The grid includes body name, sign, house, and dignity. |
Raises:
Type | Description |
---|---|
AttributeError
|
If no secondary chart (data2) is available. |
hemisphere: StatData
property
Generate a grid of celestial body distribution in hemispheres.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of hemisphere distribution data, where the grid includes hemisphere direction, body count, and body names. |
house: StatData
property
Generate a grid of house data for the primary chart.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of house data, where the grid includes house number, cusp, ruler, ruler sign, and ruler house. |
quadrant: StatData
property
Generate a grid of celestial body distribution in quadrants.
Returns:
Name | Type | Description |
---|---|---|
StatData |
StatData
|
A named tuple containing the title and grid of quadrant distribution data, where the grid includes quadrant name, body count, and body names. |
__init__(data1: Data, data2: Data | None = None) -> None
Initialize the Stats object with one or two natal chart data sets.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data1
|
Data
|
The primary natal chart data. |
required |
data2
|
Data
|
The secondary natal chart data for comparisons. Defaults to None. |
None
|
Source code in natal/stats.py
distribution(kind: DistKind) -> StatData
Generate distribution statistics for elements, modalities, or polarities.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind
|
DistKind
|
The type of distribution to calculate. Must be one of "element", "modality", or "polarity". |
required |
Returns:
Type | Description |
---|---|
StatData
|
The title and grid of distribution data, where the grid includes the distribution type, |
StatData
|
count, and bodies. |
Source code in natal/stats.py
full_report(kind: ReportKind) -> str
Generate a full report containing all statistical tables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind
|
ReportKind
|
The format of the report, either "markdown" or "html". |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted string containing the full statistical report with various tables. |
Source code in natal/stats.py
table_of(fn_name: str, kind: ReportKind, *fn_args: object, **markdown_options: object) -> str
Format a table with a title.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fn_name
|
str
|
The name of the method to call (e.g., "distribution", "celestial_body"). |
required |
kind
|
ReportKind
|
The kind of report to generate ("markdown" or "html"). |
required |
*fn_args
|
object
|
Variable positional arguments passed to the method. |
()
|
**markdown_options
|
object
|
Additional keyword arguments for tabulate formatting. |
{}
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A formatted string containing the titled table in the specified format. |
Source code in natal/stats.py
dignity_of(body: Aspectable) -> str
Get the dignity of a celestial body.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body
|
Aspectable
|
The celestial body to check for dignity. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The dignity of the celestial body. Possible values are "domicile", "detriment", "exaltation", "fall", or an empty string. |