Asynchronous Low-code compiler for python
Project description
Asynchronous Low-code compiler for python
How to install
pip install xfox
Clear Example
import asyncio
import xfox
#Custom Function
@xfox.addfunc(xfox.funcs)
async def test_func(item:str, *args, **kwargs):
print("-----",kwargs)
@xfox.addfunc(xfox.funcs)
async def somef(item:str,*args, **kwargs):
return kwargs["ctx"]
@xfox.addfunc(xfox.funcs)
async def function4(*args, **kwargs):
return "FOX"
@xfox.addfunc(xfox.funcs)
async def function1(item:int, type:bool,*args, **kwargs):
return type
@xfox.addfunc(xfox.funcs)
async def function2(item:str, *args, **kwargs):
await xfox.isempty(item)
return eval(item)
@xfox.addfunc(xfox.funcs)
async def inside(item:str, type:bool=False,*args, **kwargs):
return type
# Sync Parsing
print(asyncio.run(xfox.parse("""
$test_func[$test_func[sfsaf]]
$let[test;good] $function1[1;$inside[true];$sadsadsdsd[]] $onlyif[1<2;ONLYIF]
$function2[1+2;dsadasd] sometext
$math[1+2] $function4[]
$function1[1;$inside[fsfdfd;true];$sadsadsdsd[]]
$sdasdasd[sadsadsad]
sdasdsa $exec[true;print(1+231321, end='')] $exec[true;print(1+231321, end='')] $exec[true;print(1+231321, end='')]
$get[test]
$somef[test]
$try[ERROR EXT $get[_];$function1[]] $try[$print[$get[_]];$function2[]]
$function1[1;True;world\\;yes]
""", ctx="asdsdsdasds")))
Output:
----- {'ctx': 'asdsdsdasds'}
----- {'ctx': 'asdsdsdasds'}
[LOG] Mising var item in function2
None
False
3 sometext
3 FOX
True
$sdasdasd[sadsadsad]
sdasdsa 231322 231322 231322
good
asdsdsdasds
ERROR EXT Mising var type in function1
True
Examples
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
xfox-0.1.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
xfox-0.1.1-py3-none-any.whl
(4.1 kB
view hashes)