Skip to main content

Parse strings using Jinja-style templates

Project description

Gingerino

PyPI Version

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.4.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.4-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file gingerino-0.1.4.tar.gz.

File metadata

  • Download URL: gingerino-0.1.4.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.13 Darwin/23.0.0

File hashes

Hashes for gingerino-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0349955e0b64c2eb659b1b60aae20f1c496c75309826c0de3a380aa1237fe454
MD5 f9734c0c5940144a7393fe74f3693d6f
BLAKE2b-256 037134190d065f0dcc1b82498123248bf8ee330db9006202b17beb237ae57ee5

See more details on using hashes here.

File details

Details for the file gingerino-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: gingerino-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.13 Darwin/23.0.0

File hashes

Hashes for gingerino-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6737bc77109e44f8e15c8333edf641a580bc30de9c3377a613b6cb0efbcb8081
MD5 aa9b353f8919e0a0ece9deec1020d90c
BLAKE2b-256 03e11a3a23c5aca1baca77464a778e224f4f4070328b1652ecb2dbf9dff74a14

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