Skip to content

Instantly share code, notes, and snippets.

@pratul
Created January 18, 2011 14:58
Show Gist options
  • Save pratul/784537 to your computer and use it in GitHub Desktop.
Save pratul/784537 to your computer and use it in GitHub Desktop.
A numerological calculator based on the Kabbalah alphabet. (from Linda Goodman's "Star Signs")
#!/usr/bin/python
# authored by Pratul Kalia in January 2011.
# Released into the public domain.
import sys
# Chaldean-Hebrew Kabala Numberical Alphabet.
# Taken from the book "Star Signs" by Linda Goodman.
def valreturn(character):
if character == 'a':
return 1
elif character == 'b':
return 2
elif character == 'c':
return 3
elif character == 'd':
return 4
elif character == 'e':
return 5
elif character == 'f':
return 8
elif character == 'g':
return 3
elif character == 'h':
return 5
elif character == 'i':
return 1
elif character == 'j':
return 1
elif character == 'k':
return 2
elif character == 'l':
return 3
elif character == 'm':
return 4
elif character == 'n':
return 5
elif character == 'o':
return 7
elif character == 'p':
return 8
elif character == 'q':
return 1
elif character == 'r':
return 2
elif character == 's':
return 3
elif character == 't':
return 4
elif character == 'u':
return 6
elif character == 'v':
return 6
elif character == 'w':
return 6
elif character == 'x':
return 5
elif character == 'y':
return 1
elif character == 'z':
return 7
# Do the initial conversion into the sum of numbers.
def kabalize(curr_name):
sum = 0
for counter in range(0, len(curr_name)):
letter = curr_name[counter]
sum = sum + valreturn(letter)
if (len(str(sum)) > 1):
squashnumber(sum)
else:
print sum
# Keep squashing sum until we get a single digit number
def squashnumber(temp):
fsum = 0
fstr = str(temp)
for counter in range(0, len(fstr)):
fsum = fsum + int(fstr[counter])
if (len(str(fsum)) > 1):
squashnumber(fsum)
else:
print fsum
# Let's begin!
for name in sys.argv[1:]:
kabalize(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment