Skip to main content

Way to check, match & resist. Sofisticated object oriented regex-based text parser

Project description

[VBML] perfect pythonistic parser / string manipulator :sparkles:

PyPI - License PyPI - Downloads GitHub repo size GitHub issues by-label

Features

  • Fast 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


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.0.tar.gz (10.9 kB view hashes)

Uploaded Source

Built Distribution

vbml-1.0-py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page