A layer of protection for pythons eval
Project description
Examples
Some examples focused purely on security rather then real world practical examples.
Disable module importing
cval(source='__import__("os")', modules=False)
Allow certain modules
cval(source='__import__("os")', modules=False, allowed_modules=["os"])
Disable function calls
cval(source=input(), calls=False)
Allow certain function calls
cval(source='print("Hello, World!")', calls=False, allowed_calls=["print"])
Block global variables
cval(source=input(), globals=globals(), gscope=False)
Block local variables
cval(source=input(), locals=locals(), lscope=False)
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
cval-0.0.2.tar.gz
(16.7 kB
view hashes)
Built Distribution
cval-0.0.2-py2.py3-none-any.whl
(16.1 kB
view hashes)