12 Replies
Made this nearly two years ago, now I'm resurrecting the project to fix some bugs and make life with the library easier. @cm wanted to use cval in one of his projects, but after looking at my old code I noticed some things. Suboptimal regex's and weird code. Working on testing this new update I plan on posting soon.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
This new update brings along more security, and more control of what goes into eval.
The update should be out in 20 minutes, just need to do some testing
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Certain functions? Yes there is
Not sure what you mean by commands
I'll also be adding more clear documentation and examples to the Github repo and PYPI repo
Every function is blacklisted by default, you can allow function calls like so
cval('print("Hello, World!")', allowed_calls=["print"])
Working on updating the examples and PYPI now
@cm sorry for the @ while you are probably sleeping but https://pypi.org/project/cval/
Cval 2.0.0 is out
Should now be ready to be used in actual projects, it now has some extra debug info in it's errors and warnings
Makes working with it much easier
Let me know if you come across any bugs or anything you want implemented
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Normally programming languages have a lexer, which breaks everything into tokens. Then you can parse those tokens.
Dumb Bird
YouTube
Introduction to the safer evaluation function in Python
Cval is a layer of protection for python's eval function. The source code can be found here: https://github.com/ZackeryRSmith/cval
PYPI repo: https://pypi.org/project/cval/