
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
numeral
Advanced tools
This Python library implements integer-to-numeral and numeral-to-integer conversion for a variety of numeral representations, including:
!, @}).The generic tokens set representation uses the least number of tokens for representing a given integer, and uses an exponential-like notation similar to base-n conversion, except that the first symbol is used. The alphabetic representation is a special case of a generic tokens set representation, where the latin alphabet is used as tokens set. Upper/lower case conversion should be handled through Python built-ins. All representation support negative values.
Detailed documentation is available for all functions through docstrings.
Of note, the Roman numbers support include:
<https://en.wikipedia.org/wiki/Roman_numerals#Apostrophus>_)<https://en.wikipedia.org/wiki/Roman_numerals#Zero>_)<https://en.wikipedia.org/wiki/Numerals_in_Unicode#Roman_numerals>_)The recommended way of installing the software is through
PyPI <https://pypi.python.org/pypi/numeral>_:
.. code:: shell
$ pip install numeral
Alternatively, you can clone the source repository from
GitHub <https://github.com/norok2/numeral>_:
.. code:: shell
$ mkdir numeral
$ cd numeral
$ git clone git@github.com:norok2/numeral.git
$ python setup.py install
(some steps may require additional permissions depending on your configuration)
The software does not have additional dependencies beyond Python and its standard library.
It was tested with Python 2.7 and 3.5. Other version were not tested.
The following functions are defined:
int2letter
Convert a number to the least amount letters (within an alphabet).
.. code:: python
>>> int2letter(10)
'k'
>>> import string # Common string operations
>>> int2letter(10, string.ascii_letters) # using both lower and upper cases
'aW'
letter2int
Convert a group of letters (within a given alphabet) to a number.
.. code:: python
>>> letter2int('aa')
26
int2tokens
Convert a number to the least amount tokens (within a tokens set).
.. code:: python
>>> int2tokens(12, ('!', '@', '#', '$'))
'#!'
tokens2int
Convert a group of tokens (within a given set) to a number.
.. code:: python
>>> tokens2int('#!', ('!', '@', '#', '$'))
12
int2roman
Convert an integer to its corresponding Roman number representation.
.. code:: python
>>> int2roman(1666) # using dedicated unicode chars
'ⅯⅮⅭⅬⅩⅥ'
>>> int2roman(1666, only_ascii=True) # using only ASCII
'MDCLXVI'
roman2int
Convert a string representation of a Roman number to integer.
.. code:: python
>>> int2roman('MDCLXVI')
1666
FAQs
Support for various integer-to-numeral conversion.
We found that numeral demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.