Safely evaluate mathematical and logical expressions.
Project description
🐴 sheval
Safely evaluate mathematical and logical expressions. Most operations are supported.
Whitelisted data types
For security, only certain data types are allowed for constants and variables.
strintfloatcomplexlisttuplesetdictboolbytesNoneType
Example
from sheval import sheval
# Variables can be passed on.
variables = dict(
x = 2,
y = 3,
)
# And functions too!
functions = dict(
double = lambda x: x * 2,
)
sheval('double(x) > y', variables, functions)
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
sheval-1.1.0.post1.tar.gz
(14.7 kB
view details)
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 sheval-1.1.0.post1.tar.gz.
File metadata
- Download URL: sheval-1.1.0.post1.tar.gz
- Upload date:
- Size: 14.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc991b34e63cf50014c21fe8af1d1985cc3ef91f47713a059f3344d97c48131b
|
|
| MD5 |
1215b61c7e73aeb8aad3a410f02054c6
|
|
| BLAKE2b-256 |
ba87de1fc542ad43219248ef425cbcdb9cf4caed92c9dbfa3dbde251aaa88524
|
File details
Details for the file sheval-1.1.0.post1-py3-none-any.whl.
File metadata
- Download URL: sheval-1.1.0.post1-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af3fdf52e0c52c5e7b8548e6e364b496c581c45434ba385e89876c664c975a75
|
|
| MD5 |
f9858fccb6b36db4260858db60aa664b
|
|
| BLAKE2b-256 |
a94043d6c16c71a4581e4a7e0be8bbafcc97ec28c3f23f11b83de90034a1c7a8
|