Cval

A layer of protection for python's eval function
No description
12 Replies
Dumb Bird
Dumb Bird17mo ago
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
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Dumb Bird
Dumb Bird17mo ago
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
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Dumb Bird
Dumb Bird17mo ago
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"])
Dumb Bird
Dumb Bird17mo ago
Some tests for the new cval
Dumb Bird
Dumb Bird17mo ago
Working on updating the examples and PYPI now
Dumb Bird
Dumb Bird17mo ago
@cm sorry for the @ while you are probably sleeping but https://pypi.org/project/cval/
PyPI
cval
A layer of protection for python's eval
Dumb Bird
Dumb Bird17mo ago
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
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Dumb Bird
Dumb Bird17mo ago
Normally programming languages have a lexer, which breaks everything into tokens. Then you can parse those tokens.