Parse strings using Jinja-style templates
Project description
Gingerino
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
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
gingerino-0.1.5.tar.gz
(2.8 kB
view details)
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 gingerino-0.1.5.tar.gz.
File metadata
- Download URL: gingerino-0.1.5.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.13 Darwin/23.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05e4a9216ad30b2803f6449c849348497b12b8b302ac98914a087a1e3e980dd7
|
|
| MD5 |
fa0310a37258ba279bd179c664ab6df9
|
|
| BLAKE2b-256 |
806ff13cb24903dc482e597a4672a87adf0df4f93d93c4509bc18dee304f7634
|
File details
Details for the file gingerino-0.1.5-py3-none-any.whl.
File metadata
- Download URL: gingerino-0.1.5-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.13 Darwin/23.1.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84715067c13a76326ca56208bfcd4f9e3755a0c0088c874992b4c1920f6bc6d4
|
|
| MD5 |
d190f9a2778de50556741848d3c73980
|
|
| BLAKE2b-256 |
94c047ef73409cc861203af89342d24bf9cb35bbd449ea13f3933dcf8d95426d
|