API Reference: Enums
Planet Enum
PlanetCode = Literal['EMPTY', 'AS', 'SU', 'MO', 'MA', 'ME', 'JU', 'VE', 'SA', 'RA', 'KE']
module-attribute
Planets
Bases: IntEnum
Enum to hold planets.
Source code in ndastro_engine/planet_enum.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
astronomical_code
property
Return the astronomical code for the planet.
Returns:
| Name | Type | Description |
|---|---|---|
AstronomicalCode |
AstronomicalCode
|
the astronomical code for the planet |
code
property
color
property
Return the planet color code.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
the planet color code |
from_astronomical_code(code)
staticmethod
Convert planet's astronomical code to planet enum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
AstronomicalCode
|
the planet's astronomical code |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Planets |
Planets
|
the corresponding planet enum |
Source code in ndastro_engine/planet_enum.py
from_code(code)
staticmethod
Convert planet code to planet enum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
PlanetCode
|
the planet code |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Planets |
Planets
|
the corresponding planet enum |
Source code in ndastro_engine/planet_enum.py
to_list()
staticmethod
Convert planet enum to list of planet name.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: list of planet names |
to_string(num)
staticmethod
Convert planet number to display name of the planet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num
|
int
|
the planet number |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
return the planet name |
Source code in ndastro_engine/planet_enum.py
House Enum
HouseCode = Literal['H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'H7', 'H8', 'H9', 'H10', 'H11', 'H12']
module-attribute
Houses
Bases: IntEnum
Enum to hold houses.
Source code in ndastro_engine/house_enum.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
code
property
Get the astronomical code for a given house.
Returns:
| Name | Type | Description |
|---|---|---|
HouseCode |
HouseCode
|
The astronomical code for the house. |
owner
property
Get the owner of a given house.
Returns:
| Name | Type | Description |
|---|---|---|
Planets |
Planets
|
The owner of the house. |
__str__()
from_code(code)
staticmethod
Convert house code to house enum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
HouseCode
|
the house code |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Houses |
Houses
|
the corresponding house enum |
Source code in ndastro_engine/house_enum.py
Nakshatra Enum
NakshatraCode = Literal['N01', 'N02', 'N03', 'N04', 'N05', 'N06', 'N07', 'N08', 'N09', 'N10', 'N11', 'N12', 'N13', 'N14', 'N15', 'N16', 'N17', 'N18', 'N19', 'N20', 'N21', 'N22', 'N23', 'N24', 'N25', 'N26', 'N27']
module-attribute
Nakshatras
Bases: Enum
Enum to hold stars.
Source code in ndastro_engine/nakshatra_enum.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
code
property
Return the astronomical code of the star.
Returns:
| Name | Type | Description |
|---|---|---|
NakshatraCode |
NakshatraCode
|
The astronomical code of the star. |
owner
property
Return the owner (planet) of the star.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Planets
|
The name of the planet that owns the star. |
__str__()
Return the display name of the star.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The display name of the star. |
from_code(code)
staticmethod
Convert a Nakshatra code to its corresponding enum member.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
NakshatraCode
|
The Nakshatra code. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Nakshatras |
Nakshatras
|
The corresponding enum member. |
Source code in ndastro_engine/nakshatra_enum.py
to_list()
staticmethod
Convert enum to list of enum item name.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: list of enum item name |
to_string(num)
staticmethod
Convert star number to display name of the star.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num
|
int
|
the star number |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
return the star name |
Rasi Enum
RasiCode = Literal['R01', 'R02', 'R03', 'R04', 'R05', 'R06', 'R07', 'R08', 'R09', 'R10', 'R11', 'R12']
module-attribute
Rasis
Bases: IntEnum
Enum to represent Rasis.
Source code in ndastro_engine/rasi_enum.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
code
property
Get the astronomical code for a given Rasi.
Returns:
| Name | Type | Description |
|---|---|---|
RasiCode |
RasiCode
|
The astronomical code for the Rasi. |
owner
property
Get the owner planet of a given Rasi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rasi
|
int
|
The Rasi number. |
required |
Returns:
| Type | Description |
|---|---|
Planets | None
|
Planets | None: The owner planet of the Rasi or None if invalid Rasi. |
__str__()
Return a localized string representation of the Rasi.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Localized name of the Rasi. |
from_code(code)
staticmethod
Convert a Rasi code to its corresponding enum member.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
RasiCode
|
The Rasi code. |
required |
Returns:
| Type | Description |
|---|---|
Rasis | None
|
Rasis | None: The corresponding enum member or None if invalid code. |
Source code in ndastro_engine/rasi_enum.py
from_string(rasi)
classmethod
Convert a Rasi name to its corresponding enum member.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rasi
|
str
|
The name of the Rasi. |
required |
Returns:
| Type | Description |
|---|---|
Rasis | None
|
Rasis | None: The corresponding enum member or None if invalid name. |
Source code in ndastro_engine/rasi_enum.py
to_4x4list()
staticmethod
Get a 4x4 grid representation of Rasi names.
Returns:
| Type | Description |
|---|---|
list[list[str]]
|
list[list[str]]: 4x4 grid of Rasi names. |
Source code in ndastro_engine/rasi_enum.py
to_list()
staticmethod
Get a list of all Rasi names.
Returns:
| Type | Description |
|---|---|
list[str]
|
list[str]: List of all Rasi names. |
to_string()
classmethod
Convert a Rasi enum member to its localized display name.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Localized name of the Rasi. |