Skip to main content

Python dict objects with the ability to serve html

Project description

A lightweight Python class that extends dict to generate HTML templates and integrate with databases.

Usage

from pathlib import Path
from core import HTMLDict, Database

class Person(HTMLDict):
    _title = "name"
    _subtitle = "role" 
    _redirect_uri = "https://profile/${id}"
    name: str
    role: str
    id: str

# Create instance
person = Person(name="John Doe", role="Developer", id="123")

# Generate HTML
html_card = person.card
html_detail = person.detail
html_label = person.label

# Save to database
class DB(Database):
    person: Person

db = DB("mydb")
person.commit_to_database(db)

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

htmldict-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

htmldict-0.1.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file htmldict-0.1.0.tar.gz.

File metadata

  • Download URL: htmldict-0.1.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11

File hashes

Hashes for htmldict-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4e863165ed7c5e1104fbbde41ac7959b1ac8bb7d8835bf725b7e28d5266f9bca
MD5 f476ed5449527bae2bcca0597e0b367f
BLAKE2b-256 29dc012ddc537a679f5f0bc5e0a07fe70dc80ae510e2069861dd266371ad9668

See more details on using hashes here.

File details

Details for the file htmldict-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: htmldict-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11

File hashes

Hashes for htmldict-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7c50c476bfd783ea49faa26038a7aac55a2eeda86045f96d4c8516cfe4ba23a
MD5 ac1df426bc4cf1e230466157c2b8e656
BLAKE2b-256 ff1ec1f31ed63950388c9b1d96d60f65d58a74e3af05fb74e89057090a3f5604

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