A lightweight AST based expression evaluator
Project description
sichercalc
Fork of ast_calculator, modernized and refactored as a reusable library.
What is SicherCalc?
When you need to evaluate simple mathematical or logical expressions supplied by untrusted users, you need a sandboxed environment that prevents arbitrary code execution. SafeCalc parses the expression into an abstract syntax tree (AST), inspects each node, and evaluates only those that belong to a predefined, whitelisted set of operations.
Why AST?
An abstract syntax tree (AST) is a tree‑structured representation of source code.
By operating on the AST we can precisely control which constructs are allowed,
eliminating the security risks associated with eval().
Features
- No
eval()– pure AST parsing and controlled evaluation - Extensible – register your own custom functions
- Works on Python 3.10+
Getting Started
Installation
pip install sichercalc
CHANGELOG
0.0.0.dev1
- New publishing try due to workflow error in 0.0.0.dev0.
- Invalid development status classifier and workflow corrections.
0.0.0.dev0
Hello, world!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sichercalc-0.0.0.dev1.tar.gz.
File metadata
- Download URL: sichercalc-0.0.0.dev1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a2b0913a8f5869004920d213a8c9517ff9d10fe07c9e920c7a7ac6b7f2797d2
|
|
| MD5 |
0568762869aec328a8fb73fa0a2d3f95
|
|
| BLAKE2b-256 |
e2e45dc1965a331edcd07cc045876635b229c39a87e854c5a0b753e29a3a72de
|
Provenance
The following attestation bundles were made for sichercalc-0.0.0.dev1.tar.gz:
Publisher:
pypi.yml on Stalot/sichercalc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sichercalc-0.0.0.dev1.tar.gz -
Subject digest:
6a2b0913a8f5869004920d213a8c9517ff9d10fe07c9e920c7a7ac6b7f2797d2 - Sigstore transparency entry: 1051245231
- Sigstore integration time:
-
Permalink:
Stalot/sichercalc@64a8927b8cadb191b96a53a79d883d6e4f274c05 -
Branch / Tag:
refs/tags/0.0.0.dev1 - Owner: https://github.com/Stalot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@64a8927b8cadb191b96a53a79d883d6e4f274c05 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sichercalc-0.0.0.dev1-py3-none-any.whl.
File metadata
- Download URL: sichercalc-0.0.0.dev1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1ef239bdc667c9fc93f4c48d9ad039a06890d294ce01d89138da729182f871a
|
|
| MD5 |
791b5991f597b8130afadbe57846fa95
|
|
| BLAKE2b-256 |
f19f1b4cafe1273976fb337f65e73070fe473ba143ec4b9bf05330fd4b7a470d
|
Provenance
The following attestation bundles were made for sichercalc-0.0.0.dev1-py3-none-any.whl:
Publisher:
pypi.yml on Stalot/sichercalc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sichercalc-0.0.0.dev1-py3-none-any.whl -
Subject digest:
e1ef239bdc667c9fc93f4c48d9ad039a06890d294ce01d89138da729182f871a - Sigstore transparency entry: 1051245338
- Sigstore integration time:
-
Permalink:
Stalot/sichercalc@64a8927b8cadb191b96a53a79d883d6e4f274c05 -
Branch / Tag:
refs/tags/0.0.0.dev1 - Owner: https://github.com/Stalot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@64a8927b8cadb191b96a53a79d883d6e4f274c05 -
Trigger Event:
release
-
Statement type: