Knowledge organization and bilingual documentation

简体中文 · Project · Architecture

The knowledge catalog lets you look up English and Chinese names and aliases, read rule definitions, and find the cited books or code. For example, look up the Sun as “Sol” or find Aries’ group in Ashmand’s 1822 edition. These queries need no birth data or chart. Browse the complete catalog, or use the Python queries below. See the API for interfaces and the chart guide for calculation.

Browse without a chart

Use a name or alias with lookup, or a stable ID with concept:

>>> from astrology.knowledge import ConceptKind, SourceVerification, load_catalog
>>> catalog = load_catalog()
>>> catalog.lookup("Sol")[0].identifier
'body.sun'
>>> catalog.lookup("日轮")[0] is catalog.lookup("Sun")[0]
True
>>> len(catalog.list_concepts(kind=ConceptKind.SIGN))
12
>>> catalog.concept("body.sun").configuration.name
'SUN'
>>> [rule.identifier for rule in catalog.list_variants(concept_id="body.sun")]
['rule.project.solar_lunar_returns', 'rule.lilly1647.essential_dignities', 'rule.project.dispositor_chains']
>>> [rule.identifier for rule in catalog.list_variants(concept_id="body.uranus")]
['rule.project.dispositor_chains']
>>> catalog.filter_entries(concept_id="body.sun")[0].identifier
'entry.solar_lunar_returns'
>>> len(catalog.filter_sources(verification=SourceVerification.VERIFIED))
14
>>> print(catalog.entry("entry.cross_aspect_evaluation").statement.text("en"))
Static major cross aspects compare two supplied natal or moment results with distinct left/right endpoints and preserve both complete sources, without a motion field.
>>> print(catalog.variant("rule.project.cusp_ownership").definition.text("en"))
House membership uses half-open intervals [cusp, next cusp): a longitude exactly on a cusp belongs to the house that starts there, and membership wraps across 0/360 degrees.

Read an entry’s explanation with entry.statement.text(language) and a rule’s definition with variant.definition.text(language). The last two calls above print those texts in English; use "zh-CN" for Chinese.

Several names can identify one concept: Sun, Sol and 日轮 all refer to body.sun. A rule variant records a particular definition, such as a house system or lunar-node algorithm. A record that only names a body or a node direction does not need a separate rule. Above, the Sun lookup finds three rules. rule.project.solar_lunar_returns defines the constrained return workflow. rule.lilly1647.essential_dignities records the signs of domicile, exaltation, detriment and fall for the Sun and other classical planets, citing Lilly’s work. rule.project.dispositor_chains defines paths following traditional sign rulers; see the dispositor example. Uranus links only the chain rule, since it can start a path but has no four-status assessment. Retrieve its name record with concept("body.uranus") or lookup("Uranus").

You can also look up the rules for cross-chart aspect comparison. entry.cross_aspect_evaluation is the explanatory entry; rule.project.cross_aspect_evaluation is its linked rule. Retrieving the entry returns the explanation rather than running a comparison:

>>> comparison = catalog.entry("entry.cross_aspect_evaluation")
>>> comparison.prerequisite_status.value, comparison.output_eligibility.value, comparison.chart_applicability
('complete', 'reference_only', 'not_assessed')

Here, complete means the entry has stated its prerequisites, reference_only means it is for reference, and not_assessed means no chart has been checked against those prerequisites. These answer different questions; see status meanings.

The house-overlay explanation is entry.cross_house_overlays. Read rule_ids for its rules, and use catalog.citations() to retrieve the citations and their source records:

>>> overlay = catalog.entry("entry.cross_house_overlays")
>>> overlay.rule_ids
('rule.project.cross_house_overlays', 'rule.project.cusp_ownership')
>>> citation, source = catalog.citations(overlay.identifier)[0]
>>> source.identifier
'source.astrology'
>>> overlay.prerequisite_status.value, overlay.output_eligibility.value, overlay.chart_applicability
('complete', 'reference_only', 'not_assessed')

There are two rules here. rule.project.cross_house_overlays explains how to select objects from each chart independently, distinguish the object and house owners, and retain each chart’s house system. rule.project.cusp_ownership defines the intervals between cusps that determine a longitude’s house. House overlays use that same interval rule.

The source record links to implementation code at a named release tag, so you can check the algorithm and its stated scope. The query above only reads explanations and citations; it does not calculate placements or assess a chart. To calculate placements between two charts, see the house-overlay example.

Return values and errors

Each load_catalog() reads the packaged JSON file without network access or a cache. Record constructors copy input sequences into immutable tuples. Invalid record types, duplicate IDs, links to missing records and conflicting aliases raise TypeError or ValueError.

lookup() normalizes NFC, trims and case-folds, then matches exact names/aliases. It returns an immutable tuple: () for no match, several distinct concepts for ambiguous names. Select language="en" or language="zh-CN" to restrict lookup; omission searches both. Unknown well-formed IDs in getters/filters raise KeyError; malformed strings raise ValueError, non-string IDs TypeError. Entry filters combine all selected criteria; they never evaluate prerequisites.

Follow a source to a definition

The catalog currently includes:

  • Available bodies, axes, house systems, lunar-node definitions and aspects, with their English and Chinese names.

  • How this project divides the zodiac into twelve signs, places objects in houses (including cross-chart overlays), and calculates single-chart and cross-chart aspects.

  • The four sign groups in Ashmand’s 1822 edition, with bibliographic records, excerpts and Chinese translations.

  • Traditional sign rulers and four statuses from William Lilly’s Christian Astrology (1647), with short primary-scan excerpts and a generated sign table.

  • Solar and lunar return definitions, with short original quotations, separate translations, different location practices and explicit project conventions in entry.solar_lunar_returns.

Configuration entries link to the enum members the program uses; rule descriptions link to their implementations. House systems, node definitions and aspect angles have separate explanations of the chosen definitions and their limits. Reference pages take exact aspect angles directly from the calculation code and check the angles in explanatory text against it. The catalog supplies no default orbs or interpretation rules. Dignity assignments belong to astrology.dignities.

For example, inspect the equinoctial-sign entry’s source, excerpt, translation and status:

>>> entry = catalog.entry("entry.equinoctial_example")
>>> citation, source = catalog.citations(entry.identifier)[0]
>>> source.edition
'Davis and Dickson, London, 1822'
>>> citation.excerpt.en.startswith("There are also two equinoctial signs:")
True
>>> citation.excerpt.zh is not None
True
>>> source.verification.value, entry.prerequisite_status.value
('verified', 'unresolved')
>>> entry.output_eligibility.value, entry.chart_applicability
('reference_only', 'not_assessed')
>>> catalog.variant(entry.rule_ids[0]).configuration is None
True

The citation locates Book I, chapter XIV, printed pp. 34–35 (PDF pages 72–73) of Ashmand’s English translation of the paraphrase attributed to Proclus. The catalog example preserves the complete English sentence and a separately credited project Chinese translation. The source explains the name using equal day and night; retaining that historical explanation does not guarantee observed daylight duration. The source has been checked (verified), but the entry’s prerequisites for chart interpretation remain unclear (unresolved). The entry is marked reference_only, for consultation rather than chart conclusions. The entry’s statements, definitions and limits are project explanations, separate from the quotation.

To go the other way, pass a source ID to filter_entries to find entries citing it:

>>> source = catalog.source("source.ptolemy.ashmand1822")
>>> [item.identifier for item in catalog.filter_entries(source_id=source.identifier)]
['entry.sign_vocabulary', 'entry.equinoctial_example', 'entry.ashmand_sign_groups']

Source records give the edition, scan hash, transcription changes and reproduction terms. The package includes limited definition excerpts, not scan images, watermarks or modern website prose. Mirrors and bibliographic records can help confirm an edition; they are not independent evidence for its rules. Code citations identify the release tag, modules and symbols. A definition bearing an author’s name does not mean the formulas in that author’s book have been checked.

The project source record names the release tree used for implementation references. Its edition can differ from a source checkout, whose changes are listed in the source-change notes. Historical source IDs and full revisions remain in its lineage; those inspections do not cover later extensions. The node-test citation names its module and symbols, while the node rule records the comparison’s scope and unresolved source questions.

The hand-written data below illustrates knowing only some of the conditions: the first is true, while the second remains unknown. The catalog does not read this dictionary or change the entry’s chart-applicability status:

>>> partial_evidence = {"condition_a": True, "condition_b": None}
>>> partial_evidence["condition_a"], partial_evidence["condition_b"]
(True, None)
>>> catalog.entry(entry.identifier).chart_applicability
'not_assessed'

All built-in entries are for reference. The package does not check whether a chart satisfies an entry or store chart evidence for that judgment.

Explicit axis vocabulary

axis.ascendant, axis.midheaven, axis.descendant and axis.imum_coeli are separate concepts bound to Axis, not bodies, nodes or cusp aliases. The reference-only entry.axis_aspects states the project’s explicit-selection, pairing and missing-rate policies. Its project-source citation names the axis implementation units at the release tag.

>>> from astrology import Axis
>>> catalog.concept("axis.ascendant").configuration is Axis.ASCENDANT
True
>>> axes = catalog.entry("entry.axis_aspects")
>>> axes.prerequisite_status.value, axes.output_eligibility.value, axes.chart_applicability
('complete', 'reference_only', 'not_assessed')

To calculate the geometry, see explicit natal selection and independent cross-side selection.

Ashmand 1822 sign groups

These groups come from Ashmand’s 1822 Ptolemy’s Tetrabiblos, or Quadripartite. ashmand_sign_group takes a Sign and returns its group:

>>> from astrology import AshmandSignGroup, Sign, ashmand_sign_group
>>> from astrology.knowledge import load_catalog
>>> catalog = load_catalog()
>>> ashmand_sign_group(Sign.ARIES) is AshmandSignGroup.EQUINOCTIAL
True
>>> group = ashmand_sign_group(Sign.CANCER)
>>> group.value
'tropical'
>>> catalog.concept(f"sign_group.ashmand1822.{group.value}").name.text("en")
'Tropical signs'
>>> historical = catalog.entry("entry.ashmand_sign_groups")
>>> historical.prerequisite_status.value, historical.output_eligibility.value, historical.chart_applicability
('complete', 'reference_only', 'not_assessed')

Raw strings and unrelated enums raise TypeError; convert user input to Sign explicitly. The result is a group label, not a score or interpretation. Here, complete means the membership lookup has all its required input: a Sign. The earlier equinoctial entry remains unresolved because prerequisites for chart interpretation are a separate question.

The four labels are tropical, equinoctial, fixed and bicorporeal. Tropical here means the two solstitial signs, not all twelve signs of the tropical zodiac. The rule record and twelve-sign table explain how the membership is derived from the source’s ordering.

The definitions appear in Book I, chapter XIV, printed pp. 34–35 (PDF pp. 72–73), recorded in the source record. The catalog labels English excerpts, credited Chinese translations and project explanations separately, with the extent of each excerpt recorded in its citation.

Elements, modalities and lunation types

Elements, modalities and lunation types use separate kinds and stable IDs: element.*, modality.* and lunation_type.rudhyar1950.*, respectively. See the queries, statistics and lunar phase guide. They describe results, not chart configuration options. The classifications carry no personality interpretation, and reference tables read their definitions directly from calculation code.

The element and modality tables follow Astrodienst’s editorial page; its snapshot and transcription notes are in the source record. The modern modalities (Modality) and historical groups (AshmandSignGroup) are different classifications, although some groups contain the same signs. Their fixed groups agree; the modern mutable group matches Ashmand’s bicorporeal group, and Ashmand’s tropical and equinoctial groups together match the modern cardinal group. Having the same members does not make their names or historical definitions equivalent.

For Python mappings that combine these enum types, see the API note on enum keys.

The lunation convention uses Rudhyar’s eight types in Your Lunation Birthday, Part Four. See the source record for the edition and research status, the intervals and the usage guide for how boundary angles are classified and waxing or waning is determined.

Add a sourced variant

To contribute a definition or variant, follow the source and translation procedure.

Records and ownership

Use stable, language-independent identifiers for concepts, rule variants, sources, and knowledge entries. These are record roles, not a requirement for one class or file per role.

Record

Holds

Concept

Identity, kind, Chinese/English names and aliases, related concepts

Rule variant

Definition, tradition, applicability, implementation reference if executable

Source

Work/author, edition, locator, original language, source lineage, supported claims and limits

Knowledge entry

Statement, linked concepts/rules/sources, prerequisites, exceptions, limits, and editorial status

Keep executable constants and tables with the domain implementation. Knowledge entries link to the rule identifier; generated reference tables read the executable definition. Explanations provide the reasons and scope without becoming a second computational rule table.

Original quotations, translations, and project-authored explanations are different text layers. A translation must identify its original; citing the same source through several translations does not provide independent evidence. Preserve the source’s wording and locator, and document reproduction rights for included material.

Status has several dimensions

Finding a source does not establish a rule’s prerequisites for use in a chart; stating those prerequisites does not establish that a particular chart meets them. The catalog records these questions separately:

Question

Field and values

Meaning

Has the source been checked?

source.verification: verified / unverified

Whether the cited source was inspected, not whether its historical claim is true.

Are the prerequisites clear?

entry.prerequisite_status: complete / unresolved

Whether the prerequisites are understood and fully stated, or something remains unclear.

Can the entry appear in default output?

entry.output_eligibility: eligible / reference_only

An editorial decision; eligible does not mean a chart meets the prerequisites.

Does a chart meet the conditions?

entry.chart_applicability: not_assessed

Catalog lookup does not make this judgment, regardless of the other three fields.

Any future chart-condition evaluator must distinguish satisfied, not satisfied, and unknown. Matching part of a condition must remain partial evidence. For example, a calculated aspect alone cannot establish a statement that also requires sect and dignity when those conditions have not been evaluated.

Related design: bazi.

Bilingual surfaces

  • README.md and README.zh-CN.md provide equivalent project entry points.

  • Guides and explanations use matching paths in docs/en/ and docs/zh-CN/, with links to their language counterpart. Both cover the same supported behavior.

  • Public API documentation exposes Chinese and English descriptions, constraints, and examples. Signatures, units, defaults, identifiers and error behavior are defined once. Public docstring summaries and usage requirements are bilingual; both language views share signatures and parameter tables.

  • A concept or entry has one semantic identity with localized text. Record which semantic revision a translation covers; absence or staleness is visible rather than silently replaced with text in another language.

  • Original excerpts remain in their source language. A reader may choose a translation without losing access to that original.

  • The generated catalog identifies its package version. Checks and semantic review are described in contributing.

Language labels must not change calculation. Distinct definitions must not be collapsed merely because a translation gives them the same display name. Search should support both languages and aliases while returning stable identities.