├── screenshots ├── explanations.png ├── house_chart.png └── shield_chart.png ├── settings.py ├── README.md ├── geomancy.py ├── terminal.py ├── figures.py ├── interface.py ├── charts.py ├── LICENSE └── geomancy_old.py /screenshots/explanations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theratbeing/geomancy/HEAD/screenshots/explanations.png -------------------------------------------------------------------------------- /screenshots/house_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theratbeing/geomancy/HEAD/screenshots/house_chart.png -------------------------------------------------------------------------------- /screenshots/shield_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theratbeing/geomancy/HEAD/screenshots/shield_chart.png -------------------------------------------------------------------------------- /settings.py: -------------------------------------------------------------------------------- 1 | # Settings 2 | 3 | # Change the elementary correspondence of figures. 4 | # 'traditional' : traditional geomantic correspondence. 5 | # 'modern' : Rubeus is Air and Laetitia is Fire. 6 | ELEMENT_SYSTEM = 'modern' 7 | 8 | # Change the zodiacal correspondence of figures. 9 | # 'gerardus' : zodiac based on the figure's associated Lunar mansion (manzil). 10 | # 'agrippa' : zodiac based on the figure's associated planet. 11 | ZODIAC_SYSTEM = 'gerardus' 12 | 13 | # Change how the figures are placed in house chart. Use either 'normal' or 'agrippa'. 14 | HOUSE_SYSTEM = 'normal' 15 | 16 | # Significator of querent (house number - 1) 17 | HOUSE_QUERENT = 0 18 | 19 | # Change the color scheme used to draw the figures in a chart. 20 | # Available options: 'element' 'planet' 'zodiac'. 21 | SHIELD_COLOR_SCHEME = 'element' 22 | HOUSE_COLOR_SCHEME = 'planet' 23 | 24 | # Default log file name and line ending. For line ending use either 'windows' or 'unix' 25 | LOG_DEFAULT_NAME = 'geomancy.log' 26 | LOG_NEWLINE = 'unix' 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # geomancy.py 2 | Python script to generate charts used in geomancy divination method. 3 | 4 | ### NOTICE 5 | If you can compile C please use ramli instead: https://github.com/theratbeing/ramli 6 | 7 | ### Features 8 | * Create shield chart and house chart manually or automatically. 9 | 10 | * Correspondence tables based on Gerardus of Cremona, H.C. Agrippa, and J.M. Greer. 11 | 12 | * Chart analysis: automatically detects modes of perfection and way of points. 13 | 14 | * Color output: figures have different color depending on its correspondence and the chart type. 15 | 16 | 17 | **Avilable chart types:** 18 | 19 | Agrippa/Golden Dawn house chart: Mothers are placed in angular houses, Daughters are placed in succedent houses, Nieces are placed in cadent houses. 20 | 21 | Traditional house chart: figures are placed following the order of their generation. 22 | 23 | Traditional shield chart including the Reconciler. 24 | 25 | ### How to use 26 | Launch it from the terminal/command line with `python3 geomancy.py`. 27 | 28 | ### Dependencies 29 | Python 3.6+ 30 | Terminal emulator with 16-bit ANSI color support 31 | 32 | `geomancy_old.py` only requires Python 3.x with the `--no-color` option. 33 | 34 | ### Screenshots 35 | Traditional shield chart with elemental colors: 36 | 37 | ![Shield chart](/screenshots/shield_chart.png) 38 | 39 | House chart with Hermetic planetary colors: 40 | 41 | ![House chart](/screenshots/house_chart.png) 42 | 43 | Explanation of figures: 44 | 45 | ![Explanations](/screenshots/explanations.png) 46 | -------------------------------------------------------------------------------- /geomancy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Main program 4 | 5 | import sys 6 | import figures 7 | import charts 8 | import interface 9 | import settings 10 | from time import strftime 11 | 12 | # Greet the user 13 | #interface.header() 14 | 15 | # Main loop 16 | while True: 17 | 18 | # main menu 19 | command = interface.menu_main() 20 | 21 | 22 | # if help or exit 23 | if (command == 'h') or (command == 'H'): 24 | interface.menu_help() 25 | continue 26 | 27 | elif (command == 'q') or (command == 'Q'): sys.exit() 28 | else: pass 29 | 30 | # ask significator if applicable 31 | if (command == '9') or (command == '0'): 32 | sub_command = interface.menu_chart_house() 33 | if (sub_command == 'q') or (sub_command == 'Q'): sys.exit() 34 | elif (sub_command == 'r') or (sub_command == 'R'): continue 35 | # python counts from 0 36 | else: quesited = int(sub_command) - 1 37 | else: pass 38 | 39 | # ask for name and question 40 | print(' ') 41 | name = input('Name : ') 42 | question = input('Query: ') 43 | 44 | # automatic generation 45 | if (command == '1') or (command == '3'): raw_chart = figures.generate_figures() 46 | 47 | # manual input 48 | elif (command == '2') or (command == '4'): 49 | seed = interface.ask_four_figures() 50 | raw_chart = figures.generate_figures(seed) 51 | 52 | else: pass 53 | 54 | print(' ') 55 | 56 | # get and show the time 57 | date_time = strftime("%Y-%m-%d %A %H:%M:%S") 58 | print(f'{date_time:^80}') 59 | 60 | # build the chart 61 | if (command == '1') or (command == '2'): 62 | Chart = charts.ShieldChart(raw_chart) 63 | color = settings.SHIELD_COLOR_SCHEME 64 | 65 | elif (command == '9') or (command == '0'): 66 | Chart = charts.HouseChart(raw_chart, settings.HOUSE_SYSTEM, settings.HOUSE_QUERENT, quesited) 67 | color = settings.HOUSE_COLOR_SCHEME 68 | 69 | else: pass 70 | 71 | # draw the chart 72 | Chart.draw() 73 | 74 | while True: 75 | # ask what to do next 76 | command = interface.menu_chart_after() 77 | # quit 78 | if (command == 'q') or (command == 'Q'): sys.exit() 79 | # return to main menu 80 | elif (command == 'r') or (command == 'R'): break 81 | # explain figure meanings 82 | elif (command == 'x') or (command == 'X'): 83 | Chart.explain() 84 | # save to file 85 | elif (command == 's') or (command == 'S'): 86 | interface.save_dialogue(name, question, date_time, Chart) 87 | else: pass 88 | -------------------------------------------------------------------------------- /terminal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Module for terminal display 4 | 5 | Reset = '\u001b[0m' 6 | 7 | Style = {'reset':'\u001b[0m', 8 | 'bold':'\u001b[1m', 9 | 'dim':'\u001b[2m', 10 | 'italic':'\u001b[3m', 11 | 'underline':'\u001b[4m', 12 | 'blink':'\u001b[5m', 13 | 'reverse':'\u001b[7m', 14 | 'conceal':'\u001b[8m', 15 | 'strike':'\u001b[9m', 16 | 'overline':'\u001b[53m', 17 | 'none':''} 18 | 19 | Fore = {'black':'\u001b[30m', 'bright_black':'\u001b[90m', 20 | 'red':'\u001b[31m', 'bright_red':'\u001b[91m', 21 | 'green':'\u001b[32m', 'bright_green':'\u001b[92m', 22 | 'yellow':'\u001b[33m', 'bright_yellow':'\u001b[93m', 23 | 'blue':'\u001b[34m', 'bright_blue':'\u001b[94m', 24 | 'magenta':'\u001b[35m', 'bright_magenta':'\u001b[95m', 25 | 'cyan':'\u001b[36m', 'bright_cyan':'\u001b[96m', 26 | 'white':'\u001b[37m', 'bright_white':'\u001b[97m', 27 | 'none':''} 28 | 29 | Back = {'black':'\u001b[40m', 'bright_black':'\u001b[100m', 30 | 'red':'\u001b[41m', 'bright_red':'\u001b[101m', 31 | 'green':'\u001b[42m', 'bright_green':'\u001b[102m', 32 | 'yellow':'\u001b[43m', 'bright_yellow':'\u001b[103m', 33 | 'blue':'\u001b[44m', 'bright_blue':'\u001b[104m', 34 | 'magenta':'\u001b[45m', 'bright_magenta':'\u001b[105m', 35 | 'cyan':'\u001b[46m', 'bright_cyan':'\u001b[106m', 36 | 'white':'\u001b[47m', 'bright_white':'\u001b[107m', 37 | 'none':''} 38 | 39 | def make_256_table(): 40 | start = (16, 52, 88, 124, 160, 196, 41 | 34, 70, 106, 142, 178, 214) 42 | 43 | for i in range(8): 44 | print(f'\u001b[38;5;{i}m{i:>3} ', end='') 45 | print('') 46 | 47 | for i in range(8, 16): 48 | print(f'\u001b[38;5;{i}m{i:>3} ', end='') 49 | print('\n') 50 | 51 | for row in start: 52 | if row == 34: print('') 53 | for i in range(18): 54 | print(f'\u001b[38;5;{row+i}m{row+i:>3} ', end='') 55 | print('') 56 | 57 | print('') 58 | for i in range(232, 244): 59 | print(f'\u001b[38;5;{i}m{i:>3} ', end='') 60 | print('') 61 | for i in range(244, 256): 62 | print(f'\u001b[38;5;{i}m{i:>3} ', end='') 63 | print(Reset) 64 | 65 | def color_palette(): 66 | 67 | print('Decorations') 68 | for name in Style: 69 | print(f'{Style[name]}{name}{Reset} ', end='') 70 | 71 | print('\n\nStandard Colors') 72 | for name in Fore: 73 | print(f'{Fore[name]}{name} {Reset}', end='') 74 | print('\n') 75 | 76 | for name in Back: 77 | print(f'{Back[name]} {name} {Reset}', end='') 78 | print('') 79 | 80 | print('\n16-bit Colors') 81 | make_256_table() 82 | print(Style['reverse']) 83 | make_256_table() 84 | 85 | def color_8b(text, fg='none', bg='none', st='none'): 86 | return Fore[fg] + Back[bg] + Style[st] + text + Reset 87 | 88 | def fg_16b(text, fg): 89 | return f'\u001b[38;5;{fg}m{text}{Reset}' 90 | 91 | def bg_16b(text, bg): 92 | return f'\u001b[48;5;{bg}m{text}{Reset}' 93 | 94 | def deco(text, style): 95 | return Style[style] + text + Reset 96 | 97 | def esc_16b(number, mode='f'): 98 | if mode == 'f': return f'\u001b[38;5;{number}m' 99 | elif mode == 'b': return f'\u001b[48;5;{number}m' 100 | elif mode == 'x': return f'\u001b[{number}m' 101 | else: raise ValueError('`mode` must be set to either `f`, `b`, or `x`!') 102 | 103 | if __name__ == '__main__': 104 | color_palette() 105 | -------------------------------------------------------------------------------- /figures.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Geomantic Figure Data 4 | 5 | from random import choice 6 | from terminal import esc_16b, Reset, Style 7 | import settings 8 | 9 | VIA, POP = '1111', '2222' 10 | LAE, TRI = '1222', '2221' 11 | RUB, ALB = '2122', '2212' 12 | PUA, PUR = '1211', '1121' 13 | ACQ, AMI = '2121', '1212' 14 | CON, CAR = '2112', '1221' 15 | CAP, CAU = '2111', '1112' 16 | MAJ, MIN = '2211', '1122' 17 | 18 | FIGURES = (VIA, POP, LAE, TRI, RUB, ALB, PUA, PUR, 19 | ACQ, AMI, CON, CAR, CAP, CAU, MAJ, MIN) 20 | 21 | ELF, ELA, ELW, ELE = '🜂 Fire', '🜁 Air', '🜄 Water', '🜃 Earth' 22 | 23 | SAT, JUP, MAR = '♄ Saturn', '♃ Jupiter', '♂ Mars' 24 | SUN, VEN, MER = '☉ Sun', '♀ Venus', '☿ Mercury' 25 | MON, NNO, SNO = '☽ Moon', '☊ North Node', '☋ South Node' 26 | 27 | ZARI, ZTAU, ZGEM = '♈ Aries', '♉ Taurus', '♊ Gemini' 28 | ZCAN, ZLEO, ZVIR = '♋ Cancer', '♌ Leo', '♍ Virgo' 29 | ZLIB, ZSCO, ZSAG = '♎ Libra', '♏ Scorpio', '♐ Sagittarius' 30 | ZCAP, ZAQU, ZPIS = '♑ Capricorn', '♒ Aquarius', '♓ Pisces' 31 | 32 | Name = {VIA:'Via', POP:'Populus', LAE:'Laetitia', TRI:'Tristitia', 33 | RUB:'Rubeus', ALB:'Albus', PUA:'Puella', PUR:'Puer', 34 | ACQ:'Acquisitio', AMI:'Amissio', CON:'Conjunctio', CAR:'Carcer', 35 | CAP:'Caput Draconis', CAU:'Cauda Draconis', MAJ:'Fortuna Major', MIN:'Fortuna Minor'} 36 | 37 | Meaning = {VIA:'Road, journey, change of fortune.', 38 | POP:'Crowd, multitude, assembly. Neutral figure.', 39 | LAE:'Happiness and good health.', 40 | TRI:'Sorrow, illness. Bad except for land and agriculture.', 41 | RUB:'Passion, vice, hot temper. Unfavorable. In 1st position it means the querent is dishonest.', 42 | ALB:'Peace, wisdom, patience. Favorable but weak.', 43 | PUA:'Female, beauty. Good figure but fickle.', 44 | PUR:'Male, power, reckless action. Bad except for love and war.', 45 | ACQ:'Gain.', 46 | AMI:'Loss. Bad for wealth but good for love.', 47 | CON:'Combination, mixed results.', 48 | CAR:'Restriction, obstacle.', 49 | CAP:'Beginnings, ascending movement. Favorable.', 50 | CAU:"Endings, descending movement. Unfavorable. In 1st position it means the querent won't change his/her view.", 51 | MAJ:"Success through one's own effort. Good for beginnings.", 52 | MIN:'Outside help, outer honor, quick result. Good for endings.'} 53 | 54 | s, d = ' ● ', '● ●' 55 | 56 | Shape = {VIA:(s, s, s, s), POP:(d, d, d, d), LAE:(s, d, d, d), TRI:(d, d, d, s), 57 | RUB:(d, s, d, d), ALB:(d, d, s, d), PUA:(s, d, s, s), PUR:(s, s, d, s), 58 | ACQ:(d, s, d, s), AMI:(s, d, s, d), CON:(d, s, s, d), CAR:(s, d, d, s), 59 | CAP:(d, s, s, s), CAU:(s, s, s, d), MAJ:(d, d, s, s), MIN:(s, s, d, d)} 60 | 61 | class Virtue: 62 | 63 | Element = {VIA:ELW, POP:ELW, LAE:ELA, TRI:ELE, 64 | RUB:ELF, ALB:ELW, PUA:ELW, PUR:ELA, 65 | ACQ:ELA, AMI:ELF, CON:ELA, CAR:ELE, 66 | CAP:ELE, CAU:ELF, MAJ:ELE, MIN:ELF} 67 | 68 | if settings.ELEMENT_SYSTEM == 'modern': 69 | Element[RUB], Element[LAE] = ELA, ELF 70 | 71 | Planet = {VIA:MON, POP:MON, LAE:JUP, TRI:SAT, 72 | RUB:MAR, ALB:MER, PUA:VEN, PUR:MAR, 73 | ACQ:JUP, AMI:VEN, CON:MER, CAR:SAT, 74 | CAP:NNO, CAU:SNO, MAJ:SUN, MIN:SUN} 75 | 76 | Zodi_G = {VIA:ZLEO, POP:ZCAP, LAE:ZTAU, TRI:ZSCO, 77 | RUB:ZGEM, ALB:ZCAN, PUA:ZLIB, PUR:ZGEM, 78 | ACQ:ZARI, AMI:ZSCO, CON:ZVIR, CAR:ZPIS, 79 | CAP:ZVIR, CAU:ZSAG, MAJ:ZAQU, MIN:ZTAU} 80 | 81 | Zodi_A = {VIA:ZCAN, POP:ZCAN, LAE:ZPIS, TRI:ZAQU, 82 | RUB:ZSCO, ALB:ZGEM, PUA:ZLIB, PUR:ZARI, 83 | ACQ:ZSAG, AMI:ZTAU, CON:ZVIR, CAR:ZCAP, 84 | CAP:ZVIR, CAU:ZVIR, MAJ:ZLEO, MIN:ZLEO} 85 | 86 | if settings.ZODIAC_SYSTEM == 'agrippa': 87 | Zodiac = Zodi_A 88 | else: Zodiac = Zodi_G 89 | 90 | Mansion = {VIA:"10. Al-Jab'hah", POP:'20. An-Na‘āʾam', 91 | LAE:'4. Ad-Dabarān', TRI:'19. Ash-Shawlah', 92 | RUB:'6. Al-Han‘ah', ALB:'8. An-Nathrah, 9. Aṭ-Ṭarf', 93 | PUA:'5. Al-Haq‘ah', PUR:'15. Al-Ghafr, 16. Az-Zubānā', 94 | ACQ:'1. An-Naṭḥ, 2. Al-Buṭayn', AMI:'17. Al-Iklīl', 95 | CON:'14. As-Simāk', CAR:'28. Ar-Rashāʾ', 96 | CAP:'13. Al-‘Awwāʾ', CAU:'21. Al-Baldah', 97 | MAJ:'3. Ath-Thurayyā', 98 | MIN:'25. Al-ʾAkhbiyyah, 26. Al-Muqdim, 27. Al-Muʾkhar'} 99 | 100 | class Color: 101 | 102 | 'Color correspondences (Golden Dawn Queen Scale) in ANSI 256 color mode. See terminal.py for the palette' 103 | 104 | WHI_N, WHI_B, WHI_D = esc_16b(7), esc_16b(15), esc_16b(250) 105 | BLA_N, BLA_B, BLA_D = esc_16b(0), esc_16b(8), esc_16b(232) 106 | RED_N, RED_B, RED_D = esc_16b(1), esc_16b(9), esc_16b(52) 107 | YEL_N, YEL_B, YEL_D = esc_16b(3), esc_16b(11), esc_16b(214) 108 | BLU_N, BLU_B, BLU_D = esc_16b(4), esc_16b(12), esc_16b(17) 109 | ORA_N, ORA_B, ORA_D = esc_16b(202), esc_16b(208), esc_16b(130) 110 | GRN_N, GRN_B, GRN_D = esc_16b(2), esc_16b(10), esc_16b(22) 111 | PUR_N, PUR_B, PUR_D = esc_16b(128), esc_16b(200), esc_16b(56) 112 | 113 | Element = {ELF:RED_N, ELA:YEL_N, ELW:BLU_N, ELE:GRN_N} 114 | 115 | Planet = {SAT:BLA_B, JUP:BLU_B, MAR:RED_B, 116 | SUN:YEL_B, VEN:GRN_B, MER:ORA_B, 117 | MON:PUR_N, NNO:WHI_N, SNO:WHI_N} 118 | 119 | Zodiac = {ZARI:RED_N, ZLEO:RED_N, ZSAG:RED_N, 120 | ZLIB:YEL_N, ZAQU:YEL_N, ZGEM:YEL_N, 121 | ZCAN:BLU_N, ZSCO:BLU_N, ZPIS:BLU_N, 122 | ZCAP:GRN_N, ZTAU:GRN_N, ZVIR:GRN_N} 123 | 124 | class Figure(object): 125 | 126 | def __init__(self, number): 127 | self.number = number 128 | self.name = Name[number] 129 | self.meaning = Meaning[number] 130 | self.shape = Shape[number] 131 | self.element = Virtue.Element[number] 132 | self.planet = Virtue.Planet[number] 133 | self.zodiac = Virtue.Zodiac[number] 134 | self.mansion = Virtue.Mansion[number] 135 | self.color = {'element':Color.Element[self.element], 136 | 'planet':Color.Planet[self.planet], 137 | 'zodiac':Color.Zodiac[self.zodiac]} 138 | self.symbols = f'{self.color["element"]}{self.element[0:3]} '\ 139 | f'{self.color["planet"]}{self.planet[0:5]} '\ 140 | f'{self.color["zodiac"]}{self.zodiac[0:5]}{Reset}' 141 | self.syms = f'{self.color["element"]}{self.element[0]} '\ 142 | f'{self.color["planet"]}{self.planet[0]} '\ 143 | f'{self.color["zodiac"]}{self.zodiac[0]}{Reset}' 144 | 145 | def info(self, expert=False): 146 | ' expects a Figure object to work' 147 | zod_a, zod_g = Virtue.Zodi_A[self.number], Virtue.Zodi_G[self.number] 148 | 149 | if expert: 150 | print(f'{" "*7}{Style["underline"]}{self.name} ({self.number}){Reset}') 151 | print(f' {self.shape[0]:^5} Element: {self.color["element"]}{self.element:<8}{Reset}') 152 | print(f' {self.shape[1]:^5} Planet : {self.color["planet"]}{self.planet}{Reset}') 153 | print(f' {self.shape[2]:^5} Zodiac : {Color.Zodiac[zod_g]}{zod_g}{Reset} (Gerardus), {Color.Zodiac[zod_a]}{zod_a}{Reset} (Agrippa)') 154 | print(f' {self.shape[3]:^5} Mansion: {self.mansion}') 155 | print(f'{" "*7}Meaning: {self.meaning}\n') 156 | 157 | else: 158 | print(f' {self.shape[0]:^5} {Style["underline"]}{self.name} ({self.number}){Reset}') 159 | print(f' {self.shape[1]:^5} Element: {self.color["element"]}{self.element:<8}{Reset}') 160 | print(f' {self.shape[2]:^5} Planet : {self.color["planet"]}{self.planet}{Reset}') 161 | print(f' {self.shape[3]:^5} Meaning: {self.meaning}\n') 162 | 163 | def link_figures(iterable): 164 | result = list() 165 | for item in iterable: 166 | result.append(Figure(item)) 167 | return result 168 | 169 | def process_figures(fig_a, fig_b): 170 | result = '' 171 | for i in range(4): 172 | if fig_a[i] is fig_b[i]: result = result + '2' 173 | else: result = result + '1' 174 | return result 175 | 176 | def generate_figures(mothers=list()): 177 | result = list() 178 | 179 | if len(mothers) == 4: 180 | for i in range(4): result.append(mothers[i]) 181 | else: 182 | for i in range(4): result.append(choice(FIGURES)) 183 | 184 | for i in range(4): 185 | result.append(result[0][i] + result[1][i] + result[2][i] + result[3][i]) 186 | 187 | for i in range(7): 188 | fi, la = i*2, i*2+1 189 | result.append(process_figures(result[fi], result[la])) 190 | 191 | result.append(process_figures(result[0], result[14])) 192 | 193 | return result 194 | 195 | def generate_complete_figures(): 196 | numbers = generate_figures() 197 | result = list() 198 | for n in numbers: 199 | result.append(Figure(n)) 200 | return result 201 | -------------------------------------------------------------------------------- /interface.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Menus and stuff 4 | 5 | from time import strftime 6 | from terminal import fg_16b, deco, Reset 7 | import settings 8 | import figures 9 | import sys 10 | 11 | def header(): 12 | pass 13 | 14 | def menu_main(): 15 | ' The main menu ' 16 | 17 | window = [fg_16b(' [1] Create shield chart (automatic)', 6), 18 | fg_16b(' [2] Create shield chart (manual input)', 12), 19 | ' ', 20 | fg_16b(' [9] Create house chart (automatic)', 6), 21 | fg_16b(' [0] Create house chart (manual input)', 12), 22 | ' ', 23 | fg_16b(' [H] Help', 3), 24 | fg_16b(' [Q] Quit\n', 1)] 25 | 26 | print(f'\n{"Menu":^40}') 27 | print('─'*40) 28 | for line in window: print(line) 29 | 30 | expected = ('1', '2', '9', '0', 'h', 'H', 'q', 'Q') 31 | while True: 32 | selection = input('Type a character and press enter: ') 33 | if selection in expected: break 34 | else : continue 35 | 36 | return selection 37 | 38 | def menu_chart_after(): 39 | 40 | button = [deco(' S ', 'reverse'), deco(' X ', 'reverse'), deco(' R ', 'reverse'), deco(' Q ', 'reverse'), ' Enter '] 41 | expected = ('s', 'S', 'x', 'X', 'r', 'R', 'q', 'Q') 42 | 43 | while True: 44 | selection = input(f'|{button[0]} Save |{button[1]} Explain meanings |{button[2]} Return |{button[3]} Quit |{button[4]} command: ') 45 | if selection in expected: break 46 | else: continue 47 | 48 | return selection 49 | 50 | def menu_chart_house(): 51 | 52 | window = [fg_16b(' [ 1] The self.', 12), 53 | fg_16b(' [ 2] Money, movable wealth.', 6), 54 | fg_16b(' [ 3] Siblings, communication, neighborhood.', 12), 55 | fg_16b(' [ 4] Parents, land, house, lost item.', 6), 56 | fg_16b(' [ 5] Children and games.', 12), 57 | fg_16b(' [ 6] Health, employees, pets and small animals.', 6), 58 | fg_16b(' [ 7] Spouse, partner, relationship.', 12), 59 | fg_16b(' [ 8] Death, inheritance, the occult.', 6), 60 | fg_16b(' [ 9] Religion, philosophy, education, journeys.', 12), 61 | fg_16b(' [10] Career, government, superiors.', 6), 62 | fg_16b(' [11] Friends and dreams.', 12), 63 | fg_16b(' [12] Imprisonment, enemies, barn and large animals.', 6), 64 | ' ', 65 | fg_16b(' [R ] Return', 3), 66 | fg_16b(' [Q ] Quit\n', 1)] 67 | 68 | expected = ['r', 'R', 'q', 'Q'] 69 | for i in range(1, 13): 70 | expected.append(str(i)) 71 | 72 | print(f'\n{"The Astrological Houses":^53}') 73 | print('─'*53) 74 | for line in window: print(line) 75 | 76 | while True: 77 | selection = input('Select significator for quesited: ') 78 | if selection in expected: break 79 | else: continue 80 | 81 | return selection 82 | 83 | def ask_four_figures(): 84 | print('\nEnter 4 figures in numeric form separated by space e.g. 1122 2212 2112 2111') 85 | print('Type `r` or `random` without quotes to generate random numbers.') 86 | 87 | while True: 88 | seed = input('> ') 89 | 90 | # user types empty string so ask again 91 | if seed == '': continue 92 | # let them use random seed 93 | elif (seed == 'random') or (seed == 'r'): 94 | output = list() 95 | break 96 | else: pass 97 | 98 | # sanitize user input with pattern recognition 99 | pattern = [1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1] 100 | test = list() 101 | for char in seed: 102 | if (char == '1') or (char == '2'): test.append(1) 103 | elif char == ' ': test.append(0) 104 | else: test.append(2) 105 | 106 | if test != pattern: print(fg_16b('Invalid input. Please retry.', 1)) 107 | else: 108 | output = seed.split() 109 | break 110 | 111 | return output 112 | 113 | def save_dialogue(nm, qn, dt, ch): 114 | while True: 115 | # ask for file name. Use default setting if empty 116 | try: filename = input('\nFile name: ') or settings.LOG_DEFAULT_NAME 117 | except KeyboardInterrupt: return 118 | 119 | # set newline character 120 | if settings.LOG_NEWLINE == 'windows': nl = '\r\n' 121 | else: nl = '\n' 122 | 123 | # fetch chart data 124 | content = ch.generate_log_string(nl) 125 | 126 | try: 127 | log = open(filename, 'a+') 128 | log.write(f'Name : {nm}{nl}Query: {qn}{nl}Time :{dt}{nl}{nl}') 129 | log.write(content) 130 | log.write('='*80 + nl) 131 | log.close() 132 | print('File saved successfully.') 133 | return 134 | 135 | except IOError: 136 | print(fg_16b(f'Cannot write to file: {filename}.', 1)) 137 | print('Please try another name or press Ctrl + C to cancel.') 138 | continue 139 | 140 | def name_table(): 141 | 142 | number = ('1111', '1112', '1121', '1122', '1211', '1212', '1221', '1222', 143 | '2111', '2112', '2121', '2122', '2211', '2212', '2221', '2222') 144 | 145 | byname = ('2121', '2212', '1212', '2111', '1221', '1112', '2112', '2211', 146 | '1122', '1222', '2222', '1211', '1121', '2122', '2221', '1111') 147 | 148 | color = (6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12, 6, 12) 149 | 150 | l_col, r_col = list(), list() 151 | 152 | for num in number: r_col.append(f' {num} {figures.Name[num]:<15}') 153 | for num in byname: l_col.append(f' {num} {figures.Name[num]:<15}') 154 | 155 | print(' ') 156 | for i in range(16): print(fg_16b(l_col[i] + ' '*4 + r_col[i], color[i])) 157 | print(' ') 158 | 159 | while True: 160 | 161 | command = input('Please enter the figure\'s number or `r` to return: ') 162 | if command in number: 163 | print(' ') 164 | fig = figures.Figure(command) 165 | fig.info(True) 166 | input('Press Enter to continue...') 167 | return 168 | elif command == 'r' or command == 'R': return 169 | else: continue 170 | 171 | def element_table(): 172 | 173 | fire = ('1112', '1122', '1212', '1222') 174 | air = ('1121', '2121', '2112', '2122') 175 | water = ('1111', '1211', '2212', '2222') 176 | earth = ('1221', '2111', '2211', '2221') 177 | 178 | clr_f = figures.Color.Element[figures.ELF] 179 | clr_a = figures.Color.Element[figures.ELA] 180 | clr_w = figures.Color.Element[figures.ELW] 181 | clr_e = figures.Color.Element[figures.ELE] 182 | 183 | col_f = [f'{clr_f}{figures.ELF:<22}{Reset}'] 184 | col_a = [f'{clr_a}{figures.ELA:<22}{Reset}'] 185 | col_w = [f'{clr_w}{figures.ELW:<22}{Reset}'] 186 | col_e = [f'{clr_e}{figures.ELE:<22}{Reset}'] 187 | 188 | for n in fire: col_f.append(f'{n} {figures.Name[n]:<17}') 189 | for n in air: col_a.append(f'{n} {figures.Name[n]:<17}') 190 | for n in water: col_w.append(f'{n} {figures.Name[n]:<17}') 191 | for n in earth: col_e.append(f'{n} {figures.Name[n]:<17}') 192 | 193 | print(' ') 194 | for l in range(5):print(col_f[l] + ' ' + col_a[l]) 195 | print(' ') 196 | for l in range(5): print(col_w[l] + ' ' + col_e[l]) 197 | print('\nNote: Under traditional system, Laetitia is Air and Rubeus is Fire.') 198 | 199 | input('Press Enter to continue...') 200 | 201 | def planet_table(): 202 | 203 | clr_sat = figures.Color.Planet[figures.SAT] 204 | clr_jup = figures.Color.Planet[figures.JUP] 205 | clr_mar = figures.Color.Planet[figures.MAR] 206 | clr_sun = figures.Color.Planet[figures.SUN] 207 | clr_ven = figures.Color.Planet[figures.VEN] 208 | clr_mer = figures.Color.Planet[figures.MER] 209 | clr_mon = figures.Color.Planet[figures.MON] 210 | clr_nno = figures.Color.Planet[figures.NNO] 211 | clr_sno = figures.Color.Planet[figures.SNO] 212 | 213 | print(' ') 214 | print(f'{clr_sat}{figures.SAT:<13} 1221 Carcer 2221 Tristitia') 215 | print(f'{clr_jup}{figures.JUP:<13} 1222 Laetitia 2121 Acquisitio') 216 | print(f'{clr_mar}{figures.MAR:<13} 1121 Puer 2122 Rubeus') 217 | print(f'{clr_sun}{figures.SUN:<13} 1122 Fortuna Minor 2211 Fortuna Major') 218 | print(f'{clr_ven}{figures.VEN:<13} 1212 Amissio 1211 Puella') 219 | print(f'{clr_mer}{figures.MER:<13} 2112 Conjunctio 2122 Albus') 220 | print(f'{clr_mon}{figures.MON:<13} 1111 Via 2222 Populus') 221 | print(f'{clr_nno}{figures.NNO:<13} 2111 Caput Draconis') 222 | print(f'{clr_sno}{figures.SNO:<13} 1112 Cauda Draconis{Reset}\n') 223 | 224 | input('Press Enter to continue...') 225 | 226 | def zodiac_table(): 227 | 228 | # Create the zodiac column 229 | clr_f = figures.Color.Element[figures.ELF] 230 | clr_a = figures.Color.Element[figures.ELA] 231 | clr_w = figures.Color.Element[figures.ELW] 232 | clr_e = figures.Color.Element[figures.ELE] 233 | 234 | clr_z = list() 235 | for i in range(3): 236 | clr_z.append(clr_f) 237 | clr_z.append(clr_e) 238 | clr_z.append(clr_a) 239 | clr_z.append(clr_w) 240 | 241 | zodiac = [figures.ZARI, figures.ZTAU, figures.ZGEM, figures.ZCAN, 242 | figures.ZLEO, figures.ZVIR, figures.ZLIB, figures.ZSCO, 243 | figures.ZSAG, figures.ZCAP, figures.ZAQU, figures.ZPIS] 244 | 245 | col_z = list() 246 | for i in range(12): 247 | col_z.append(f'{clr_z[i]}{zodiac[i]:<15}') 248 | 249 | # Figure collumn for Gerardus system 250 | col_g = ['2121 Acquisitio' , 251 | '1222 Laetitia 1122 F. Minor' , 252 | '1121 Puer 2122 Rubeus' , 253 | '2212 Albus' , 254 | '1111 Via' , 255 | '2112 Conjunctio 2111 Caput D.' , 256 | '1211 Puella' , 257 | '1212 Amissio 2221 Tristitia' , 258 | '1112 Cauda D.' , 259 | '2222 Populus' , 260 | '2211 F. Major' , 261 | '1221 Carcer' ] 262 | 263 | # Agrippa system 264 | col_a = ['1121 Puer' , 265 | '1212 Amissio' , 266 | '2212 Albus' , 267 | '1111 Via 2222 Populus' , 268 | '2211 F. Major 1122 F. Minor' , 269 | '2112 Conjunctio 2111 Caput D. 1112 Cauda D.', 270 | '1211 Puella' , 271 | '2122 Rubeus' , 272 | '2121 Acquisitio' , 273 | '1221 Carcer' , 274 | '2221 Tristitia' , 275 | '1222 Laetitia' ] 276 | 277 | # Print Gerardus table 278 | print('\n Gerardus of Cremona') 279 | print('─'*40) 280 | for i in range(12): print(col_z[i] + col_g[i]) 281 | print(Reset) 282 | 283 | # Print Agrippa table 284 | print(' Heinrich Cornelius Agrippa') 285 | print('─'*40) 286 | for i in range(12): print(col_z[i] + col_a[i]) 287 | print(Reset) 288 | 289 | input('Press Enter to continue...') 290 | 291 | def menu_help(): 292 | 293 | window = [fg_16b(' [1] List of figures by element', 2), 294 | fg_16b(' [2] List of figures by planet', 12), 295 | fg_16b(' [3] List of figures by zodiac', 2), 296 | fg_16b(' [4] Show detailed info of a figure', 12), 297 | '', 298 | fg_16b(' [R] Return', 3), 299 | fg_16b(' [Q] Quit\n', 1)] 300 | 301 | while True: 302 | print(f'\n{"Select topic":^40}') 303 | print('─'*40) 304 | for l in window: print(l) 305 | cmd = input('Type a character and press Enter: ') 306 | 307 | if cmd == '1' : element_table() 308 | elif cmd == '2': planet_table() 309 | elif cmd == '3': zodiac_table() 310 | elif cmd == '4': name_table() 311 | elif cmd == 'q' or cmd == 'Q': sys.exit() 312 | elif cmd == 'r' or cmd == 'R': return 313 | else: continue 314 | 315 | -------------------------------------------------------------------------------- /charts.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Chart processing and output 4 | 5 | from figures import Figure, link_figures, figure_info 6 | from terminal import Reset, Fore, fg_16b 7 | 8 | court = ['RW', 'LW', 'Ju', 'Rc'] 9 | 10 | class ShieldChart(object): 11 | 12 | def __init__(self, numbers): 13 | 'Make Figure object from a list of numbers and assign them position names in the chart.' 14 | 15 | self.CompleteFigures = list() 16 | for item in numbers: 17 | self.CompleteFigures.append(Figure(item)) 18 | 19 | self.M1, self.M2, self.M3, self.M4 = self.CompleteFigures[0:4] 20 | self.D1, self.D2, self.D3, self.D4 = self.CompleteFigures[4:8] 21 | self.N1, self.N2, self.N3, self.N4 = self.CompleteFigures[8:12] 22 | self.WR = self.CompleteFigures[12] 23 | self.WL = self.CompleteFigures[13] 24 | self.JU = self.CompleteFigures[14] 25 | self.RC = self.CompleteFigures[15] 26 | 27 | # Via Puncti 28 | self.VP_SCORE = 0 29 | self.VP_TABLE = list() 30 | for i in range(15): self.VP_TABLE.append(False) 31 | 32 | # Right witness score +1 33 | if self.JU.number[0] == self.WR.number[0]: 34 | self.VP_SCORE += 1 35 | self.VP_TABLE[0] = True 36 | 37 | # Niece 1 score +3 38 | if self.JU.number[0] == self.N1.number[0]: 39 | self.VP_SCORE += 3 40 | self.VP_TABLE[2] = True 41 | 42 | # Mother 1 43 | if self.JU.number[0] == self.M1.number[0]: 44 | self.VP_SCORE += 15 45 | self.VP_TABLE[6] = True 46 | 47 | # Mother 2 48 | if self.JU.number[0] == self.M2.number[0]: 49 | self.VP_SCORE += 15 50 | self.VP_TABLE[7] = True 51 | 52 | # Niece 2 score +3 53 | if self.JU.number[0] == self.N2.number[0]: 54 | self.VP_SCORE += 3 55 | self.VP_TABLE[3] = True 56 | 57 | # Mother 3 58 | if self.JU.number[0] == self.M3.number[0]: 59 | self.VP_SCORE += 15 60 | self.VP_TABLE[8] = True 61 | 62 | # Mother 4 63 | if self.JU.number[0] == self.M4.number[0]: 64 | self.VP_SCORE += 15 65 | self.VP_TABLE[9] = True 66 | 67 | # Left witness 68 | if self.JU.number[0] == self.WL.number[0]: 69 | self.VP_SCORE += 1 70 | self.VP_TABLE[1] = True 71 | 72 | # Niece 3 73 | if self.JU.number[0] == self.N3.number[0]: 74 | self.VP_SCORE += 3 75 | self.VP_TABLE[4] = True 76 | 77 | # Daughter 1 78 | if self.JU.number[0] == self.D1.number[0]: 79 | self.VP_SCORE += 15 80 | self.VP_TABLE[10] = True 81 | 82 | # Daughter 2 83 | if self.JU.number[0] == self.D2.number[0]: 84 | self.VP_SCORE += 15 85 | self.VP_TABLE[11] = True 86 | 87 | # Niece 4 88 | if self.JU.number[0] == self.N4.number[0]: 89 | self.VP_SCORE += 3 90 | self.VP_TABLE[5] = True 91 | 92 | # Daughter 3 93 | if self.JU.number[0] == self.D3.number[0]: 94 | self.VP_SCORE += 15 95 | self.VP_TABLE[12] = True 96 | 97 | # Daughter 4 98 | if self.JU.number[0] == self.D4.number[0]: 99 | self.VP_SCORE += 15 100 | self.VP_TABLE[13] = True 101 | 102 | 103 | def draw(self, cl='element'): 104 | 'Draw a shield chart on the screen' 105 | 106 | # Left Window and Right Window printed in parallel 107 | print(f'┏{"━━━━━┯"*7}{"━"*5}┓╭{"─"*29}╮') 108 | 109 | # First row: LW - Mothers and Daughters 110 | print(f'┃{8:^5}│{7:^5}│{6:^5}│{5:^5}│{4:^5}│{3:^5}│{2:^5}│{1:^5}┃│{"Mothers":^29}│') 111 | for i in range(4): 112 | print(f'┃{self.D4.color[cl]}{self.D4.shape[i]:^5}{Reset}'\ 113 | f'│{self.D3.color[cl]}{self.D3.shape[i]:^5}{Reset}'\ 114 | f'│{self.D2.color[cl]}{self.D2.shape[i]:^5}{Reset}'\ 115 | f'│{self.D1.color[cl]}{self.D1.shape[i]:^5}{Reset}'\ 116 | f'│{self.M4.color[cl]}{self.M4.shape[i]:^5}{Reset}'\ 117 | f'│{self.M3.color[cl]}{self.M3.shape[i]:^5}{Reset}'\ 118 | f'│{self.M2.color[cl]}{self.M2.shape[i]:^5}{Reset}'\ 119 | f'│{self.M1.color[cl]}{self.M1.shape[i]:^5}{Reset}┃', end='') 120 | 121 | # RW - name and virtues of mothers 122 | cur_fig = self.CompleteFigures[i] 123 | print(f'│ {i+1:>2} {cur_fig.color[cl]}{cur_fig.name:<18}{cur_fig.syms}{Reset} │') 124 | print(f'┠{"─────┴─────┼"*3}{"─"*5}┴{"─"*5}┨│{" "*29}│') 125 | 126 | # Second row: LW Nieces 127 | print(f'┃{12:^11}│{11:^11}│{10:^11}│{9:^11}┃│{"Daughters":^29}│') 128 | 129 | for i in range(4): 130 | print(f'┃{self.N4.color[cl]}{self.N4.shape[i]:^11}{Reset}'\ 131 | f'│{self.N3.color[cl]}{self.N3.shape[i]:^11}{Reset}'\ 132 | f'│{self.N2.color[cl]}{self.N2.shape[i]:^11}{Reset}'\ 133 | f'│{self.N1.color[cl]}{self.N1.shape[i]:^11}{Reset}┃', end ='') 134 | 135 | # RW daughters 136 | cur_fig = self.CompleteFigures[i+4] 137 | print(f'│ {i+5:>2} {cur_fig.color[cl]}{cur_fig.name:<18}{cur_fig.syms}{Reset} │') 138 | 139 | print(f'┠{"─"*11}┴{"─"*11}┼{"─"*11}┴{"─"*11}┨│{" "*29}│') 140 | 141 | # Third row: LW witness 142 | print(f'┃{"LW":^23}│{"RW":^23}┃│{"Nieces":^29}│') 143 | 144 | for i in range(4): 145 | print(f'┃{self.WL.color[cl]}{self.WL.shape[i]:^23}{Reset}'\ 146 | f'│{self.WR.color[cl]}{self.WR.shape[i]:^23}{Reset}┃', end='') 147 | 148 | # RW nieces 149 | cur_fig = self.CompleteFigures[i+8] 150 | print(f'│ {i+9:>2} {cur_fig.color[cl]}{cur_fig.name:<18}{cur_fig.syms}{Reset} │') 151 | 152 | print(f'┠{"─"*23}┴{"─"*17}┬{"─"*5}┨│{" "*29}│') 153 | 154 | # Fourth row: LW judge & reconciler 155 | print(f'┃{"Ju":>24}{" "*17}│{"Rc":^5}┃│{"Court":^29}│') 156 | 157 | for i in range(4): 158 | print(f'┃{self.JU.color[cl]}{self.JU.shape[i]:>25}{Reset}{" "*16}'\ 159 | f'│{self.RC.color[cl]}{self.RC.shape[i]:^5}{Reset}┃', end='') 160 | 161 | # RW court figures 162 | cur_fig = self.CompleteFigures[i+12] 163 | print(f'│ {court[i]:>2} {cur_fig.color[cl]}{cur_fig.name:<18}{cur_fig.syms}{Reset} │') 164 | 165 | print(f'┗{"━"*41}┷{"━"*5}┛╰{"─"*29}╯') 166 | 167 | # Bottom panel for Via Puncti 168 | print(f'╭{"─"*78}╮') 169 | print(f'│{"Way of the Points":^78}│') 170 | 171 | col_1 = [f'│{Fore["black"]} {"Right W.":<14}{Reset}', f'│{" "*15}', 172 | f'│{Fore["black"]} {"Left W.":<14}{Reset}', f'│{" "*15}'] 173 | 174 | if self.VP_TABLE[0]: col_1[0] = '│ Right Witness ' 175 | if self.VP_TABLE[1]: col_1[2] = '│ Left Witness ' 176 | 177 | col_2 = [f'{Fore["black"]} 9{Reset} ', 178 | f'{Fore["black"]} 10{Reset} ', 179 | f'{Fore["black"]} 11{Reset} ', 180 | f'{Fore["black"]} 12{Reset} '] 181 | 182 | if self.VP_TABLE[2]: col_2[0] = f'{Fore["bright_red"]} 9{Reset} ' 183 | if self.VP_TABLE[3]: col_2[1] = f'{Fore["bright_yellow"]} 10{Reset} ' 184 | if self.VP_TABLE[4]: col_2[2] = f'{Fore["bright_blue"]} 11{Reset} ' 185 | if self.VP_TABLE[5]: col_2[3] = f'{Fore["bright_green"]} 12{Reset} ' 186 | 187 | col_3 = [f'{Fore["black"]} 2{Reset} ', 188 | f'{Fore["black"]} 4{Reset} ', 189 | f'{Fore["black"]} 6{Reset} ', 190 | f'{Fore["black"]} 8{Reset} '] 191 | 192 | if self.VP_TABLE[7]: col_3[0] = f'{Fore["bright_red"]} 2{Reset} ' 193 | if self.VP_TABLE[9]: col_3[1] = f'{Fore["bright_yellow"]} 4{Reset} ' 194 | if self.VP_TABLE[11]: col_3[2] = f'{Fore["bright_blue"]} 6{Reset} ' 195 | if self.VP_TABLE[13]: col_3[3] = f'{Fore["bright_green"]} 8{Reset} ' 196 | 197 | col_4 = [f'{Fore["black"]} 1{Reset} ', 198 | f'{Fore["black"]} 3{Reset} ', 199 | f'{Fore["black"]} 5{Reset} ', 200 | f'{Fore["black"]} 7{Reset} '] 201 | 202 | if self.VP_TABLE[6]: col_4[0] = f'{Fore["bright_red"]} 1{Reset} ' 203 | if self.VP_TABLE[8]: col_4[1] = f'{Fore["bright_yellow"]} 3{Reset} ' 204 | if self.VP_TABLE[10]: col_4[2] = f'{Fore["bright_blue"]} 5{Reset} ' 205 | if self.VP_TABLE[12]: col_4[3] = f'{Fore["bright_green"]} 7{Reset} ' 206 | 207 | col_5 = [f'{Fore["black"]} 1st Trip.{Reset}{" "*41}│', 208 | f'{Fore["black"]} 2nd Trip.{Reset}{" "*41}│', 209 | f'{Fore["black"]} 3rd Trip.{Reset}{" "*41}│', 210 | f'{Fore["black"]} 4th Trip.{Reset}{" "*41}│'] 211 | 212 | # If via puncti reaches the end of chart 213 | if self.VP_TABLE[6] or self.VP_TABLE[7]: col_5[0] = f'{Fore["bright_red"]} 1st Triplicity:{Reset} {"personality and habits":<34}│' 214 | if self.VP_TABLE[8] or self.VP_TABLE[9]: col_5[1] = f'{Fore["bright_yellow"]} 2nd Triplicity:{Reset} {"events and influences":<34}│' 215 | if self.VP_TABLE[10] or self.VP_TABLE[11]: col_5[2] = f'{Fore["bright_blue"]} 3rd Triplicity:{Reset} {"frequently visited places":<34}│' 216 | if self.VP_TABLE[12] or self.VP_TABLE[13]: col_5[3] = f'{Fore["bright_green"]} 4th Triplicity:{Reset} {"other people":<34}│' 217 | 218 | # If stops at niece 219 | if self.VP_TABLE[2] and (self.VP_SCORE < 15): col_5[0] = f'{Fore["bright_red"]} 1st Triplicity:{Reset} {"personality and habits":<34}│' 220 | if self.VP_TABLE[3] and (self.VP_SCORE < 15): col_5[1] = f'{Fore["bright_yellow"]} 2nd Triplicity:{Reset} {"events and influences":<34}│' 221 | if self.VP_TABLE[4] and (self.VP_SCORE < 15): col_5[2] = f'{Fore["bright_blue"]} 3rd Triplicity:{Reset} {"frequently visited places":<34}│' 222 | if self.VP_TABLE[5] and (self.VP_SCORE < 15): col_5[3] = f'{Fore["bright_green"]} 4th Triplicity:{Reset} {"other people":<34}│' 223 | 224 | # Merge the collumns 225 | for i in range(4): print(col_1[i] + col_2[i] + col_3[i] + col_4[i] + col_5[i]) 226 | print(f'╰{"─"*78}╯') 227 | # End of function 228 | 229 | def generate_log_string(self, end='\n'): 230 | 'Generate a string to be written into a plain text file' 231 | 232 | output = '' 233 | template = [f'Chart type : Shield chart', 234 | f'-------------------------', 235 | f'1st Mother : {self.M1.number} {self.M1.name:<17} 1st Niece : {self.N1.number} {self.N1.name}', 236 | f'2nd Mother : {self.M2.number} {self.M2.name:<17} 2nd Niece : {self.N2.number} {self.N2.name}', 237 | f'3rd Mother : {self.M3.number} {self.M3.name:<17} 3rd Niece : {self.N3.number} {self.N3.name}', 238 | f'4th Mother : {self.M4.number} {self.M4.name:<17} 4th Niece : {self.N4.number} {self.N4.name}', 239 | f'1st Daught.: {self.D1.number} {self.D1.name:<17} R. Witness : {self.WR.number} {self.WR.name}', 240 | f'2nd Daught.: {self.D2.number} {self.D2.name:<17} L. Witness : {self.WL.number} {self.WL.name}', 241 | f'3rd Daught.: {self.D3.number} {self.D3.name:<17} Judge : {self.JU.number} {self.JU.name}', 242 | f'4th Daught.: {self.D4.number} {self.D4.name:<17} Reconciler : {self.RC.number} {self.RC.name}'] 243 | 244 | for line in template: output += line + end 245 | return output 246 | 247 | def explain(self): 248 | 249 | print('\nThe answer to your question is:') 250 | figure_info(self.JU) 251 | 252 | print('The past is described by:') 253 | figure_info(self.WR) 254 | 255 | print('The future is described by:') 256 | figure_info(self.WL) 257 | 258 | print('The final result is described by:') 259 | figure_info(self.RC) 260 | 261 | 262 | class HouseChart(object): 263 | 264 | def arrange_agrippa(self, numbers): 265 | # We will use the Wheel to check for modes of perfection 266 | self.Mode = 'Agrippa' 267 | self.Wheel = list() 268 | self.Wheel[0] = numbers[0] 269 | self.Wheel[9] = numbers[1] 270 | self.Wheel[6] = numbers[2] 271 | self.Wheel[3] = numbers[3] 272 | self.Wheel[1] = numbers[4] 273 | self.Wheel[10] = numbers[5] 274 | self.Wheel[7] = numbers[6] 275 | self.Wheel[4] = numbers[7] 276 | self.Wheel[2] = numbers[8] 277 | self.Wheel[11] = numbers[9] 278 | self.Wheel[8] = numbers[10] 279 | self.Wheel[5] = numbers[11] 280 | 281 | def __init__(self, numbers, mode='normal', qr=0, qs=6): 282 | ''' 283 | Create a HouseChart object with complete data of the figures. 284 | numbers : a list containing 16 strings of geomantic figure's number of points e.g. '1121' 285 | mode : select chart arrangement system, 'normal' or 'agrippa' 286 | qr : significator house of Querent -1 287 | qd : significator house of Quesited -1 288 | ''' 289 | 290 | # Select the house arrangement system. 291 | if mode == 'normal': self.Mode, self.Wheel = 'normal', numbers[0:12] 292 | else: arrange_agrippa(numbers) 293 | 294 | # Make Figure object from number list. 295 | self.CompleteFigures = link_figures(self.Wheel + numbers[12:16]) 296 | self.H01, self.H02, self.H03 = self.CompleteFigures[0:3] 297 | self.H04, self.H05, self.H06 = self.CompleteFigures[3:6] 298 | self.H07, self.H08, self.H09 = self.CompleteFigures[6:9] 299 | self.H10, self.H11, self.H12 = self.CompleteFigures[9:12] 300 | self.WR = self.CompleteFigures[12] 301 | self.WL = self.CompleteFigures[13] 302 | self.JU = self.CompleteFigures[14] 303 | self.RC = self.CompleteFigures[15] 304 | 305 | # Querent and Quesited are strings from Wheel 306 | self.Querent, self.QuerentPos = self.Wheel[qr], qr 307 | self.Quesited, self.QuesitedPos = self.Wheel[qs], qs 308 | 309 | # Querent 310 | if qr == 11: right = 0 311 | else: right = qr + 1 312 | self.QuerentRight = self.Wheel[right] 313 | self.QuerentRightPos = right 314 | 315 | if qr == 0: left = 11 316 | else: left = qr - 1 317 | self.QuerentLeft = self.Wheel[left] 318 | self.QuerentLeftPos = left 319 | 320 | # Quesited 321 | if qs == 11: right = 0 322 | else: right = qs + 1 323 | self.QuesitedRight = self.Wheel[right] 324 | self.QuesitedRightPos = right 325 | 326 | if qs == 0: left = 11 327 | else: left = qs - 1 328 | self.QuesitedLeft = self.Wheel[left] 329 | self.QuesitedLeftPos = left 330 | 331 | # Check modes of perfection 332 | self.PERFECTION = 0 333 | 334 | # 1. Occupation 335 | if self.Querent == self.Quesited: 336 | self.OCCUPATION = True 337 | self.PERFECTION += 1 338 | else: self.OCCUPATION = False 339 | 340 | # 2. Conjunction 341 | # Querent or Quesited move next to their counterpart 342 | self.CONJUNCTION, self.CONJUNCTION_ACTIVE, self.CONJUNCTION_PASSIVE = False, False, False 343 | 344 | if (self.QuerentRight == self.Quesited) or (self.QuerentLeft == self.Quesited): 345 | self.CONJUNCTION, self.CONJUNCTION_PASSIVE = True, True 346 | 347 | if (self.QuesitedRight == self.Querent) or (self.QuesitedLeft == self.Querent): 348 | self.CONJUNCTION, self.CONJUNCTION_ACTIVE = True, True 349 | 350 | if self.CONJUNCTION: self.PERFECTION += 1 351 | 352 | # Show who approaches whom 353 | if self.CONJUNCTION_ACTIVE and self.CONJUNCTION_PASSIVE and True: 354 | self.CONJUNCTION_SOURCE, self.CONJUNCTION_ACTIVE, self.CONJUNCTION_PASSIVE = 'both sides', False, False 355 | 356 | if self.CONJUNCTION_ACTIVE: self.CONJUNCTION_SOURCE = "querent's side" 357 | if self.CONJUNCTION_PASSIVE: self.CONJUNCTION_SOURCE = "quesited's side" 358 | 359 | # 3. Mutation 360 | # Querent and quesited meet somewhere in the chart 361 | self.MUTATION = False 362 | # Skip certain positions 363 | ignore = (self.QuerentPos, self.QuerentLeftPos, self.QuerentRightPos, self.QuesitedPos, self.QuesitedLeftPos, self.QuesitedRightPos) 364 | 365 | for pos in range(11): 366 | if pos in ignore: 367 | pass 368 | 369 | else: 370 | if (self.Wheel[pos] == self.Querent) and (self.Wheel[pos+1] == self.Quesited): 371 | self.MUTATION, self.MUTATION_POS = True, pos+1 372 | 373 | if self.MUTATION: self.PERFECTION += 1 374 | 375 | # 4. Translation 376 | # Querent and quesited have the same neighbor 377 | self.TRANSLATION, self.TRANSLATION_LEFT, self.TRANSLATION_RIGHT = False, False, False 378 | self.TRANSLATION_POS = '' 379 | 380 | houses = list() 381 | 382 | if (self.QuerentLeft == self.QuesitedLeft) or (self.QuerentLeft == self.QuesitedRight): 383 | self.TRANSLATION = True 384 | houses.append(self.QuerentLeftPos+1) 385 | 386 | if (self.QuerentRight == self.QuesitedLeft) or (self.QuerentRight == self.QuesitedRight): 387 | self.TRANSLATION = True 388 | houses.append(self.QuerentRightPos+1) 389 | 390 | if (self.QuesitedLeft == self.QuerentLeft) or (self.QuesitedLeft == self.QuerentRight): 391 | self.TRANSLATION = True 392 | houses.append(self.QuesitedLeftPos+1) 393 | 394 | if (self.QuesitedRight == self.QuerentLeft) or (self.QuesitedRight == self.QuerentRight): 395 | self.TRANSLATION = True 396 | houses.append(self.QuesitedRightPos+1) 397 | 398 | houses.sort() 399 | for pos in range(len(houses)): 400 | # see if we're at the last item 401 | if pos == (len(houses) - 1): 402 | self.TRANSLATION_POS += f'{houses[pos]}.' 403 | 404 | # not last item 405 | else: 406 | self.TRANSLATION_POS += f'{houses[pos]}, ' 407 | 408 | if self.TRANSLATION: self.PERFECTION += 1 409 | 410 | def draw(self, cl='planet'): 411 | 412 | # Place the strings into a list before printing them to screen. 413 | output = list() 414 | 415 | # Left window (figures and houses) 416 | window_l = list() 417 | window_l.append(f'┏{"━━━━━━━┯"*4}{"━"*7}┓') 418 | 419 | # First row 420 | window_l.append(f'┃{" "*7}│{"11":^7}│{"10":^7}│{"9":^7}│{" "*7}┃') 421 | for i in range(4): 422 | window_l.append(f'┃{" "*7}│{self.H11.color[cl]}{self.H11.shape[i]:^7}{Reset}'\ 423 | f'│{self.H10.color[cl]}{self.H10.shape[i]:^7}{Reset}'\ 424 | f'│{self.H09.color[cl]}{self.H09.shape[i]:^7}{Reset}│{" "*7}┃') 425 | window_l.append(f'┠{"─"*7}┼{"─"*7}┴{"─"*7}┴{"─"*7}┼{"─"*7}┨') 426 | 427 | # Second row 428 | window_l.append(f'┃{"12":^7}│{"LW":>9} {"RW":>7}{" "*6}│{"8":^7}┃') 429 | for i in range(4): 430 | window_l.append(f'┃{self.H12.color[cl]}{self.H12.shape[i]:^7}{Reset}'\ 431 | f'│{self.WL.color[cl]}{self.WL.shape[i]:>9}{Reset}'\ 432 | f' {self.WR.color[cl]}{self.WR.shape[i]:>7}{Reset}{" "*6}'\ 433 | f'│{self.H08.color[cl]}{self.H08.shape[i]:^7}{Reset}┃') 434 | window_l.append(f'┠{"─"*7}┤{" "*23}├{"─"*7}┨') 435 | 436 | # Third row 437 | window_l.append(f'┃{"1":^7}│{"Judge":^23}│{"7":^7}┃') 438 | for i in range(4): 439 | window_l.append(f'┃{self.H01.color[cl]}{self.H01.shape[i]:^7}{Reset}│'\ 440 | f'{self.JU.color[cl]}{self.JU.shape[i]:^23}{Reset}'\ 441 | f'│{self.H07.color[cl]}{self.H07.shape[i]:^7}{Reset}┃') 442 | window_l.append(f'┠{"─"*7}┤{" "*23}├{"─"*7}┨') 443 | 444 | # Fourth row 445 | window_l.append(f'┃{"2":^7}│{"Reconciler":^23}│{"6":^7}┃') 446 | for i in range(4): 447 | window_l.append(f'┃{self.H02.color[cl]}{self.H02.shape[i]:^7}{Reset}│'\ 448 | f'{self.RC.color[cl]}{self.RC.shape[i]:^23}{Reset}'\ 449 | f'│{self.H06.color[cl]}{self.H06.shape[i]:^7}{Reset}┃') 450 | window_l.append(f'┠{"─"*7}┼{"─"*7}┬{"─"*7}┬{"─"*7}┼{"─"*7}┨') 451 | 452 | # Fifth row 453 | window_l.append(f'┃{" "*7}│{"3":^7}│{"4":^7}│{"5":^7}│{" "*7}┃') 454 | for i in range(4): 455 | window_l.append(f'┃{" "*7}│{self.H03.color[cl]}{self.H03.shape[i]:^7}{Reset}'\ 456 | f'│{self.H04.color[cl]}{self.H04.shape[i]:^7}{Reset}'\ 457 | f'│{self.H05.color[cl]}{self.H05.shape[i]:^7}{Reset}│{" "*7}┃') 458 | window_l.append(f'┗{"━━━━━━━┷"*4}{"━"*7}┛') 459 | 460 | # Top window 461 | window_r = list() 462 | window_r.append(f' ╭{"─"*37}╮') 463 | window_r.append(f' │ {self.QuerentPos+1:>2} Significator of querent {" "*9}│') 464 | window_r.append(f' │ {self.QuesitedPos+1:>2} Significator of quesited {" "*8}│') 465 | 466 | # Middle right window 467 | window_r.append(f' ├{"─"*37}┤') 468 | window_r.append(f' │{"Houses":^37}│') 469 | 470 | for i in range(12): 471 | cur_fig = self.CompleteFigures[i] 472 | window_r.append(f' │ {i+1:>2} {cur_fig.color[cl]}{cur_fig.name:<16}{cur_fig.symbols}{Reset} │') 473 | 474 | window_r.append(f' ├{"─"*37}┤') 475 | window_r.append(f' │{"Court":^37}│') 476 | 477 | for i in range(4): 478 | cur_fig = self.CompleteFigures[i+12] 479 | window_r.append(f' │ {court[i]:>2} {cur_fig.color[cl]}{cur_fig.name:<16}{cur_fig.symbols}{Reset} │') 480 | 481 | # Bottom right window 482 | window_r.append(f' ├{"─"*37}┤') 483 | window_r.append(f' │{"Modes of Perfection":^37}│') 484 | 485 | 486 | if self.OCCUPATION: window_r.append(f' │{Fore["bright_green"]}{"✓ Occupation":<37}{Reset}│') 487 | else: window_r.append(f' │{Fore["black"]}{" Occupation":<37}{Reset}│') 488 | 489 | if self.CONJUNCTION: window_r.append(f' │{Fore["bright_green"]}✓ Conjunction from {self.CONJUNCTION_SOURCE:<18}{Reset}│') 490 | else: window_r.append(f' │{Fore["black"]}{" Conjunction":<37}{Reset}│') 491 | 492 | if self.MUTATION: window_r.append(f' │{Fore["bright_green"]}✓ Mutation in house {self.MUTATION_POS:<17}{Reset}│') 493 | else: window_r.append(f' │{Fore["black"]}{" Mutation":<37}{Reset}│') 494 | 495 | if self.TRANSLATION: window_r.append(f' │{Fore["bright_green"]}✓ Translation in houses {self.TRANSLATION_POS:<13}{Reset}│') 496 | else: window_r.append(f' │{Fore["black"]}{" Translation":<37}{Reset}│') 497 | 498 | if self.PERFECTION > 0: window_r.append(f' │{Fore["bright_blue"]}{"✓ This chart perfects":<37}{Reset}│') 499 | else: window_r.append(f' │{Fore["red"]}{" No perfection found":<37}{Reset}│') 500 | 501 | window_r.append(f' ╰{"─"*37}╯') 502 | 503 | # Combine the windows 504 | output = window_l 505 | for line in range(len(window_r)): 506 | output[line] += window_r[line] 507 | 508 | # Print the result 509 | for line in output: 510 | print(line) 511 | 512 | def generate_log_string(self, end='\n'): 513 | 'Generates a string to be written into plain text file' 514 | 515 | output = '' 516 | template = [f'Chart type: House chart/{self.Mode}', 517 | f'-------------------------------', 518 | f'House 1: {self.H01.number} {self.H01.name:<17} R. Witness: {self.WR.number} {self.WR.name}', 519 | f'House 2: {self.H02.number} {self.H02.name:<17} L. Witness: {self.WL.number} {self.WL.name}', 520 | f'House 3: {self.H03.number} {self.H03.name:<17} Judge : {self.JU.number} {self.JU.name}', 521 | f'House 4: {self.H04.number} {self.H04.name:<17} Reconciler: {self.RC.number} {self.RC.name}', 522 | f'House 5: {self.H05.number} {self.H05.name}', 523 | f'House 6: {self.H06.number} {self.H06.name:<17} Querent in house {self.QuerentPos+1}', 524 | f'House 7: {self.H07.number} {self.H07.name:<17} Quesited in house {self.QuesitedPos+1}', 525 | f'House 8: {self.H08.number} {self.H08.name}', 526 | f'House 9: {self.H09.number} {self.H09.name}', 527 | f'House 10: {self.H10.number} {self.H10.name}', 528 | f'House 11: {self.H11.number} {self.H11.name}', 529 | f'House 12: {self.H12.number} {self.H12.name}', 530 | ' ', 531 | f'Modes of Perfection:'] 532 | 533 | if self.PERFECTION == 0: template.append('None') 534 | if self.OCCUPATION: template.append('Translation') 535 | if self.CONJUNCTION: template.append('Conjunction') 536 | if self.MUTATION: template.append(f'Mutation in house {self.MUTATION_POS}') 537 | if self.TRANSLATION: template.append(f'Translation in houses {self.TRANSLATION_POS}') 538 | 539 | for line in template: output += line + end 540 | return output 541 | 542 | def explain(self): 543 | 544 | if self.PERFECTION > 0: 545 | print(fg_16b('\nThe answer to your question is "yes".\n', 10)) 546 | 547 | else: 548 | print(fg_16b('\nThe answer to your question is "no".\n', 9)) 549 | 550 | print('The querent is described by:') 551 | figure_info(Figure(self.Querent)) 552 | 553 | print('The quesited is described by:') 554 | figure_info(Figure(self.Quesited)) 555 | 556 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /geomancy_old.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # Simple geomancy shield chart generator 3 | 4 | import platform 5 | import sys 6 | import random 7 | from time import strftime 8 | 9 | ########## Default settings ########## 10 | # p and k are used to create and display the figures. p=1; k=2 11 | p = " x " 12 | k = "x x" 13 | # They can be changed to whatever symbol you like, e.g. 14 | #p = " o " 15 | #k = "o o" 16 | #p = " * " 17 | #k = "* *" 18 | Interactive = False 19 | Chart = "Shield" 20 | #Chart = "Medieval" 21 | #Chart = "Agrippa" 22 | chart_override = False 23 | significator = 7 24 | sig_override = False 25 | Luddite = False 26 | Double = False 27 | Text = False 28 | Color = True 29 | Logging = True 30 | log_override = False 31 | log_file = "geomancy.log" 32 | 33 | ########## Command line arguments ########## 34 | 35 | for cmd in sys.argv[1:]: 36 | if cmd == sys.argv[0]: 37 | print("[error] Can't write log to self.") 38 | sys.exit() 39 | elif cmd == "-m" or cmd == "--medieval": 40 | Chart = "Medieval" 41 | chart_override = True 42 | elif cmd == "-a" or cmd == "--agrippa": 43 | Chart = "Agrippa" 44 | chart_override = True 45 | elif cmd == "-s" or cmd == "--shield": 46 | Chart = "Shield" 47 | chart_override = True 48 | elif cmd == "-i" or cmd == "--interactive": 49 | Interactive = True 50 | elif cmd == "-I" or cmd == "--instant": 51 | Interactive = False 52 | elif cmd == "-d" or cmd == "--dual": 53 | Double = True 54 | elif cmd == "-q" or cmd == "--quiet": 55 | Logging = False 56 | elif cmd == "-r" or cmd == "--record": 57 | Logging = True 58 | elif cmd == "-c" or cmd == "--color": 59 | Color = True 60 | elif cmd == "-n" or cmd == "--no-color": 61 | Color = False 62 | elif cmd == "-z" or cmd == "--analyze": 63 | Luddite = False 64 | elif cmd == "-l" or cmd == "--luddite": 65 | Luddite = True 66 | elif cmd == "-t" or cmd == "--text": 67 | Text = True 68 | elif cmd == "-g" or cmd == "--graphic": 69 | Text = False 70 | elif cmd[:2] == "s=": 71 | try: 72 | if 0 < int(cmd[2:]) < 13: 73 | significator = int(cmd[2:]) 74 | sig_override = True 75 | else: 76 | print("[error] `s=` option requires a number from 1 to 12") 77 | sys.exit() 78 | except ValueError: 79 | print("[error] `s=` option requires a number from 1 to 12") 80 | sys.exit() 81 | else: 82 | log_file = cmd 83 | log_override = True 84 | 85 | ######### Special characters and strings ######### 86 | 87 | fg_white = "\u001b[37m" 88 | fg_red = "\u001b[31m" 89 | fg_yellow = "\u001b[33m" 90 | fg_green = "\u001b[32m" 91 | fg_greenbright = "\u001b[32;1m" 92 | fg_cyan = "\u001b[36m" 93 | fg_blue = "\u001b[34m" 94 | fg_magenta = "\u001b[35m" 95 | fg_gray = "\u001b[30;1m" 96 | bold = "\u001b[1m" 97 | underline = "\u001b[4m" 98 | reversal = "\u001b[7m" 99 | reset = "\u001b[0m" 100 | 101 | s = " " # whitespace character for layout 102 | nl = "\n" # newline 103 | fatal_error = "[error] Judge is invalid figure! The script is broken :(" 104 | warning_rubeus = "1st Mother is Rubeus. Querent has ulterior motives." 105 | warning_cauda = "1st Mother is Cauda Draconis. Querent won't listen to advice." 106 | 107 | ########## Windows-only settings ########## 108 | 109 | if platform.system() == "Windows": 110 | nl = "\r\n" 111 | if Color: 112 | try: 113 | from colorama import init 114 | init() 115 | except: 116 | Color = False 117 | print("[Error] `colorama` is missing! Color is disabled.") 118 | 119 | ########## Monochrome mode ########## 120 | 121 | if Color == False: 122 | fg_white = None 123 | fg_red = None 124 | fg_yellow = None 125 | fg_green = None 126 | fg_greenbright = None 127 | fg_cyan = None 128 | fg_blue = None 129 | fg_magenta = None 130 | fg_gray = None 131 | bold = None 132 | underline = None 133 | reversal = None 134 | reset = None 135 | 136 | ########## List of geomantic figures ########## 137 | 138 | Populus = [k, k, k, k] #0000 0 139 | Laetitia = [p, k, k, k] #1000 1 140 | Rubeus = [k, p, k, k] #0100 2 141 | FMinor = [p, p, k, k] #1100 3 142 | Albus = [k, k, p, k] #0010 4 143 | Amissio = [p, k, p, k] #1010 5 144 | Conjunctio = [k, p, p, k] #0110 6 145 | Cauda = [p, p, p, k] #1110 7 146 | Tristitia = [k, k, k, p] #0001 8 147 | Carcer = [p, k, k, p] #1001 9 148 | Acquisitio = [k, p, k, p] #0101 10 149 | Puer = [p, p, k, p] #1101 11 150 | FMajor = [k, k, p, p] #0011 12 151 | Puella = [p, k, p, p] #1011 13 152 | Caput = [k, p, p, p] #0111 14 153 | Via = [p, p, p, p] #1111 15 154 | InvalidJudges = [Laetitia, Tristitia, Puer, Puella, Albus, Rubeus, Caput, Cauda] 155 | 156 | FigName = ["Populus", "Laetitia", "Rubeus", "Fortuna Minor", 157 | "Albus", "Amissio", "Conjunctio", "Cauda Draconis", 158 | "Tristitia", "Carcer", "Acquisitio", "Puer", 159 | "Fortuna Major", "Puella", "Caput Draconis", "Via"] 160 | 161 | FigMean = ["Crowd, multitude, assembly. Neutral figure.", 162 | "Happiness, good health.", 163 | "Passion, vice, hot temper. Unfavorable.", 164 | "Outside help, outer honor, quick result. Good for endings.", 165 | "Peace, wisdom, patience. Favorable but weak.", 166 | "Loss. Bad for wealth but good for love.", 167 | "Combination, mixed results.", 168 | "Endings, going away, descending. Unfavorable.", 169 | "Sorrow, illness. Bad except for land and agriculture.", 170 | "Restriction, obstacles.", 171 | "Gain.", 172 | "Male, power, reckless action. Bad except for love and war.", 173 | "Success through one's effort. Good for beginnings.", 174 | "Female, beauty. Good but fickle.", 175 | "Beginnings, moving in, ascending. Favorable.", 176 | "Road, journey, change of fortune."] 177 | 178 | def id_fig(f): 179 | if f == Populus: 180 | return 0 181 | elif f == Laetitia: 182 | return 1 183 | elif f == Rubeus: 184 | return 2 185 | elif f == FMinor: 186 | return 3 187 | elif f == Albus: 188 | return 4 189 | elif f == Amissio: 190 | return 5 191 | elif f == Conjunctio: 192 | return 6 193 | elif f == Cauda: 194 | return 7 195 | elif f == Tristitia: 196 | return 8 197 | elif f == Carcer: 198 | return 9 199 | elif f == Acquisitio: 200 | return 10 201 | elif f == Puer: 202 | return 11 203 | elif f == FMajor: 204 | return 12 205 | elif f == Puella: 206 | return 13 207 | elif f == Caput: 208 | return 14 209 | else: 210 | return 15 211 | 212 | def name_fig(f): 213 | i = id_fig(f) 214 | return FigName[i] 215 | 216 | ########## Color correspondences ########## 217 | 218 | Fire = [Laetitia, FMinor, Amissio, Cauda] 219 | Air = [Puer, Rubeus, Acquisitio, Conjunctio] 220 | Water = [Via, Populus, Albus, Puella] 221 | Earth = [Carcer, Tristitia, Caput, FMajor] 222 | 223 | def colorizeElement(figure): 224 | result = [] 225 | if figure[0:4] in Fire: 226 | for line in figure: 227 | result.append(fg_red + line + reset) 228 | elif figure[0:4] in Air: 229 | for line in figure: 230 | result.append(fg_yellow + line + reset) 231 | elif figure[0:4] in Water: 232 | for line in figure: 233 | result.append(fg_blue + line + reset) 234 | else: 235 | for line in figure: 236 | result.append(fg_green + line + reset) 237 | return result 238 | 239 | def colorizePlanet(figure): 240 | result = [] 241 | if figure[0:4] == Carcer or figure[0:4] == Tristitia: 242 | for line in figure: 243 | result.append(fg_gray + line + reset) 244 | elif figure[0:4] == Laetitia or figure[0:4] == Acquisitio: 245 | for line in figure: 246 | result.append(fg_blue + line + reset) 247 | elif figure[0:4] == Puer or figure[0:4] == Rubeus: 248 | for line in figure: 249 | result.append(fg_red + line + reset) 250 | elif figure[0:4] == FMajor or figure[0:4] == FMinor: 251 | for line in figure: 252 | result.append(fg_yellow + line + reset) 253 | elif figure[0:4] == Amissio or figure[0:4] == Puella: 254 | for line in figure: 255 | result.append(fg_green + line + reset) 256 | elif figure[0:4] == Conjunctio or figure[0:4] == Albus: 257 | for line in figure: 258 | result.append(fg_cyan + line + reset) 259 | elif figure[0:4] == Via or figure[0:4] == Populus: 260 | for line in figure: 261 | result.append(fg_magenta + line + reset) 262 | else: 263 | for line in figure: 264 | result.append(fg_white + line + reset) 265 | return result 266 | 267 | ######### Help Text ########## 268 | 269 | Help = """{1} NAME {0} 270 | 271 | geomancy.py Python script to generate geomantic charts. 272 | 273 | {1} SYNOPSIS {0} 274 | 275 | geomancy.py [options] [s=n] [file] 276 | 277 | {1} DESCRIPTION {0} 278 | 279 | By default, this script generates a geomantic shield chart and logs it into 280 | a plain text file named {4}geomancy.log{0} along with time stamp. Interactive 281 | mode will log the chart into a file named after the querent unless the file 282 | was explicitly mentioned in the command. 283 | 284 | {2}GENERAL OPTIONS{0} 285 | 286 | -i, --interactive Ask questions before generating charts. 287 | -I, --instant Skip questions and generate chart (default). 288 | -c, --color Enable color (default). 289 | -n, --no-color Disable color. 290 | -r, --record Write output to file (default). 291 | -q, --quiet Disable logging. 292 | -h, --help Show this help screen. 293 | file Name of log file to use. 294 | 295 | {2}CHART OPTIONS{0} 296 | 297 | -g, --graphic Draw figures (default). 298 | -t, --text Show only figure names. 299 | -S, --shield Generate shield chart (default). 300 | -m, --medieval Generate house chart with medieval arrangement. 301 | -a, --agrippa Generate house chart with Pseudo-Agrippa's arrangement. 302 | -d, --dual Generate both shield chart and house chart. 303 | s=n, s=1, s=12 Set the house of quesited to house n (default: 7). 304 | -z, --analyze Analyze the chart (default). 305 | -l, --luddite Disable chart analysis. 306 | 307 | {2}SHIELD CHART LAYOUT{0} 308 | 309 | {5}(D4) (D3) {6}(D2) (D1) {4}(M4) (M3) {3}(M2) (M1) 310 | {5}(N4) {6}(N3) {4}(N2) {3}(N1) 311 | {7}(LW) {9}(RW){0} 312 | (JD) (RC) 313 | 314 | M : Mothers RW: Right Witness 315 | D : Daughters LW: Left Witness 316 | N : Nieces JD: Judge 317 | RC: Reconciler 318 | 319 | {2}HOUSE CHART LAYOUT{0} 320 | 321 | {4}(11) {5}(10) {3}( 9) 322 | {6}(12) ( 8) {7}(B) {9}(A) 323 | {3}( 1) {4}( 7){0} (C) 324 | {5}( 2) {5}( 6){0} (D) 325 | {4}( 3) {6}( 4) {3}( 5){0} 326 | 327 | 1-12: Astrological houses C: Judge 328 | A : Right Witness D: Reconciler 329 | B : Left Witness 330 | 331 | Medieval method of geomancy placess the figures in the astrological houses 332 | in order of their generation. Mothers go to Houses 1-4, Daughters go to 333 | Houses 5-8, and Nieces go to Houses 9-12. 334 | 335 | In the {4}Fourth Book of Occult Philosophy{0}, Pseudo-Agrippa gives a different 336 | method of placement. The Mothers are placed in angular houses (1, 10, 7, 4) 337 | the Daughters in succedent houses (2, 11, 8, 5); and the Nieces are placed 338 | in cadent houses (3, 12, 9, 6). This is the method used by {4}Hermetic Order 339 | of Golden Dawn.{0} 340 | 341 | {2}COLOR SCHEME{0} 342 | 343 | {1}Planet Color Element Color {0} 344 | {9}Saturn Gray {3}Fire Red 345 | {6}Jupiter Blue {4}Air Yellow 346 | {3}Mars Red {6}Water Blue 347 | {4}Sun Yellow {5}Earth Green 348 | {5}Venus Green 349 | {7}Mercury Cyan 350 | {8}Moon Magenta 351 | {10}Lunar nodes White{0} 352 | 353 | {1} ANALYSIS {0} 354 | 355 | {3}Please note that chart analysis is experimental and unreliable.{0} 356 | 357 | {2}WAY OF THE POINTS{0} 358 | 359 | {4}Way of the Points{0} or {4}Via Puncti{0} is a method to seek hidden influences 360 | in a situation. Figures with the same top line as the Judge are traced until 361 | it reaches the top or stops midway. Which {4}triplicity{0} the way ended in shows 362 | the source of influence. 363 | 364 | {3}(*){0} 1st Triplicity (M1, M2, N1): querent's personality and habit. 365 | {4}(*){0} 2nd Triplicity (M3, M4, N2): events and actions around the querent. 366 | {6}(*){0} 3rd Triplicity (D1, D2, N3): places frequently visited by querent. 367 | {5}(*){0} 4th Triplicity (D3, D4, N4): people other than querent. 368 | 369 | The figures in each Triplicity are interpreted in the same way as the {4}Court{0} 370 | (Witnesses and Judge). 371 | 372 | {2}MODES OF PERFECTION{0} 373 | 374 | When using a house chart, {4}modes of perfection{0} take precedence over the 375 | Judge. The modes are: 376 | 377 | {5}Occupation :{0} the same figure occupies both houses of querent and quesited. 378 | This is the most favorable answer possible. 379 | {5}Conjunction:{0} one significator moves next to the other significator. 380 | This shows which party is (or should be) taking initiative. 381 | {5}Mutation :{0} both significators appear together elsewhere in the chart. 382 | The event will take place in a roundabout way. 383 | {5}Translation:{0} figure next to significator makes a conjunction. 384 | Help from third party is necessary for success. 385 | 386 | """.format(reset, reversal, underline, fg_red, fg_yellow, fg_green, fg_blue, fg_cyan, fg_magenta, fg_gray, fg_white) 387 | 388 | ########## Interactive mode ########## 389 | 390 | if "-h" in sys.argv or "--help" in sys.argv: 391 | print(Help) 392 | sys.exit() 393 | 394 | if Interactive: 395 | print(fg_magenta + "="*72) 396 | print("Geomantic Chart Generator".center(72)) 397 | print("="*72 + reset + "\n") 398 | querent = input("{}Name : {}".format(fg_greenbright, reset)) 399 | if log_override == False and len(querent) > 0: 400 | log_file = querent + ".log" 401 | query = input("{}Query : {}".format(fg_greenbright, reset)) 402 | if chart_override == False: 403 | print("\n{}{}Select chart type:\n{}".format(fg_yellow, underline, reset)) 404 | print("1. Shield chart\n2. Medieval house chart\n3. Agrippa house chart\n") 405 | asktype = input("{}[1/2/3] {}".format(fg_greenbright, reset)) 406 | if asktype == "2": 407 | Chart = "Medieval" 408 | elif asktype == "3": 409 | Chart = "Agrippa" 410 | else: 411 | Chart = "Shield" 412 | if Chart != "Shield" and sig_override == False: 413 | print("\n{}{}Please select a House to signify the question:{}".format(fg_yellow, underline, reset)) 414 | print(" 1. The querent.") 415 | print(" 2. Movable wealth, personal belongings, finance.") 416 | print(" 3. Communication, neighborhood, siblings, short trip.") 417 | print(" 4. House, parents and inheritance, land and agriculture, lost items.") 418 | print(" 5. Children and games.") 419 | print(" 6. Health, employees, servitude, pets and other small animals.") 420 | print(" 7. Relationship, spouse, partner, other people.") 421 | print(" 8. Death, inheritance from others, magic and occultism.") 422 | print(" 9. Religion, spirituality, philosophy, education, art, long journey.") 423 | print("10. Career, social standing, government, authority figures, weather.") 424 | print("11. Friends, benefactors, luck, desired things.") 425 | print("12. Imprisonment, hardships, enemies, large animals.\n") 426 | while True: 427 | sign = int(input("{}[1-12] {}".format(fg_greenbright, reset))) 428 | try: 429 | if 0 < sign < 13: 430 | significator = sign 431 | break 432 | else: 433 | print("{}Please enter a number between 1 to 12!{}".format(fg_red, reset)) 434 | except: 435 | print("{}Please enter a number between 1 to 12!{}".format(fg_red, reset)) 436 | print(" ") 437 | 438 | ########## Chart processing starts here ########## 439 | 440 | log = None 441 | if Logging: 442 | log = open(log_file, "a+") 443 | 444 | CurrentTime = strftime("%Y-%m-%d (%a) %H:%M:%S") 445 | RawData = [] 446 | for x in range(16): 447 | RawData.append(random.choice([p, k])) 448 | 449 | MotherA = RawData[0:4] 450 | MotherB = RawData[4:8] 451 | MotherC = RawData[8:12] 452 | MotherD = RawData[12:16] 453 | 454 | DaughterA = [MotherA[0], MotherB[0], MotherC[0], MotherD[0]] 455 | DaughterB = [MotherA[1], MotherB[1], MotherC[1], MotherD[1]] 456 | DaughterC = [MotherA[2], MotherB[2], MotherC[2], MotherD[2]] 457 | DaughterD = [MotherA[3], MotherB[3], MotherC[3], MotherD[3]] 458 | 459 | # Function to process the figures 460 | def xorFigures(fig1, fig2): 461 | result = [] 462 | for line in range(4): 463 | if fig1[line] == fig2[line]: 464 | result.append(k) 465 | else: 466 | result.append(p) 467 | return result 468 | 469 | # Create the rest of the chart 470 | NieceA = xorFigures(MotherA, MotherB) 471 | NieceB = xorFigures(MotherC, MotherD) 472 | NieceC = xorFigures(DaughterA, DaughterB) 473 | NieceD = xorFigures(DaughterC, DaughterD) 474 | WitnessA = xorFigures(NieceA, NieceB) 475 | WitnessB = xorFigures(NieceC, NieceD) 476 | Judge = xorFigures(WitnessA, WitnessB) 477 | Reconciler = xorFigures(Judge, MotherA) 478 | 479 | ########## Integrity check ########## 480 | if Judge in InvalidJudges: 481 | print(fg_red + fatal_error + reset) 482 | log.write(nl + fatal_error + nl) 483 | ###################################### 484 | 485 | # Arrangements for log file 486 | rawShield = [MotherA, MotherB, MotherC, MotherD, 487 | DaughterA, DaughterB, DaughterC, DaughterD, 488 | NieceA, NieceB, NieceC, NieceD, 489 | WitnessA, WitnessB, Judge, Reconciler] 490 | 491 | rawHouse = [MotherA, MotherB, MotherC, MotherD, 492 | DaughterA, DaughterB, DaughterC, DaughterD, 493 | NieceA, NieceB, NieceC, NieceD, 494 | WitnessA, WitnessB, Judge, Reconciler] 495 | 496 | if Chart == "Agrippa": 497 | rawHouse = [MotherA, DaughterA, NieceA, 498 | MotherD, DaughterD, NieceD, 499 | MotherC, DaughterC, NieceC, 500 | MotherB, DaughterB, NieceB, 501 | WitnessA, WitnessB, Judge, Reconciler] 502 | 503 | def addNameFigures(arrg): 504 | result = [] 505 | for fig in arrg: 506 | tmp = fig 507 | tmp.append(name_fig(fig)) 508 | result.append(tmp) 509 | return result 510 | 511 | FigureShield = addNameFigures(rawShield) 512 | FigureHouse = addNameFigures(rawHouse) 513 | 514 | # Screen output and color 515 | OutputShield = [] 516 | OutputHouse = [] 517 | 518 | for figure in FigureShield: 519 | OutputShield.append(colorizeElement(figure)) 520 | for figure in FigureHouse: 521 | OutputHouse.append(colorizePlanet(figure)) 522 | 523 | ########## Chart-drawing functions ########## 524 | 525 | ShieldLabel = ["1st Mother :", "2nd Mother :", "3rd Mother :", "4th Mother :", 526 | "1st Daughter:", "2nd Daughter:", "3rd Daughter:", "4th Daughter:", 527 | "1st Niece :", "2nd Niece :", "3rd Niece :", "4th Niece :", 528 | "R. Witness :", "L. Witness :", "Judge :", "Reconciler :"] 529 | 530 | def drawShieldText(): 531 | print("-"*72) 532 | print("Shield chart generated at " + CurrentTime) 533 | print("-"*72) 534 | for x in range(16): 535 | print("{} {}".format(ShieldLabel[x], OutputShield[x][4])) 536 | 537 | def drawShield(): 538 | header_text = "Shield chart generated at " + CurrentTime 539 | print("-"*72) 540 | print(header_text.center(72)) 541 | print("-"*72) 542 | for x in range(4): 543 | print(s*6 + OutputShield[7][x] + s*5 + OutputShield[6][x] + s*5 + OutputShield[5][x] + s*5 + OutputShield[4][x] + s*5 + OutputShield[3][x] + s*5 + OutputShield[2][x] + s*5 + OutputShield[1][x] + s*5 + OutputShield[0][x]) 544 | print("\n") 545 | for x in range(4): 546 | print(s*10 + OutputShield[11][x] + s*13 + OutputShield[10][x] + s*13 + OutputShield[9][x] + s*13 + OutputShield[8][x]) 547 | print("\n") 548 | for x in range(4): 549 | print(s*18 + OutputShield[13][x] + s*29 + OutputShield[12][x]) 550 | print("\n") 551 | for x in range(4): 552 | print(s*35 + OutputShield[14][x] + s*25 + OutputShield[15][x]) 553 | 554 | def logShieldText(): 555 | if Logging: 556 | log.write("-"*72 + nl) 557 | log.write("Shield chart generated at " + CurrentTime + nl) 558 | log.write("-"*72 + nl) 559 | for x in range(16): 560 | log.write("{} {}{}".format(ShieldLabel[x], FigureShield[x][4], nl)) 561 | 562 | def logShield(): 563 | if Logging: 564 | log.write("-"*72 + nl) 565 | log.write(s*10 + "Shield chart generated at " + CurrentTime + nl) 566 | log.write("-"*72 + nl) 567 | for x in range(4): 568 | log.write(s*6 + DaughterD[x] + s*5 + DaughterC[x] + s*5 + DaughterB[x] + s*5 + DaughterA[x] + s*5 + MotherD[x] + s*5 + MotherC[x] + s*5 + MotherB[x] + s*5 + MotherA[x] + nl) 569 | log.write(nl) 570 | for x in range(4): 571 | log.write(s*10 + NieceD[x] + s*13 + NieceC[x] + s*13 + NieceB[x] + s*13 + NieceA[x] + nl) 572 | log.write(nl) 573 | for x in range(4): 574 | log.write(s*18 + WitnessB[x] + s*29 + WitnessA[x] + nl) 575 | log.write(nl) 576 | for x in range(4): 577 | log.write(s*35 + Judge[x] + s*25 + Reconciler[x] + nl) 578 | 579 | def drawHouseText(): 580 | print("-"*72) 581 | print(Chart + " house chart generated at " + CurrentTime) 582 | print("-"*72) 583 | for i in range(12): 584 | if i == 0 or rawHouse[i] == rawHouse[0]: 585 | print("House {}: {} *".format(str(i+1), OutputHouse[i][4])) 586 | elif (i+1) == significator or rawHouse[i] == rawHouse[significator-1]: 587 | print("House {}: {} #".format(str(i+1), OutputHouse[i][4])) 588 | else: 589 | print("House {}: {}".format(str(i+1), OutputHouse[i][4])) 590 | print("R. Witness: " + OutputHouse[12][4]) 591 | print("L. Witness: " + OutputHouse[13][4]) 592 | print("Judge : " + OutputHouse[14][4]) 593 | print("Reconciler: " + OutputHouse[15][4]) 594 | 595 | def drawHouse(): 596 | header_text = Chart + " house chart generated at " + CurrentTime 597 | print("-"*72) 598 | print(header_text.center(72)) 599 | print("-"*72) 600 | for x in range(4): 601 | print(s*13 + OutputHouse[10][x] + s*6 + OutputHouse[9][x] + s*6 + OutputHouse[8][x] + s*11 + " | ") 602 | print(s*46 + "|") 603 | for x in range(4): 604 | print(s*6 + OutputHouse[11][x] + s*29 + OutputHouse[7][x] + s*4 + " | " + s*4 + OutputHouse[13][x] + s*8 + OutputHouse[12][x]) 605 | print(s*46 + "|") 606 | for x in range(4): 607 | print(s*6 + OutputHouse[0][x] + s*29 + OutputHouse[6][x] + s*4 + " | " + s*10 + OutputHouse[14][x]) 608 | print(s*46 + "|") 609 | for x in range(4): 610 | print(s*6 + OutputHouse[1][x] + s*29 + OutputHouse[5][x] + s*4 + " | " + s*10 + OutputHouse[15][x]) 611 | print(s*46 + "|") 612 | for x in range(4): 613 | print(s*13 + OutputHouse[2][x] + s*6 + OutputHouse[3][x] + s*6 + OutputHouse[4][x] + s*11 + " | ") 614 | 615 | def logHouseText(): 616 | if Logging: 617 | log.write("-"*72 + nl) 618 | log.write(Chart + " house chart generated at " + CurrentTime + nl) 619 | log.write("-"*72 + nl) 620 | for i in range(12): 621 | if i == 0 or rawHouse[i] == rawHouse[0]: 622 | log.write("House {}: {} *{}".format(str(i+1), FigureHouse[i][4], nl)) 623 | elif (i+1) == significator or rawHouse[i] == rawHouse[significator-1]: 624 | log.write("House {}: {} #{}".format(str(i+1), FigureHouse[i][4], nl)) 625 | else: 626 | log.write("House {}: {}{}".format(str(i+1), FigureHouse[i][4], nl)) 627 | log.write("R. Witness: " + FigureHouse[12][4] + nl) 628 | log.write("L. Witness: " + FigureHouse[13][4] + nl) 629 | log.write("Judge : " + FigureHouse[14][4] + nl) 630 | log.write("Reconciler: " + FigureHouse[15][4] + nl) 631 | 632 | def logHouse(): 633 | if Logging: 634 | log.write("-"*72 + nl) 635 | header_text = Chart + " house chart generated at " + CurrentTime 636 | log.write(header_text.center(72) + nl) 637 | log.write("-"*72 + nl) 638 | for x in range(4): 639 | log.write(s*13 + FigureHouse[10][x] + s*6 + FigureHouse[9][x] + s*6 + FigureHouse[8][x] + s*11 + " | " + nl) 640 | log.write(s*46 + "|" + nl) 641 | for x in range(4): 642 | log.write(s*6 + FigureHouse[11][x] + s*29 + FigureHouse[7][x] + s*4 + " | " + s*4 + WitnessB[x] + s*8 + WitnessA[x] + nl) 643 | log.write(s*46 + "|" + nl) 644 | for x in range(4): 645 | log.write(s*6 + FigureHouse[0][x] + s*29 + FigureHouse[6][x] + s*4 + " | " + s*10 + Judge[x] + nl) 646 | log.write(s*46 + "|" + nl) 647 | for x in range(4): 648 | log.write(s*6 + FigureHouse[1][x] + s*29 + FigureHouse[5][x] + s*4 + " | " + s*10 + Reconciler[x] + nl) 649 | log.write(s*46 + "|" + nl) 650 | for x in range(4): 651 | log.write(s*13 + FigureHouse[2][x] + s*6 + FigureHouse[3][x] + s*6 + FigureHouse[4][x] + s*11 + " | " + nl) 652 | 653 | ########## Chart output ########## 654 | 655 | def prynt(msg): 656 | if Logging: 657 | log.write(msg + nl) 658 | 659 | if Logging: 660 | log.write("="*72 + nl) 661 | if Interactive: 662 | log.write("Name : {}{}".format(querent, nl)) 663 | log.write("Query: {}{}".format(query, nl)) 664 | if Chart != "Shield": 665 | log.write("Quesited: House {}{}".format(significator, nl)) 666 | 667 | if Double or Chart == "Shield": 668 | if Text: 669 | drawShieldText() 670 | logShieldText() 671 | else: 672 | drawShield() 673 | logShield() 674 | 675 | if Double and Chart == "Shield": 676 | Chart = "Medieval" 677 | 678 | if Chart == "Medieval" or Chart == "Agrippa": 679 | if Text: 680 | drawHouseText() 681 | logHouseText() 682 | else: 683 | drawHouse() 684 | logHouse() 685 | 686 | ########## Analysis ########## 687 | 688 | if Luddite == False: 689 | print("-"*72) 690 | print("{}{}Analysis of the chart:{}".format(fg_magenta, underline, reset)) 691 | prynt("-"*72) 692 | prynt("Analysis of the chart:") 693 | if MotherA[0:4] == Rubeus: 694 | print("\n" + warning_rubeus) 695 | prynt(nl + warning_rubeus) 696 | elif MotherA[0:4] == Cauda: 697 | print("\n" + warning_cauda) 698 | prynt(nl + warning_cauda) 699 | 700 | # Court figures and Way of Points 701 | 702 | PointMap = [0, 703 | 0,0,0,0,0,0,0,0, 704 | 0,0,0,0, 705 | 0,0] 706 | flag_1 = False 707 | flag_2 = False 708 | flag_a = False 709 | flag_b = False 710 | flag_c = False 711 | 712 | def msg_trp(n): 713 | message = ["There is no hidden influence in this reading.", 714 | "{}(1){} Personality and habit.".format(fg_red, reset), 715 | "{}(2){} Events and actions.".format(fg_yellow, reset), 716 | "{}(3){} Frequently visited places.".format(fg_blue, reset), 717 | "{}(4){} Other people".format(fg_green, reset)] 718 | rmessage = ["There is no hidden influence in this reading.", 719 | "(1) Personality and habit.", 720 | "(2) Events and actions.", 721 | "(3) Frequently visited places.", 722 | "(4) Other people."] 723 | print(message[n]) 724 | if Logging: 725 | log.write(rmessage[n] + nl) 726 | 727 | def explain_shield(n): 728 | i = id_fig(FigureShield[n-1][0:4]) 729 | return "{}:\n{}{}".format(OutputShield[n-1][4], s*4, FigMean[i]) 730 | 731 | def l_explain_shield(n): 732 | i = id_fig(FigureShield[n-1][0:4]) 733 | return "{}:{}{}{}".format(FigureShield[n-1][4], nl, s*4, FigMean[i]) 734 | 735 | def explain_house(n): 736 | i = id_fig(FigureHouse[n-1][0:4]) 737 | return "{}:\n{}{}".format(OutputHouse[n-1][4], s*4, FigMean[i]) 738 | 739 | def l_explain_house(n): 740 | i = id_fig(FigureHouse[n-1][0:4]) 741 | return "{}:{}{}{}".format(FigureHouse[n-1][4], nl, s*4, FigMean[i]) 742 | 743 | if Luddite == False: 744 | if Double or Chart == "Shield": 745 | # Analysis of the Court 746 | print("\n{}The answer{} to your question is {}".format(fg_magenta, reset, explain_shield(15))) 747 | prynt("{}The answer to your question is {}".format(nl, l_explain_shield(15))) 748 | print("\n{}The past{}, or internal factor is {}".format(fg_magenta, reset, explain_shield(13))) 749 | prynt("{}The past, or internal factor is {}".format(nl, l_explain_shield(13))) 750 | print("\n{}The future{}, or external factor is {}".format(fg_magenta, reset, explain_shield(14))) 751 | prynt("{}The future, or external factor is {}".format(nl, l_explain_shield(14))) 752 | # Way of the Points 753 | print("\n{}Way of the Points{} leads to:".format(fg_magenta, reset)) 754 | if WitnessA[0] == WitnessB[0]: 755 | if WitnessA[0] != Judge[0]: 756 | print(" (none)") 757 | prynt(" (none)") 758 | msg_trp(0) 759 | # First branch 760 | if WitnessA[0] == Judge[0]: 761 | print(" {}Right Witness{}".format(fg_yellow, reset)) 762 | prynt(" Right Witness") 763 | PointMap[13] = 1 764 | flag_a = True 765 | if NieceA[0] == Judge[0]: 766 | print(" {}1st Niece (1){}".format(fg_green, reset)) 767 | prynt(" 1st Niece (1)") 768 | PointMap[9] = 1 769 | flag_b = True 770 | if MotherA[0] == Judge[0]: 771 | print(" {}1st Mother (1){}".format(fg_cyan, reset)) 772 | prynt(" 1st Mother (1)") 773 | PointMap[1] = 1 774 | flag_c = True 775 | if MotherB[0] == Judge[0]: 776 | print(" {}2nd Mother (1){}".format(fg_cyan, reset)) 777 | prynt(" 2nd Mother (1)") 778 | PointMap[2] = 1 779 | flag_c = True 780 | if NieceB[0] == Judge[0]: 781 | print(" {}2nd Niece (2){}".format(fg_green, reset)) 782 | prynt(" 2nd Niece (2)") 783 | PointMap[10] = 1 784 | flag_b = True 785 | if MotherC[0] == Judge[0]: 786 | print(" {}3rd Mother (2){}".format(fg_cyan, reset)) 787 | prynt(" 3rd Mother (2)") 788 | PointMap[3] = 1 789 | flag_c = True 790 | if MotherD[0] == Judge[0]: 791 | print(" {}4th Mother (2){}".format(fg_cyan, reset)) 792 | prynt(" 4th Mother (2)") 793 | PointMap[4] = 1 794 | flag_c = True 795 | # Second branch 796 | if WitnessB[0] == Judge[0]: 797 | print(" {}Left Witness{}".format(fg_yellow, reset)) 798 | prynt(" Left Witness") 799 | PointMap[14] = 1 800 | flag_a = True 801 | if NieceC[0] == Judge[0]: 802 | print(" {}3rd Niece (3){}".format(fg_green, reset)) 803 | prynt(" 3rd Niece (3)") 804 | PointMap[11] = 1 805 | flag_b = True 806 | if DaughterA[0] == Judge[0]: 807 | print(" {}1st Daughter (3){}".format(fg_cyan, reset)) 808 | prynt(" 1st Daughter (3)") 809 | PointMap[5] = 1 810 | flag_c = True 811 | if DaughterB[0] == Judge[0]: 812 | print(" {}2nd Daughter (3){}".format(fg_cyan, reset)) 813 | prynt(" 2nd Daughter (3)") 814 | PointMap[6] = 1 815 | flag_c = True 816 | if NieceD[0] == Judge[0]: 817 | print(" {}4th Niece (4){}".format(fg_green, reset)) 818 | prynt(" 4th Niece (4)") 819 | PointMap[12] = 1 820 | flag_b = True 821 | if DaughterC[0] == Judge[0]: 822 | print(" {}3rd Daughter (4){}".format(fg_cyan, reset)) 823 | prynt(" 3rd Daughter (4)") 824 | PointMap[7] = 1 825 | flag_c = True 826 | if DaughterD[0] == Judge[0]: 827 | print(" {}4th Daughter (4){}".format(fg_cyan, reset)) 828 | prynt(" 4th Daughter (4)") 829 | PointMap[8] = 1 830 | flag_c = True 831 | # Triplicity check 832 | if flag_c: 833 | flag_b = False 834 | flag_a = False 835 | if PointMap[1] == 1 or PointMap[2] == 1: 836 | msg_trp(1) 837 | if PointMap[3] == 1 or PointMap[4] == 1: 838 | msg_trp(2) 839 | if PointMap[5] == 1 or PointMap[6] == 1: 840 | msg_trp(3) 841 | if PointMap[7] == 1 or PointMap[8] == 1: 842 | msg_trp(4) 843 | else: 844 | flag_2 = True 845 | if flag_b and flag_2: 846 | flag_a = False 847 | if PointMap[9] == 1: 848 | msg_trp(1) 849 | 850 | if PointMap[10] == 1: 851 | msg_trp(2) 852 | if PointMap[11] == 1: 853 | msg_trp(3) 854 | if PointMap[12] == 1: 855 | msg_trp(4) 856 | else: 857 | flag_1 = True 858 | if flag_a and flag_1: 859 | if PointMap[13] == 1: 860 | print("{}Right Witness{}: the past or internal factors.".format(fg_gray, reset)) 861 | prynt("Right Witness: the past or internal factors.") 862 | if PointMap[14] == 1: 863 | print("{}Left Witness{}: the unknown or external factors.".format(fg_cyan, reset)) 864 | prynt("Left Witness: the unknown or external factors.") 865 | 866 | ########## Modes of Perfection ########## 867 | 868 | mode_p = 0 869 | CheckHouse = rawHouse[:12] 870 | 871 | if Chart != "Shield" and Luddite == False: 872 | print("\nThe querent is described by {}".format(explain_house(1))) 873 | prynt("{}The querent is described by {}".format(nl, l_explain_house(1))) 874 | print("\nThe quesited is described by {}".format(explain_house(significator))) 875 | prynt("{}The quesited is described by {}".format(nl, l_explain_house(significator))) 876 | print("\n{}Modes of Perfection:{}".format(fg_magenta, reset)) 877 | prynt(nl + "Modes of Perfection:") 878 | print("The significator of quesited is " + fg_blue + "House " + str(significator) + reset) 879 | significator -= 1 880 | # Occupation 881 | if CheckHouse[0] == CheckHouse[significator]: 882 | mode_p += 1 883 | print("{}Occupation found!{}".format(fg_green, reset)) 884 | prynt("Occupation found!") 885 | # Conjunction 886 | # One of the significators moves to a house directly beside the house of the other significator. 887 | if 1 < significator < 11: 888 | if CheckHouse[0] == CheckHouse[significator-1] or CheckHouse[0] == CheckHouse[significator+1]: 889 | mode_p += 1 890 | print("{}Conjunction found!{} Querent is the active party.".format(fg_green, reset)) 891 | prynt("Conjunction found! Querent is the active party.") 892 | elif CheckHouse[1] == CheckHouse[significator] or CheckHouse[-1] == CheckHouse[significator]: 893 | mode_p += 1 894 | print("{}Conjunction found!{} Quesited is the active party.".format(fg_green, reset)) 895 | prynt("Conjunction found! Quesited is the active party.") 896 | # Mutation 897 | # The two significators appear next to each other elsewhere in the chart. 898 | for house_num in range(3, 10): 899 | if CheckHouse[house_num] == CheckHouse[0]: 900 | if CheckHouse[house_num+1] == CheckHouse[significator] or CheckHouse[house_num-1] == CheckHouse[significator]: 901 | print("{}Mutation found!{} Please check House {}.".format(fg_green, reset, str(house_num+1))) 902 | mode_p += 1 903 | prynt("Mutation found! Please check House {}.".format(str(house_num+1))) 904 | # Translation 905 | # The same figure appears in houses directly beside the houses of the significators. 906 | if CheckHouse[1] == CheckHouse[significator-1] or CheckHouse[1] == CheckHouse[significator-1]: 907 | mode_p += 1 908 | print("{}Translation found!{} See House 2.".format(fg_green, reset)) 909 | prynt("Translation found! See House 2.") 910 | elif CheckHouse[-1] == CheckHouse[significator-1] or CheckHouse[1] == CheckHouse[significator-1]: 911 | mode_p += 1 912 | print("{}Translation found!{} See House 12.".format(fg_green, reset)) 913 | prynt("Translation found! See House 12.") 914 | # No perfection 915 | if mode_p < 1: 916 | print("{}No perfection found.{}".format(fg_red, reset)) 917 | prynt("No perfection found.") 918 | 919 | ########## Close log ########## 920 | 921 | if Logging: 922 | log.close() 923 | 924 | #EOF 925 | --------------------------------------------------------------------------------