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.6.tar.gz
(4.6 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.6.tar.gz.
File metadata
- Download URL: gingerino-0.1.6.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4af5aa25a78135b80a73cf6a2514333769aebd83055cc01af85ab154e17b0ee
|
|
| MD5 |
7c22cbb851602cfe42a6480499b84c93
|
|
| BLAKE2b-256 |
263d37f069a57c4e370f7450bbeb6d80bc50591d1cbfebefa96d858aa6c1684e
|
File details
Details for the file gingerino-0.1.6-py3-none-any.whl.
File metadata
- Download URL: gingerino-0.1.6-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4adafca0814af1912e074ccb7ec38b704e236bb6fa35532e58fffa7bd5a1f131
|
|
| MD5 |
a5a8f8caffb7d3d97369b1731033eaea
|
|
| BLAKE2b-256 |
ba61c04b0fb3d8900278a9ff634e8a5079636d421c9c6afe53e96b0f8a5b968e
|