Package: viper-lang
ViperViper is a simple, easy to understand language with easy integration capabilities.InstallViper is available for python 3.6+.Viper is now on pypi! It can be installed viapython-mpipinstallviper-langThe dev version can be installed viapython-mpipinstall-Ugit+https://github.com/IAmTomahawkx/viper-langAnd can be imported into your projectimportviperPython UsageTo use Viper in your application, make use of the two eval methods, viper.eval and viper.eval_file functions. These functions
are asynchronous, and must be run using asyncio, whether that be through theawaitkeyword, or something such asasyncio.run. The asyncio docs can be foundhere.importviperimportasynciocode='myvar = "hi"'asyncio.run(viper.eval(code))orimportasyncioimportviperasyncio.run(viper.eval_file("myfile.vp"))you can pass defaults to be injected into the namespace, as suchimportasyncioimportviperasyncio.run(viper.eval("say(myvar)",injected={"myvar":"blue"}))for more control over the creation, you can create your ownviper.Runtimeinstanceimportasyncioimportviperruntime=viper.Runtime("<input>",injected={"myvar":"blue"},allow_unsafe_imports=False)code="say(myvar)"asyncio.run(runtime.run(code))You can use this to disable features like unsafe modules, such as therequestsmodule, or thefilesmodule.importasyncioimportviperruntime=viper.Runtime("<input>",allow_unsafe_imports=False)code="import files"asyncio.run(runtime.run(code))The above will raise a ViperModuleError.SyntaxVariablesvariables are set like in python, but with a dollar sign ($) in front of the name. variables are retrieved in the same way,
the name with a dollar sign ($) in front. variables can be marked asstaticby puttingstaticin front of the variable
name. static variables cannot be changed by anything other than intervention in python codemyvar = "red"

static mystaticvar = "blue"

mystaticvar = "hello"  <-- StaticErrorfunctionsfunctions are created either in python and passed to the namespace, or in viper. functions created in viper follow this syntaxfunc myfunc() {
    return
}quite similar to python, with a few key differences. you may putstatic ` in front of the `funckeyword to mark the function as static,
preventing it from being reassigned.static func myfunc() {
    return
}arguments look like the followingfunc myfunc(argument1, argument2) {
    return
}an argument can be made optional by inserting a question mark (?) in front of the argument name, E.x.func myfunc(argument1, ?optional_arg1) {
    return
}optional arguments that are not given will be passed as anoneobject (note that this is not the same as a pythonNone)functions are called the same as in python:func myfunc() {
    return
}
myfunc()builtinsthe viper namespace is left quite empty by default. The following are included in the default namespace:
- say(*args) - equivilant toprintin python.
- help(obj) - prints an objects help.
- dir(obj) - lists all attributes an object has.Types are included in the namespace:
-string-integer-bool-dictionary-listthere is alsotrue/false, which are the booleans.a full examplestatic globalvar = "hi"

func name(arg, ?arg1) {
    var = 1
    if (var is 1) {
        var += 1
    }
    elif (var is not 1) {
        var = "stuff"
    }
    else {
        var = none
    }
}

func main() {
    say("hi")
    name("hello")
}
main()Discord.py integrationto make things easier, theviper.exts.discordmodule makes it easy to pass safe objects, with limited accessibility, to viper,
making it easy to pass discord.py models (indirectly) to your users, without fear of leaking your token and/or other sensitive data. Simply pass a discord.py model to its respectiveexts.discordcounterpart, and pass that to your viper namespace