htmlmeta_hub
Build Status:
htmlmeta_hub offers lightweight support for managing metadata on webpages.
This package simply and conveniently manages a dict of "metadata"", and renders it appropriately.
There are helpers for the Pyramid framework which will attach the metdata object to a request, allowing you to build up metadata throughtout the request cycle and then finally render.
A typical way to use this package in the Pyramid framework:
Include this package in your application's __init__.py:
def main(global_config, **settings):
...
# custom htmlmeta
config.include("htmlmeta_hub.pyramid_helpers")
If you are using "class based views", you can set some default metadata in a core handler:
class Handler(object):
def __init__(self,request):
self.request = request
# set some defaults
self.reqesut.htmlmeta.set_many(\
title="MyApp",
description="awesome",
keywords="fun!",
)
and then you can add specific metadata in each view's handler:
class ContentPage(Handler):
def view(self):
content= ...
self.request.htmlmeta.set('title', content.title)
self.request.htmlmeta.set('description', content.description)
In a template, such as this page.mako example, you can access specific bits of
the metadata, or render an entire payload:
<title>${request.htmlmeta.get('title')|n}</title>
${request.htmlmeta.as_html()|n}
Pyramid helpers existed until version 0.3.x but were dropped in favor of the
@reify request method offered by the config.include method.
Pylons helpers existed until version 0.1.2 but were dropped.
Metadata
Release files for htmlmeta-hub 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| htmlmeta_hub-0.5.0.tar.gz | 7.5 kB | Without provenance | Details |
Release files / htmlmeta_hub-0.5.0.tar.gz
| Download URL | htmlmeta_hub-0.5.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37f7c75f75ddd96d214dba7dcbe2aded84e392be2899af260c9800b5681f2f7d
|
|
BLAKE2b-256 checksum How to use checksums |
1b757a589eb2292881f4d10132f32b10ea1e8fd7407e44b771766aebb7dcf490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/5.0.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
|
Security for htmlmeta-hub 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.