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("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, "Something irrelevant")
result1 # {"amount": 3, "adj": "green"}
result2 # None
result3 # None
Leave a star if this project helped you
Made 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vbml-1.1.post1.tar.gz.
File metadata
- Download URL: vbml-1.1.post1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.7 Darwin/20.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59e852b35b2c4d3f8e7d927ab2e0a9dde753f3427ab9a61aca7ed2f4d3986f3c
|
|
| MD5 |
77660405ab3a4b7d27a546c931ceebd5
|
|
| BLAKE2b-256 |
ba768b25f75c1ee4d41118676e5f3bb97397eac7eecd68d98054ec27e07974e3
|
File details
Details for the file vbml-1.1.post1-py3-none-any.whl.
File metadata
- Download URL: vbml-1.1.post1-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.6 CPython/3.8.7 Darwin/20.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3037c3f67b79128c48a100326fde833345e7d1e0d466566d37c2c98d08a587d
|
|
| MD5 |
da60c87e7c55da0b52bef06e6ec1fb4e
|
|
| BLAKE2b-256 |
c3ead125147525917dc5a35105e432706a33aebdd41c4707870d8f96133eff2c
|