Registry / web-framework / zope-browserresource

zope-browserresource

JSON →
library6.0pypypi✓ verified 85d ago

Implementation of browser resources for Zope, providing a way to publish static and dynamic resources over HTTP. Version 6.0 requires Python >=3.9 and is part of the Zope toolkit. Stable release cadence.

pip install zope.browserresource
INSTALL
IMPORT
SIG · ZOPE-BROWSERRESOUR
Z
zope-browserresource
web-frameworkpythonv6.0
Install
4.1s avg
Import
26ms
Disk
37MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.028s · 34.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.1s · import 0.024s · 35MB
37MB installed
● package 37MB
Code
Verified usage

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

IResource
from zope.browserresource.interfaces import IResource
from zope.browserresource import IResource
IResource is in the submodule interfaces, not top-level.
Resource
from zope.browserresource.resource import Resource
from zope.browserresource import Resource
Resource class is in the resource submodule, not top-level.

Define a basic browser resource that returns a simple response.

from zope.browserresource.resource import Resource from zope.browserresource.interfaces import IResource from zope.interface import implementer @implementer(IResource) class MyResource(Resource): def __init__(self, request): self.request = request def __call__(self): return b"Hello, world!"
Debug
Known issues
breakingIn version 5.x, the resource base class was in zope.browserresource.browserresource; in version 6.x it is in zope.browserresource.resource.
fix
Change import: from zope.browserresource.browserresource import Resource → from zope.browserresource.resource import Resource
affects: 5.x to 6.0
deprecatedIResource interface no longer directly inherits from IBrowserPublisher; use separate publication directives if needed.
fix
Explicitly implement zope.publisher.interfaces.IBrowserPublisher if you need custom publication.
affects: >=6.0
gotchaResource instances must be registered as named adapters (from IBrowserRequest to IResource) to be usable in Zope's traversal.
fix
Use zope.component registration: <adapter factory="..." provides="zope.browserresource.interfaces.IResource" for="zope.publisher.interfaces.IBrowserRequest" name="myresource" />
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Resource' from 'zope.browserresource'
Resource is not exposed at package level; must be imported from submodule.
fix
Use: from zope.browserresource.resource import Resource
TypeError: __init__() missing 1 required positional argument: 'request'
Resource.__init__ requires a request argument when called directly without adapter.
fix
Instantiate with request: MyResource(request) or register as adapter and let Zope provide the request.
Upgrade
Version history
6.0latest on PyPI · released Sep 12, 2025
Audit
Dependencies
zope.componentrequiredRequired for component architecture
zope.interfacerequiredRequired for interface definitions
zope.publisherrequiredRequired for publishing browser resources
Agent activity
44 hits · last 30 days
node
36
OpenAI (training)
1
Resources
zope-browserresource — pip install zope-browserresource · libregistry