Skip to main content

🐴 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.

  • str
  • int
  • float
  • complex
  • list
  • tuple
  • set
  • dict
  • bool
  • bytes
  • NoneType

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)

Metadata

Release files for sheval 1.1.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sheval 1.1.0.post1
File Size Uploaded
sheval-1.1.0.post1.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sheval 1.1.0.post1
File Interpreter ABI Platform
sheval-1.1.0.post1-py3-none-any.whl Python 3 none any Details

Total release size: 29.8 kB

Release files / sheval-1.1.0.post1.tar.gz

Download URL sheval-1.1.0.post1.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cc991b34e63cf50014c21fe8af1d1985cc3ef91f47713a059f3344d97c48131b
BLAKE2b-256 checksum
How to use checksums
ba87de1fc542ad43219248ef425cbcdb9cf4caed92c9dbfa3dbde251aaa88524
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / sheval-1.1.0.post1-py3-none-any.whl

Download URL sheval-1.1.0.post1-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af3fdf52e0c52c5e7b8548e6e364b496c581c45434ba385e89876c664c975a75
BLAKE2b-256 checksum
How to use checksums
a94043d6c16c71a4581e4a7e0be8bbafcc97ec28c3f23f11b83de90034a1c7a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.8

Release history Release notifications | RSS feed

This release

1.1.0.post1 This release

2 release files

1.1.0

2 release files

1.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page