Skip to main content

Parse strings using Jinja-style templates

Project description

Gingerino

PyPI Version

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gingerino-0.1.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

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

Hashes for gingerino-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7e1c0c399b79e71ad00760012525dd73f26de220dc29b14b0bf04daa11f31585
MD5 bc834a04429da0adcc00ec15aa0d1568
BLAKE2b-256 ac3883a46c2514bbe5f5b959d5278a0e7f3a6f0f065d8d3329ad35cdb6aa5122

See more details on using hashes here.

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

Hashes for gingerino-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fac459860c38333a8bc54347a917650981c85bf83d87e4ae89c0d0bd75dee26e
MD5 cbcc876042a74adef1e9ef6125625f60
BLAKE2b-256 d2fdc760f07638d6900924a561d7c34ecb35fcb6a6cb4450f3854b1424ce1240

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page