Metadata-Version: 2.4
Name: vbml2
Version: 2.0.0
Summary: Markup language that compiles to regex.
Project-URL: Source, https://github.com/tesseradecade/vbml
Project-URL: Bug Tracker, https://github.com/tesseradecade/vbml/issues
Project-URL: Documentation, https://github.com/tesseradecade/vbml/blob/master/docs/index.md
Author-email: timoniq <tesseradecades@mail.ru>
Maintainer-email: luwqz1 <howluwqz1@gmail.com>
License: MIT License
        
        Copyright (c) 2020 timoniq-@tesseradecade
        Copyright (c) 2025 luwqz1
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: markup lang,markup language,re,re compiler,regex,regexp,string validation,string-matching,string-parser,very beautiful
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.13
Requires-Dist: kungfu-fp
Description-Content-Type: text/markdown

<p>
  <a href="https://github.com/tesseradecade/vbml">
    <img src=".github/vbml-logo.png" width="200px" style="display: inline-block;">
  </a>
</p>

<p>
— markup language that compiles to regex.
</p>

<img alt="VBML version" src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftesseradecade%2Fvbml%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&query=%24.project.version&style=flat-square&label=version&labelColor=black"></img>
<img alt="Python version" src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Ftesseradecade%2Fvbml%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&query=%24.project.requires-python&style=flat-square&logoColor=fff&label=python&labelColor=black"></img>
<img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dw/vbml?color=lightGreen&labelColor=black&style=flat-square"></img>
<img alt="GitHub issues by-label" src="https://img.shields.io/github/issues/tesseradecade/vbml/bug?labelColor=black&style=flat-square"></img>

## Features

* Clean regex compiler and parser (the regex core can be easily switched)
* Built-in validators and easy to implement custom ones

```js
"I am <name>, i am <age:int> years old" + "I am Steve, i am 50 years old" = {"name": "Steve", "age": 50}
```

## Installation

Install with pip, poetry or uv:

```shell script
pip install vbml
poetry add vbml
uv add vbml
```

## :book: Documentation

[\*here\*](/docs/index.md)

## Example

```python
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, "I have apples")

result1  # {"amount": 3, "adj": "green"}
result2  # None
result3  # False
```
