Skip to main content

Gematria

The gematria package makes numerological analysis of texts easy and accessible, and supports multiple gematria systems and alphabets/languages. The package can also translate words and sentences back and forth from numbers to letters, preserving capitalization and punctuation from the original strings.

This photo is an example of isopsephy from the Sanctuary of Artemis Orthia, 2nd century AD.

Supported Systems and Alphabets

The package supports the following systems:

When no system is specified by the user, the package defaults to the Agrippa method. The systems above can be called in functions using the following arguments:

  • Agrippa: 'agrippa'
  • Rudolff: 'rudolff'
  • Hebrew: 'hebrew'
  • Greek isopsephy: 'greek'
  • English Qaballa: 'eq'

Installation

The package can be installed via pip:

pip install gematria

Or by cloning the GitHub repository.

Example Usage

To convert a string (or list of strings) to its numerical value, simply pass the string (or list) to the string_values function:

import gematria

# getting the values of individual letters
gematria.conv.string_values('Hi')
# returns [8, 9]

# getting the values of words by passing a list
gematria.conv.string_values(['Hello', 'world'])
# returns [103, 1054]

We can also specify a different dictionary very easily when calling the function:

gematria.conv.string_values(['Hello', 'world'], 'eq')
# returns [40, 30]

To return both the letters/words and their values as tuples, use the string_and_num_values function:

# getting the values of individual letters
gematria.conv.string_and_num_values('Hi')
# returns  [('H', '8'), ('i', '9')]

# getting the values of words by passing a list
gematria.conv.string_and_num_values(['Hello', 'world'])
# returns  [('Hello', '103'), ('world', '1054')]

Specifying a different dictionary:

gematria.conv.string_and_num_values(['Hello', 'world'], 'rudolff')
# returns  [('Hello', '49'), ('world', '67')]

Full List of Functions

Please note: the examples below default to using the Agrippa dictionary. If you would like to use a different dictionary, specify it where 'dict_name' is indicated in the function call.

string_values('string' or [list], 'dict_name')

Takes either a string or list of strings, and outputs a list of integers with the numerological value of the strings passes--e.g., passing ['This', 'is', 'a', 'test.'] returns [207, 99, 1, 295].

Example:

gematria.conv.string_values('Test.')
# returns [100, 5, 90, 100]

string_and_num_values('string' or [list])

Takes either a string or list of letters or words and returns tuples of the letters or words and their numerical values as a list--e.g., passing ['This', 'is', 'a', 'test.'] returns the following: [('This', '207'), ('is', '99'), ('a', '1'), ('test.', '295')].

Example:

gematria.conv.string_and_num_values('Test')
# returns [('T', '100'), ('e', '5'), ('s', '90'), ('t', '100')]

nums_to_list('string' or [list])

Takes either a string or list of numbers and outputs them to a list for later parsing. For a string, ensure there are only "+" signs between numbers for proper parsing (e.g., '100 + 20'). When passing lists, the function can handle multiple words written as strings like the example above--e.g., ['100 + 8 + 9 + 90', '9 + 90'], which returns as ['100', '8', '9', '90', 'space', '9', '90'].

Example:

gematria.conv.nums_to_list(['100 + 8 + 9 + 90', '9 + 90'])
# returns ['100', '8', '9', '90', 'space', '9', '90']

lets_to_nums('string' or [list])

Takes either a string or a list of letters and converts them to numbers, returning a list.

Example:

gematria.conv.lets_to_nums('Test.')
# returns ['100', '5l', '90l', '100l', '.']

nums_to_lets('string' or [list])

Takes either a string or a list of numbers and converts them to letters, returning a list.

Example:

gematria.conv.lets_to_nums(['100', '5l', '90l', '100l', '.'])
# returns ['Test.']

num_list_to_words([list])

Takes a list of numbers and outputs a list of words--e.g., given ['100', '8l', '9l', '90l'], the function returns 'Test'.

Example:

gematria.conv.num_list_to_words(['100', '8l', '9l', '90l', 'space', '9l', '90l', 'space', '1l', 'space', '100l', '5l', '90l', '100l', '.'])
# returns 'This is a test.'

Release files for pygematria 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygematria 0.0.1
File Size Uploaded
pygematria-0.0.1.tar.gz 32.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygematria 0.0.1
File Interpreter ABI Platform
pygematria-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 63.3 kB

Release files / pygematria-0.0.1.tar.gz

Download URL pygematria-0.0.1.tar.gz
Size 32.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1886cef996ae32ca4d246efaeba591bb14726a9ff1af66147270aedaeed37e6b
BLAKE2b-256 checksum
How to use checksums
27be23b23b61624b7deaee02cce64789518b05c08fc3a6f2223e5c5a90267560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / pygematria-0.0.1-py3-none-any.whl

Download URL pygematria-0.0.1-py3-none-any.whl
Size 30.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d961260b743bdac7627922849b538b998c4d100588983fb1005aaac66352489
BLAKE2b-256 checksum
How to use checksums
c0d71aa75330b95bf526fd42c58f7f2dab600e22764f74bf1067d8e1544b855d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page