Parse strings using Jinja-style templates
Project description
Gingerino
This is a proof of concept
Installation
pip install gingerino
Usage
from typing import Literal
from gingerino import Gingerino
class UserInfo(Gingerino):
name: str
age: int
unit: Literal["years", "months"]
template = "{{ name }} is {{ age }} {{ unit }} old"
user = UserInfo(template)
user.parse("Marco is 24 years old")
print(user.name, user.age, user.unit)
# Marco 24 years
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.3.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.3.tar.gz.
File metadata
- Download URL: gingerino-0.1.3.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.19.16-200.fc36.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd232c58e69649e6aebc3c9c9276eb7493f13c4d2cc925b6282bae09584028e1
|
|
| MD5 |
925794769b95800311eddc4d3cd08c48
|
|
| BLAKE2b-256 |
4e87f47e96f00dd69b43b5729b4d79aeecffd626a257bb58ca096a3ffc8df9ef
|
File details
Details for the file gingerino-0.1.3-py3-none-any.whl.
File metadata
- Download URL: gingerino-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.11.0 Linux/5.19.16-200.fc36.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0aa1e4a0fb7757ca2f895dcc35722c71a383a04383c6a3220729b5992979ba73
|
|
| MD5 |
c5fb533230ca8b20ab1b15e395a76ca3
|
|
| BLAKE2b-256 |
26ff7ceac47f762fb43a6613fa97d3997c058ae30acbffdbdd55933fa245e3ec
|