Skip to content

buurro/gingerino

Repository files navigation

Gingerino

PyPI Version

This is a proof of concept

Installation

pip install gingerino

Usage

from dataclasses import dataclass
from typing import Literal

from gingerino import parserino


@dataclass
class UserInfo:
    name: str
    age: int
    unit: Literal["years", "months"]


template = "{{ name }} is {{ age }} {{ unit }} old"
user = parserino(UserInfo, template, "Marco is 24 years old")

print(user.name, user.age)
# Marco 24

About

Parse strings using Jinja-style templates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published