Skip to content

Constants

natal.const

Constants and utility functions for the natal package.

AspectMember

Bases: Body

Represents an aspect in raw data. (conjunction, opposition, trine, square, sextile)

Source code in natal/const.py
class AspectMember(Body):
    """
    Represents an aspect in raw data.
    (conjunction, opposition, trine, square, sextile)
    """

    ...

Body

Bases: DotDict

Represents a celestial body in raw data. Base class for all members.

Source code in natal/const.py
class Body(DotDict):
    """
    Represents a celestial body in raw data.
    Base class for all members.
    """

    name: str
    symbol: str
    value: int
    color: str

ElementMember

Bases: Body

Represents an element in raw data. (fire, earth, air, water)

Source code in natal/const.py
class ElementMember(Body):
    """
    Represents an element in raw data.
    (fire, earth, air, water)
    """

    ...

ExtraMember

Bases: Body

Represents an extra celestial body in raw data. (e.g. asteroids, nodes)

Source code in natal/const.py
class ExtraMember(Body):
    """
    Represents an extra celestial body in raw data.
    (e.g. asteroids, nodes)
    """

    ...

HouseMember

Bases: Body

Represents a house in raw data.

Source code in natal/const.py
class HouseMember(Body):
    """
    Represents a house in raw data.
    """

    ...

ModalityMember

Bases: Body

Represents a modality in raw data. (cardinal, fixed, mutable)

Source code in natal/const.py
class ModalityMember(Body):
    """
    Represents a modality in raw data.
    (cardinal, fixed, mutable)
    """

    ...

PlanetMember

Bases: Body

Represents a planet in raw data.

Source code in natal/const.py
class PlanetMember(Body):
    """
    Represents a planet in raw data.
    """

    ...

PolarityMember

Bases: Body

Represents a polarity in raw data. (positive, negative)

Source code in natal/const.py
class PolarityMember(Body):
    """
    Represents a polarity in raw data.
    (positive, negative)
    """

    ...

SignMember

Bases: Body

Represents a zodiac sign in raw data.

Source code in natal/const.py
class SignMember(Body):
    """
    Represents a zodiac sign in raw data.
    """

    ruler: str
    detriment: str
    exaltation: str
    fall: str
    classic_ruler: str
    classic_detriment: str
    modality: str
    element: str
    polarity: str

VertexMember

Bases: Body

Represents a vertex in raw data (asc, ic, dsc, mc).

Source code in natal/const.py
class VertexMember(Body):
    """
    Represents a vertex in raw data (asc, ic, dsc, mc).
    """

    ...

get_member(raw_data: dict, name: str) -> DotDict

Get a member from raw data by name.

Parameters:

Name Type Description Default
raw_data dict

The raw data dictionary.

required
name str

The name of the member.

required

Returns:

Name Type Description
DotDict DotDict

The member as a DotDict.

Source code in natal/const.py
def get_member(raw_data: dict, name: str) -> DotDict:
    """
    Get a member from raw data by name.

    Args:
        raw_data (dict): The raw data dictionary.
        name (str): The name of the member.

    Returns:
        DotDict: The member as a DotDict.
    """
    idx = raw_data["name"].index(name)
    member = {key: raw_data[key][idx] for key in raw_data.keys()}
    return DotDict(**member)

get_members(raw_data: dict) -> list[DotDict]

Get all members from raw data.

Parameters:

Name Type Description Default
raw_data dict

The raw data dictionary.

required

Returns:

Type Description
list[DotDict]

list[DotDict]: A list of members as DotDicts.

Source code in natal/const.py
def get_members(raw_data: dict) -> list[DotDict]:
    """
    Get all members from raw data.

    Args:
        raw_data (dict): The raw data dictionary.

    Returns:
        list[DotDict]: A list of members as DotDicts.
    """
    return [get_member(raw_data, name) for name in raw_data["name"]]