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 htmldict import HTMLDict
from p2d2 import 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.11.tar.gz
(7.2 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
htmldict-0.1.11-py3-none-any.whl
(12.1 kB
view details)
File details
Details for the file htmldict-0.1.11.tar.gz.
File metadata
- Download URL: htmldict-0.1.11.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06046e1250241ea0c2895da5014dd1730f07cdcae19508545270f2ae0aedc2ec
|
|
| MD5 |
bff16e1321f4651718be9189050b26ca
|
|
| BLAKE2b-256 |
b6a9b37c9a0d3847a9c729052f6d591e5a4cfcd8124e68b7b9fb5103f26bb78b
|
File details
Details for the file htmldict-0.1.11-py3-none-any.whl.
File metadata
- Download URL: htmldict-0.1.11-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f95a691f095287f5a9c83d614ea1e72dfde37bcc07335fc028b13f119315fa41
|
|
| MD5 |
be48d9c741465eacd51eb35afc385b68
|
|
| BLAKE2b-256 |
2c64feb485a541eb11dabc3186a51247675a038f8b0c08b02330e1798c3993b7
|