Agnostic Calculator
A Python3 library that parses strings representing mathematical expressions. The Calculator takes a converter by which means you can specify numerical types other than regular base 10 numbers. There is one converter available: roman.
How to install
Using pip:
pip install agnostic-calculator
Manually:
git clone git@github.com:carawarner/calculator.git
cd calculator/calculator
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
How to run tests
This libary uses pytest, a powerful but lightweight testing tool for Python.
cd calculator
pytest
How to use
WARNING: Don't use agnostic-calculator in production. The calculator library calls Python's eval() on user input. It's not safe.
from calculator.calculator import Calculator
import calculator.converters.roman as converter
calculator = Calculator(converter)
result = calculator.evaluate(expression)
Metadata
Release files for agnostic-calculator 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| agnostic-calculator-1.1.0.tar.gz | 5.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agnostic_calculator-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / agnostic-calculator-1.1.0.tar.gz
| Download URL | agnostic-calculator-1.1.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b1d64a3f5460708756e041393935beab13bf0a239328a154820fd6555a984bd
|
|
BLAKE2b-256 checksum How to use checksums |
01850e0a61326a3adeee96474eee234bb7bf45b652e257168e10684f229c3501
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / agnostic_calculator-1.1.0-py3-none-any.whl
| Download URL | agnostic_calculator-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e456f79277d5f70c2f2278160cd8d50b00f5d9c98284f1072df3bf11d6f7529c
|
|
BLAKE2b-256 checksum How to use checksums |
991334dfe309a3b826b24011bbd8a1185343593ba47bc8a3f88850fad12eb45d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for agnostic-calculator 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.