Skip to main content

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:
str, int, float, complex, list, tuple, set, dict, bool, bytes, NoneType

Example

from sheval import sheval

_locals = dict(x=3, y=1, z=4)

sheval('x > y <= z', _locals)

Project details


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.0.4.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

sheval-1.0.4-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file sheval-1.0.4.tar.gz.

File metadata

  • Download URL: sheval-1.0.4.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for sheval-1.0.4.tar.gz
Algorithm Hash digest
SHA256 af3386ba2b3a9ba5484faa5288a2476880e92fb049d84c67a45f6f96f45ccfec
MD5 13ad29c872b45999fefedd62c24075f6
BLAKE2b-256 98fc4fc625c89289d0fae44c5d2dc4d7812f5160154826666d74b2718ce0d27d

See more details on using hashes here.

File details

Details for the file sheval-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: sheval-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for sheval-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e51133b50d70e0a51634373bc6e74e2caf0dc4c5140348bbcc12c0dc946f3d65
MD5 2ae7611903bf89fa1520704635eaa4e5
BLAKE2b-256 c5bc107b237de9699a29967f955fcaa8d4599aeaaea64a5fe2f1b2fe50729079

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page