|
@@ -0,0 +1,193 @@
|
|
|
|
|
+"""
|
|
|
|
|
+Astronomicon font glyph mapping.
|
|
|
|
|
+
|
|
|
|
|
+Maps astrological entity names to their corresponding ASCII key characters
|
|
|
|
|
+in the Astronomicon font (https://astronomicon.co, OFL licensed).
|
|
|
|
|
+
|
|
|
|
|
+Usage:
|
|
|
|
|
+ from astro_mcp.chart_font import ASTRONOMICON
|
|
|
|
|
+
|
|
|
|
|
+ char = ASTRONOMICON["sun"] # 'Q'
|
|
|
|
|
+ char = ASTRONOMICON["aries"] # 'A'
|
|
|
|
|
+ char = ASTRONOMICON["conjunction"] # '!'
|
|
|
|
|
+"""
|
|
|
|
|
+
|
|
|
|
|
+# ── Zodiac Signs ──────────────────────────────────────────────────────
|
|
|
|
|
+ZODIAC = {
|
|
|
|
|
+ "aries": "A",
|
|
|
|
|
+ "taurus": "B",
|
|
|
|
|
+ "gemini": "C",
|
|
|
|
|
+ "cancer": "D",
|
|
|
|
|
+ "leo": "E",
|
|
|
|
|
+ "virgo": "F",
|
|
|
|
|
+ "libra": "G",
|
|
|
|
|
+ "scorpio": "H",
|
|
|
|
|
+ "sagittarius": "I",
|
|
|
|
|
+ "capricorn": "J", # EU style; US style is backslash
|
|
|
|
|
+ "aquarius": "K",
|
|
|
|
|
+ "pisces": "L",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Planets ───────────────────────────────────────────────────────────
|
|
|
|
|
+PLANETS = {
|
|
|
|
|
+ "moon": "R",
|
|
|
|
|
+ "mercury": "S",
|
|
|
|
|
+ "venus": "T",
|
|
|
|
|
+ "sun": "Q",
|
|
|
|
|
+ "mars": "U",
|
|
|
|
|
+ "jupiter": "V",
|
|
|
|
|
+ "saturn": "W",
|
|
|
|
|
+ "uranus": "X",
|
|
|
|
|
+ "neptune": "Y",
|
|
|
|
|
+ "pluto": "Z",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Nodes, Earth & Lilith ─────────────────────────────────────────────
|
|
|
|
|
+NODES = {
|
|
|
|
|
+ "north_node": "g",
|
|
|
|
|
+ "south_node": "i",
|
|
|
|
|
+ "earth": "h",
|
|
|
|
|
+ "lilith": "z",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Houses & Angles ───────────────────────────────────────────────────
|
|
|
|
|
+# Houses 1-12 use digits 0-9 and : ;
|
|
|
|
|
+# House 1 = '0', House 2 = '1', ..., House 10 = '9', House 11 = ':', House 12 = ';'
|
|
|
|
|
+HOUSES = {str(i): str(i - 1) for i in range(1, 10)} # 1-9 → '0'-'8'
|
|
|
|
|
+HOUSES["10"] = "9"
|
|
|
|
|
+HOUSES["11"] = ":"
|
|
|
|
|
+HOUSES["12"] = ";"
|
|
|
|
|
+
|
|
|
|
|
+ANGLES = {
|
|
|
|
|
+ "ascendant": "c",
|
|
|
|
|
+ "midheaven": "d",
|
|
|
|
|
+ "descendant": "f",
|
|
|
|
|
+ "imum_coeli": "e",
|
|
|
|
|
+ "asc": "c",
|
|
|
|
|
+ "mc": "d",
|
|
|
|
|
+ "dsc": "f",
|
|
|
|
|
+ "ic": "e",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Major Aspects ─────────────────────────────────────────────────────
|
|
|
|
|
+MAJOR_ASPECTS = {
|
|
|
|
|
+ "conjunction": "!",
|
|
|
|
|
+ "sextile": "%",
|
|
|
|
|
+ "square": "#",
|
|
|
|
|
+ "trine": "$",
|
|
|
|
|
+ "opposition": '"',
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Minor Aspects ─────────────────────────────────────────────────────
|
|
|
|
|
+MINOR_ASPECTS = {
|
|
|
|
|
+ "quincunx": "&",
|
|
|
|
|
+ "semi_sextile": "'",
|
|
|
|
|
+ "semi_square": "(",
|
|
|
|
|
+ "sesquisquare": ")",
|
|
|
|
|
+ "biquintile": "*",
|
|
|
|
|
+ "quintile": "+",
|
|
|
|
|
+ "semi_quintile": ",",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Parallels ─────────────────────────────────────────────────────────
|
|
|
|
|
+PARALLELS = {
|
|
|
|
|
+ "parallel": "/",
|
|
|
|
|
+ "contra_parallel": "-",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Asteroids ─────────────────────────────────────────────────────────
|
|
|
|
|
+ASTEROIDS = {
|
|
|
|
|
+ "ceres": "l",
|
|
|
|
|
+ "pallas": "m",
|
|
|
|
|
+ "juno": "n",
|
|
|
|
|
+ "vesta": "o",
|
|
|
|
|
+ "hygiea": "p",
|
|
|
|
|
+ "chiron": "q",
|
|
|
|
|
+ "pholus": "r",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Dwarf Planets ─────────────────────────────────────────────────────
|
|
|
|
|
+DWARF_PLANETS = {
|
|
|
|
|
+ "eris": "s",
|
|
|
|
|
+ "haumea": "t",
|
|
|
|
|
+ "makemake": "u",
|
|
|
|
|
+ "gonggong": "v",
|
|
|
|
|
+ "quaoar": "w",
|
|
|
|
|
+ "sedna": "x",
|
|
|
|
|
+ "orcus": "y",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Uranian Points ────────────────────────────────────────────────────
|
|
|
|
|
+URANIAN = {
|
|
|
|
|
+ "cupido": "¡",
|
|
|
|
|
+ "hades": "¢",
|
|
|
|
|
+ "zeus": "£",
|
|
|
|
|
+ "kronos": "¤",
|
|
|
|
|
+ "apollon": "¥",
|
|
|
|
|
+ "admetos": "¦",
|
|
|
|
|
+ "vulcanus": "§",
|
|
|
|
|
+ "poseidon": "¨",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Lots & Chart Points ───────────────────────────────────────────────
|
|
|
|
|
+LOTS = {
|
|
|
|
|
+ "part_of_fortune": "?",
|
|
|
|
|
+ "part_of_spirit": "@",
|
|
|
|
|
+ "east_point": "j",
|
|
|
|
|
+ "vertex": "k",
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# ── Retrograde marker ─────────────────────────────────────────────────
|
|
|
|
|
+RETROGRADE = "N" # Astronomicon uses 'N' for retrograde subscript
|
|
|
|
|
+
|
|
|
|
|
+# ── Combined lookup ──────────────────────────────────────────────────
|
|
|
|
|
+# Flat dict for simple name → char lookups
|
|
|
|
|
+ALL = {}
|
|
|
|
|
+ALL.update(ZODIAC)
|
|
|
|
|
+ALL.update(PLANETS)
|
|
|
|
|
+ALL.update(NODES)
|
|
|
|
|
+ALL.update(ANGLES)
|
|
|
|
|
+ALL.update(MAJOR_ASPECTS)
|
|
|
|
|
+ALL.update(MINOR_ASPECTS)
|
|
|
|
|
+ALL.update(PARALLELS)
|
|
|
|
|
+ALL.update(ASTEROIDS)
|
|
|
|
|
+ALL.update(DWARF_PLANETS)
|
|
|
|
|
+ALL.update(URANIAN)
|
|
|
|
|
+ALL.update(LOTS)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def glyph(name: str) -> str:
|
|
|
|
|
+ """Return the Astronomicon font character for an astrological entity name.
|
|
|
|
|
+
|
|
|
|
|
+ Args:
|
|
|
|
|
+ name: Entity name, e.g. "sun", "aries", "conjunction", "ascendant"
|
|
|
|
|
+
|
|
|
|
|
+ Returns:
|
|
|
|
|
+ Single ASCII character that renders as the correct glyph in Astronomicon font.
|
|
|
|
|
+
|
|
|
|
|
+ Raises:
|
|
|
|
|
+ KeyError: If name is not found in any mapping.
|
|
|
|
|
+ """
|
|
|
|
|
+ key = name.lower().strip()
|
|
|
|
|
+ if key in ALL:
|
|
|
|
|
+ return ALL[key]
|
|
|
|
|
+ # Try common aliases
|
|
|
|
|
+ aliases = {
|
|
|
|
|
+ "northnode": "north_node",
|
|
|
|
|
+ "southnode": "south_node",
|
|
|
|
|
+ "true_node": "north_node",
|
|
|
|
|
+ "asc": "ascendant",
|
|
|
|
|
+ "mc": "midheaven",
|
|
|
|
|
+ "dsc": "descendant",
|
|
|
|
|
+ "ic": "imum_coeli",
|
|
|
|
|
+ "pof": "part_of_fortune",
|
|
|
|
|
+ "pos": "part_of_spirit",
|
|
|
|
|
+ "inconjunct": "quincunx",
|
|
|
|
|
+ "semisextile": "semi_sextile",
|
|
|
|
|
+ "semisquare": "semi_square",
|
|
|
|
|
+ "sesquiquadrate": "sesquisquare",
|
|
|
|
|
+ "biquintile": "biquintile",
|
|
|
|
|
+ }
|
|
|
|
|
+ if key in aliases:
|
|
|
|
|
+ return ALL[aliases[key]]
|
|
|
|
|
+ raise KeyError(f"Unknown astrological entity: {name!r}")
|