Registry / web-framework / zope-ptresource

zope-ptresource

JSON →
library6.0pypypiunverified

Page template resource plugin for zope.browserresource. Version 6.0 supports Python >=3.9. Provides a way to register page templates as browser resources using ZCML directives. Release cadence is low, maintained by Zope Foundation.

pip install zope.ptresource
INSTALL
IMPORT
SIG · ZOPE-PTRESOURCE
Z
zope-ptresource
web-frameworkpythonv6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PageTemplateResource
from zope.ptresource import PageTemplateResource
from zope.ptresource import PageTemplateResource

Register a page template resource using ZCML. The ptresource directive requires package='zope.ptresource' to be included first.

# Example ZCML registration (configure.zcml) <configure xmlns="http://namespaces.zope.org/zope"> <include package="zope.ptresource" file="meta.zcml" /> <ptresource name="my_template" template="my_template.pt" for="*" layer="default" /> </configure>
Debug
Known issues
breakingVersion 6.0 drops support for Python 2 and Python <3.9. Upgrade your Python version if you are on older releases.
fix
Ensure Python >=3.9 and upgrade the library.
affects: <=5.x
deprecatedThe 'layer' attribute in ZCML ptresource directive is deprecated in favor of 'layer_name' (string) or 'layer' as a dotted name. Using integer layer IDs is no longer supported.
fix
Use layer_name='default' instead of layer='default' if using ZCML.
affects: >=6.0
gotchaMissing include of 'meta.zcml' will cause unknown directive error. The ptresource directive is not available until the meta.zcml is loaded.
fix
Add <include package="zope.ptresource" file="meta.zcml" /> before using ptresource directive.
affects: All versions
Upgrade
Version history
6.0latest on PyPI · released Sep 12, 2025
Audit
Dependencies
zope.browserresourcerequiredCore dependency; provides resource infrastructure
zope.pagetemplaterequiredRequired for page template parsing
zope.componentrequiredRequired for ZCML and component architecture
Agent activity
47 hits · last 30 days
node
40
OpenAI (training)
1
Resources
zope-ptresource — pip install zope-ptresource · libregistry