# nleiaa/ephemerisgen architecture

> Architecture diagram of the GitHub repository nleiaa/ephemerisgen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nleiaa/ephemerisgen
- Repository: https://github.com/nleiaa/ephemerisgen

## Overview

EphemerisGen is a command-line tool for calculating daily zodiac positions and sidereal time for a selected month or year, displaying the results, and optionally exporting them as JSON or CSV. The principal workflow starts at the interactive menu, dispatches to the matching consultation, generates ephemeris data, displays it, and offers export. Yearly generation iterates through months and delegates daily calculations to its date routine; monthly generation calculates its own daily records. The README documents both query modes and export formats. Source excerpts support the shown calls; no other runtime subsystems are evident.

Main entry points: [`EphemerisGen_year.py`](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py) (Year consultation), [`EphemerisGen_month.py`](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py) (Month consultation), [`main.py`](https://github.com/nleiaa/ephemerisgen/blob/main/main.py) (Query menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Interactive CLI"]
  node_menu["Query menu<br/>[main.py]"]
  node_year_consult["Year consultation"]
  node_month_consult["Month consultation"]
end

subgraph group_generation["Ephemeris generation"]
  node_year_generation["Year generator"]
  node_month_generation["Month generator"]
  node_date_calc["Daily calculation"]
end

subgraph group_presentation["Terminal display"]
  node_year_display["Yearly display"]
  node_month_display["Monthly display"]
end

subgraph group_export["Data export"]
  node_year_export["Year exporter"]
  node_month_export["Month exporter"]
end

node_user(("CLI user"))
node_ephem["PyEphem library"]
node_json_file["JSON output"]
node_csv_file["CSV output"]

node_user -->|"selects query"| node_menu
node_menu -->|"dispatches year"| node_year_consult
node_menu -->|"dispatches month"| node_month_consult
node_year_consult -->|"requests year"| node_year_generation
node_year_consult -->|"displays results"| node_year_display
node_year_generation -->|"prints months"| node_year_display
node_year_generation -->|"requests daily data"| node_date_calc
node_date_calc -->|"computes positions"| node_ephem
node_month_consult -->|"requests month"| node_month_generation
node_month_consult -->|"displays results"| node_month_display
node_month_generation -->|"computes positions"| node_ephem
node_year_consult -->|"selects export"| node_year_export
node_month_consult -->|"selects export"| node_month_export
node_year_export -->|"writes JSON"| node_json_file
node_year_export -->|"writes CSV"| node_csv_file
node_month_export -->|"writes JSON"| node_json_file
node_month_export -->|"writes CSV"| node_csv_file

click node_menu "https://github.com/nleiaa/ephemerisgen/blob/main/main.py"
click node_year_consult "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py"
click node_month_consult "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py"
click node_year_generation "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py"
click node_month_generation "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py"
click node_date_calc "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py"
click node_year_display "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py"
click node_month_display "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py"
click node_year_export "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py"
click node_month_export "https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu,node_year_consult,node_month_consult,node_user toneBlue
class node_year_generation,node_month_generation,node_date_calc toneAmber
class node_year_display,node_month_display toneMint
class node_year_export,node_month_export toneRose
class node_ephem,node_json_file,node_csv_file toneIndigo
```

## Components

### Interactive CLI

- [Query menu](https://github.com/nleiaa/ephemerisgen/blob/main/main.py): `main.py`
- [Year consultation](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py): `EphemerisGen_year.py`
- [Month consultation](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py): `EphemerisGen_month.py`

### Ephemeris generation

- [Year generator](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py): `EphemerisGen_year.py`
- [Month generator](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py): `EphemerisGen_month.py`
- [Daily calculation](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py): `EphemerisGen_year.py`

### Terminal display

- [Yearly display](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py): `EphemerisGen_year.py`
- [Monthly display](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py): `EphemerisGen_month.py`

### Data export

- [Year exporter](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_year.py): `EphemerisGen_year.py`
- [Month exporter](https://github.com/nleiaa/ephemerisgen/blob/main/EphemerisGen_month.py): `EphemerisGen_month.py`

### Other components

- **CLI user**
- **PyEphem library**
- **JSON output**
- **CSV output**

## Connections

- CLI user → Query menu: selects query (evidence: `README`)
- Query menu → Year consultation: dispatches year (evidence: `main.py`)
- Query menu → Month consultation: dispatches month (evidence: `main.py`)
- Year consultation → Year generator: requests year (evidence: `EphemerisGen_year.py`)
- Year consultation → Yearly display: displays results (evidence: `EphemerisGen_year.py`)
- Year generator → Yearly display: prints months (evidence: `EphemerisGen_year.py`)
- Year generator → Daily calculation: requests daily data (evidence: `EphemerisGen_year.py`)
- Daily calculation → PyEphem library: computes positions (evidence: `EphemerisGen_year.py`)
- Month consultation → Month generator: requests month (evidence: `EphemerisGen_month.py`)
- Month consultation → Monthly display: displays results (evidence: `EphemerisGen_month.py`)
- Month generator → PyEphem library: computes positions (evidence: `EphemerisGen_month.py`)
- Year consultation → Year exporter: selects export (evidence: `EphemerisGen_year.py`)
- Month consultation → Month exporter: selects export (evidence: `EphemerisGen_month.py`)
- Year exporter → JSON output: writes JSON (evidence: `EphemerisGen_year.py`)
- Year exporter → CSV output: writes CSV (evidence: `EphemerisGen_year.py`)
- Month exporter → JSON output: writes JSON (evidence: `EphemerisGen_month.py`)
- Month exporter → CSV output: writes CSV (evidence: `EphemerisGen_month.py`)
