Changelogל
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.8.1] - 2023-12-11ל
Fixedל
- Corrected an issue with subclasses of
BaseHebrewCharwhere use of__eq__would break when the type for the comparison was not the same as itself.
[0.8.0] - 2023-12-10ל
Addedל
- Added
Hebrew.normalize, a function for normalizing the hebrew characters in a string. This is typically needed with text includes special hebrew characters.
Hidden among hebrew text can be special characters that are visually identical humans, but are made up of different unicode characters. However, this can cause issues with presentation when there is no support for these characters.

In this case, the first letter is made up of 2 unicode characters, sin with a dot and qamatz. The issue here is the sin. By normalizing the sin with a dot to 2 unicode characters, ש and the dot, the display will look right!

To normalize content, use the Hebrew.normalize function:
```python
from hebrew import Hebrew
hs = Hebrew('שָׂחַקְתִּי כְּמוֹ')
assert len(hs.string) == 14 assert len(hs.normalize().string) == 18 ```
### Normalizing Yiddish
By default, special yiddish characters such as ײ (double Yod) are not normalized. However, ײַ (double Yod with a Patah) will be converted to ײַ.
To fully "normalize" yiddish characters, pass True to normalize.
[0.7.0] - 2023-12-10ל
Addedל
- New function
Hebrew.from_numberconverts an int into its hebrew form
Example:ל
from hebrew import Hebrew
hs1 = Hebrew.from_number(2)
print(hs1) # ב׳
# Do not add punctuation
hs2 = Hebrew.from_number(2, geresh=False)
print(hs2) # ב
[0.6.2] - 2023-12-08ל
Changedל
- Added 3.12 as a supported version
- Updated project dependencies.
Removedל
- Removed 3.11 as a supported version
[0.6.1] - 2022-10-28ל
Changedל
- Added 3.11 as a supported version
[0.6.0] - 2022-04-19ל
Addedל
- Added the remaining missing Gematria methods. The complete list of supported methods is:
ACHAS_BETAALBAMATBASHAVGADAYAK_BACHARMISPAR_BONEEHMISPAR_GADOLMISPAR_HAACHORMISPAR_HAMERUBAH_HAKLALIMISPAR_HECHRACHIMISPAR_KATANMISPAR_KATAN_MISPARIMISPAR_KIDMIMISPAR_KOLELMISPAR_MESHULASHMISPAR_MISPARIMISPAR_MUSAFIMISPAR_NEELAMMISPAR_PERATIMISPAR_SHEMI_MILUIMISPAR_SIDURIOFANIMREVERSE_AVGAD
### Example: ```python from hebrew import Hebrew from hebrew import GematriaTypes
hs = Hebrew('בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃')
print(hs.gematria()) # 2701 print(hs.gematria(GematriaTypes.MISPAR_GADOL)) # 4631 ```
[0.5.8] - 2022-04-18ל
Addedל
- Added Gematria methods
MISPAR_MUSAFI. This is the first of the complex Gematria types that goes deeper than just adding up values assigned to each letter, necessitating internal changes to theHebrewclass.
[0.5.7] - 2022-04-18ל
Addedל
- Added Gematria methods
MISPAR_KATAN,MISPAR_PERATI,ATBASH,ALBAM,MISPAR_MESHULASH.
[0.5.6] - 2022-04-18ל
Addedל
- Added a new gematria method,
MISPAR_SIDURI.
[0.5.5] - 2021-11-22ל
Addedל
- Added a new gematria method,
MISPAR_GADOL. A contribution by Taber Andrew Bain
[0.5.4] - 2021-11-21ל
Fixedל
- Fixed an issue where
Hebrew.gematriawould through an error if the input string had no hebrew characters. In this case, we now return a value of 0.
[0.5.3] - 2021-11-15ל
Changedל
- Split the
PunctuationChartype chars intoTaamimCharandOtherChartypes inhebrew.char. - Renamed the
no_punctuationmethod ofHebrewtono_taamim.
[0.5.0] - 2021-11-14ל
Addedל
- Added the method
Hebrew.gematriamethod for calculating the gematria of a string. - Added
mispar_hechrachias a supported gematria type.
>>> from hebrew import Hebrew
>>> from hebrew.gematria import GematriaTypes
>>> Hebrew("בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָרֶץ׃").gematria(GematriaTypes.MISPAR_HECHRACHI)
2701
[0.4.0] - 2021-11-14ל
Addedל
- Added
hebrew.charswith constants for Hebrew characters and classes to represent each letter. - Moved constants out of
Hebrewand intohebrew.chars. - Constant values, previously strings, are now instances of a class with metadata for each letter.
Removedל
- Support for Python 3.6 was removed because we are now using
@dataclasse. It is possible to make this work with 3.6 but I am choosing not to at this time. If this is a problem for you, feel free to open an issue.
[0.3.0] - 2021-11-08ל
Changedל
- Renamed the python package from
hebrewstringtohebrew.
[0.2.0] - 2021-11-07ל
Addedל
- Added the
__eq__method to theGraphemeStringobject.
This is to support the == operator when comparing two GraphemeString objects.
- Added the
__add__method to theGraphemeStringobject.
This is to support the + operator when adding two GraphemeString objects together.
- Added the
__hash__method to theGraphemeStringobject.
This is to support the hash() function for a GraphemeString instance and allows it (as an example) to be used as
a dict key.
[0.1.2] - 2021-11-07ל
Addedל
- Added base code, tests, and examples for the first release.