📜  gematria python (1)

📅  最后修改于: 2023-12-03 15:30:53.345000             🧑  作者: Mango

Gematria Python

Gematria is an ancient Jewish numerical system where each letter of the Hebrew alphabet is assigned a numerical value. Gematria Python is a Python module that helps you use this system and interpret the numerical values of Hebrew words and phrases.

Installation

To install Gematria Python, use pip:

pip install gematria
Usage

The gematria module provides two functions:

  • gematria.gematria(word: str) -> int: Returns the numerical value of a given word in Hebrew.
  • gematria.word_value(word: str) -> Dict[str, int]: Returns a dictionary with the numerical value of each letter in a given word in Hebrew.
Example
import gematria

word = "חיים"  # Hebrew word for "life"
value = gematria.gematria(word)
print(f"The Gematria value of {word} is {value}")
# Output: The Gematria value of חיים is 68

letters_value = gematria.word_value(word)
print(f"The numerical value of each letter in {word} is {letters_value}")
# Output: The numerical value of each letter in חיים is {'ח': 8, 'י': 20, 'י': 20, 'ם': 20}
References
  1. Gematria - Wikipedia
  2. gematria - PyPI