How g-battaglia/kerykeion works
Main Components
• Core Astrology Engine:
• This includes the AstrologicalSubject class (the core “entity” of an individual’s astrological data) and supporting calculations from modules like kerykeion/kr_types, kerykeion/aspects, kerykeion/relationship_score, and kerykeion/enums. These handle point/planet calculations, house systems, zodiac configuration, perspective type, and aspect calculations.
• Chart Generation Component:
• Modules under kerykeion/charts (including templates and themes) and the KerykeionChartSVG class are responsible for generating SVG representations of different types of charts (birth, synastry, transit, composite). This component interacts with the core astrology engine to render visual outputs.
• Report Module:
• The Report class and supporting utilities (like kerykeion/report.py) consolidate astrological data into human-readable text formats.
• Configuration and Settings:
• This includes kerykeion/settings and the configuration file (kr.config.json) that allow users to set custom parameters (like zodiac type, houses system, language, and other constants used by different modules).
• External Data Interfaces:
• The project optionally uses online geolocation (via kerykeion/fetch_geonames.py) and Swiss Ephemeris data (under kerykeion/sweph) for accurate planetary data.
• Utility and Factory Modules:
• Modules like composite_subject_factory.py and utilities.py are support layers providing additional functionalities (e.g., combining two subjects into a composite chart).
Relationships and Interactions
• The AstrologicalSubject acts as the input gateway: it aggregates user input (e.g., birth date, coordinates) and initializes core calculations.
• Once the subject is created, different submodules (aspects, charts, report, etc.) consume this data:
• The aspects modules compute astrological relationships.
• The charts modules generate SVG visuals by taking in data from the subject.
• The report module compiles data into tabular or textual reports.
• Configuration and settings are pulled in by almost every module, ensuring different calculation modes (houses system, perspective, sidereal/tropical, etc.) are consistently applied.
• External data (GeoNames and Swiss Ephemeris) feeds into the AstrologicalSubject to enrich or adjust computation logic based on location and astronomical data.
Architectural Design Patterns and Design Principles
• Modularity: The project is clearly separated into self-contained modules catering to calculation, visualization, and reporting.
• Data Flow Orientation: Inputs (subject data and configuration) flow into the core engine, which then feeds calculated outputs to multiple consumers (e.g., charts, report, aspects, etc.).
• Extensibility: The use of factories (e.g., CompositeSubjectFactory) and utility modules, along with clearly defined enum types, means the system is designed to be extensible for future astrological features.