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)
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.0-py3-none-any.whl
(11.4 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e863165ed7c5e1104fbbde41ac7959b1ac8bb7d8835bf725b7e28d5266f9bca
|
|
| MD5 |
f476ed5449527bae2bcca0597e0b367f
|
|
| BLAKE2b-256 |
29dc012ddc537a679f5f0bc5e0a07fe70dc80ae510e2069861dd266371ad9668
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7c50c476bfd783ea49faa26038a7aac55a2eeda86045f96d4c8516cfe4ba23a
|
|
| MD5 |
ac1df426bc4cf1e230466157c2b8e656
|
|
| BLAKE2b-256 |
ff1ec1f31ed63950388c9b1d96d60f65d58a74e3af05fb74e89057090a3f5604
|