Way to check
Project description
VBML: can i help you?
VBML - it is a strong, easy, fast and full-functionality module for parsing and splitting messages to the smaller parts by just two strings - pattern and compared text
To install use this command:
pip install https://github.com/timoniq/vbml/archive/master.zip --upgrade
or:
pip install vbml
To add this project to your project requirements:
-
add string
vbml
to your requirements file -
add element
vbml
to your install_requires list
Documentation
You can find full documentation at wiki
Simple usage example:
from vbml import Patcher
from vbml.validators import ValidatorManager, AbstractAsynchronousValidator
class MyValidator(AbstractAsynchronousValidator):
key = "int"
async def check(self, text: str, *args):
valid = text.isdigit()
if valid:
return int(text)
# Init your VBML main processor
manager = ValidatorManager([MyValidator()])
patcher = Patcher()
# Create a pattern
pattern = patcher.pattern("i am <name> and i love <item>")
# Mind about text sample
text = "i am vasya and i love ice cream"
text2 = "amm.. some text"
def main():
# Go
print(patcher.check(text, pattern))
# >> {'name': 'vasya', 'item': 'ice cream'}
print(patcher.check(text2, pattern))
# >> None
main()
Made with :heart: love by timoniq
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
vbml-0.3.tar.gz
(6.3 kB
view hashes)