Way to check, match & resist. Sofisticated object oriented regex-based text parser
Project description
[VBML] perfect pythonistic parser / string manipulator :sparkles:
Features
- Clean
regex
-based parser - Easy-to-understand validators / Custom validators
- Lots of features out-of-box
I am <name>, i am <age:int> years old
+ I am Steven, i am 20 years old
= {"name": "Steven", "age": 20}
Installation
Install with pip:
pip install vbml
Or with poetry:
poetry add vbml
Run tests
Clone repo from git:
git clone https://github.com/tesseradecade/vbml.git
Go to repository and run tests with poetry
:
cd vbml
poetry install
poetry run pytest
:book: Documentation
Full documentation contents are available in docs/index.md
Simple example
from vbml import Patcher, Pattern
patcher = Patcher()
pattern = Pattern("He is <description> like he has right just turned <age:int> years old")
result1 = patcher.check(pattern, "He is so spontaneous like he has right just turned 10 years old")
result2 = patcher.check(pattern, "He is silly like he has right just turned t3n years old")
result3 = patcher.check(pattern, "Haha regex go brrr")
result1 # {"description": "so spontaneous", "age": 10}
result2 # None
result3 # None
Leave a :star: if this project helped you
Made with :heart: 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-1.1.tar.gz
(11.4 kB
view hashes)
Built Distribution
vbml-1.1-py3-none-any.whl
(15.1 kB
view hashes)