Giter VIP home page Giter VIP logo

python-hebrew-numbers's Introduction

python-hebrew-numbers

python library for conversion of hebrew numbers (Gematria)

Usage

installation

pip install python-hebrew-numbers

gematria_to_int

from hebrew_numbers import gematria_to_int
gematria_to_int(u'רח"צ')
# 298

int_to_gematria

from hebrew_numbers import int_to_gematria
int_to_gematria(298)
# u'רח״צ'
int_to_gematria(298, gershayim=False)
# u'רחצ'

Features

  • conversion from string of letters to an integer number
  • conversion of integer to string (using hebrew-special-numbers)

Contributing

See the contribution guide

Background

python-hebrew-numbers's People

Contributors

ninjaaron avatar orihoch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

python-hebrew-numbers's Issues

special numbers not represented properly

To avoid certain spelled-out words, alternate representations are used. For example:

15: 'ט״ו'
16: 'ט״ז'
#...
270: 'ע״ר'
272: 'ער״ב'
298: 'רח״צ'
#...

If you add in a YAML file with these alternate representations, you could first do a lookup on the YAML. If it's not in the list of specials, you can generate the letters as before.

int_to_gematria should work when installing from pip

reproduction steps

$ python --version
Python 2.7.12+  -- (it reproduces for Python 3.5.3 as well)
$ pip install --upgrade https://github.com/OriHoch/python-hebrew-numbers/archive/master.zip
$ python
>>> from hebrew_numbers import int_to_gematria

expected

  • should work

actual

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ori/tmp/venv/local/lib/python2.7/site-packages/hebrew_numbers/__init__.py", line 8, in <module>
    specialnumbers = yaml.safe_load(io.open(DATA_PATH, encoding='utf8'))
IOError: [Errno 2] No such file or directory: '/home/ori/tmp/venv/local/lib/python2.7/site-packages/hebrew-special-numbers/styles/default.yml'

automated tests / CI improvements

TODO

  • currently we have travis run multiple python versions, need to determine if the versions it's running are ok (I think we need to add python 3.6)
  • should update to use tox
  • should remove the tests from the published package
  • should run the tests using standard test runner (e.g. pytest or python -m unittest)
  • should have automatic publishing to pypi when github release is published. something like this - https://github.com/hasadna/knesset-data-python/blob/master/.travis/after_success.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.