— markup language that compiles to regex.
- Clean regex compiler and parser (the regex core can be easily switched)
- Built-in validators and easy to implement custom ones
"I am <name>, i am <age:int> years old" + "I am Steve, i am 50 years old" = {"name": "Steve", "age": 50}Install with pip, poetry or uv:
pip install vbml
poetry add vbml
uv add vbmlfrom vbml import Patcher, Pattern
patcher = Patcher()
pattern = Pattern("I have <amount:int> apples. They are <adj>")
result1 = patcher.check(pattern, "I have 3 apples. They are green")
result2 = patcher.check(pattern, "I have three apples. They are green")
result3 = patcher.check(pattern, "I have apples")
result1 # {"amount": 3, "adj": "green"}
result2 # None
result3 # False