Parse strings using Jinja-style templates
Project description
Gingerino
This is a proof of concept
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.2.tar.gz
(2.7 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.2.tar.gz.
File metadata
- Download URL: gingerino-0.1.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.10.1 Darwin/21.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e1c0c399b79e71ad00760012525dd73f26de220dc29b14b0bf04daa11f31585
|
|
| MD5 |
bc834a04429da0adcc00ec15aa0d1568
|
|
| BLAKE2b-256 |
ac3883a46c2514bbe5f5b959d5278a0e7f3a6f0f065d8d3329ad35cdb6aa5122
|
File details
Details for the file gingerino-0.1.2-py3-none-any.whl.
File metadata
- Download URL: gingerino-0.1.2-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.11 CPython/3.10.1 Darwin/21.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fac459860c38333a8bc54347a917650981c85bf83d87e4ae89c0d0bd75dee26e
|
|
| MD5 |
cbcc876042a74adef1e9ef6125625f60
|
|
| BLAKE2b-256 |
d2fdc760f07638d6900924a561d7c34ecb35fcb6a6cb4450f3854b1424ce1240
|