skillfed

zope.globalrequest

Global way of retrieving the currently active request.

zope-globalrequest v3.0 125.0K downloads/30d#11,839 on PyPI2
License unclear ZPL AGING released

What it is and what it does

zope.globalrequest is a small utility that exposes a single function, getRequest(), to retrieve the currently active HTTP request object in Zope and Plone web applications without threading it through function parameters. It works by hooking into Zope's request-handling machinery via zope.publisher and zope.traversing.

The package is explicitly designed for the Zope/Plone ecosystem, where it serves as a convenience for accessing request context. The Zope3 framework itself discourages this pattern in favor of explicit dependency injection, so this package is most relevant for legacy Plone codebases or projects that prioritize pragmatism over strict separation of concerns. It has no external dependencies beyond the Zope framework stack itself.

Use it for:

  • Retrieve the current HTTP request in Plone add-ons without modifying function signatures throughout the codebase.
  • Access request headers, form data, or session information from deeply nested utility functions in Zope applications.
  • Migrate legacy Plone code that relies on implicit request availability to modern Python versions.
  • Implement request-scoped caching or logging in Zope middleware without explicit parameter passing.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a function to retrieve the currently active request object in Zope-based web frameworks without passing it through function parameters.

Yes, if you are actively developing or maintaining Plone or Zope applications. The package is stable, has no known vulnerabilities, and installs with low friction. No, if you are starting a new Zope3 project or prefer explicit dependency injection patterns. The aging maintenance status (336 days since last release) is not a blocker for a stable utility, but verify that your Zope/Plone version is compatible before relying on it for new projects.

Install

zope-globalrequest on PyPI

pip

pip install zope-globalrequest

uv

uv add zope-globalrequest

poetry

poetry add zope-globalrequest

Installing zope.globalrequest

Before you install

Low friction installation with a pure-Python wheel. Maintenance is aging—last release was 336 days ago—but the package remains active on the Zope Foundation repository and supports current Python versions (3.9–3.13).

License in practice

Licensed under ZPL (Zope Public License), which is OSI-approved. License treatment is marked unclear in the fact sheet, so verify the specific terms if your project has strict licensing requirements.

Quickstart

pip install zope.globalrequest

from zope.globalrequest import getRequest
request = getRequest()

Requires Python 3.9 or later. Intended for use within Zope or Plone web frameworks; behavior outside those contexts is not documented.

Verify before relying

  • Whether getRequest() returns None or raises an exception when called outside an active Zope request context.
  • Performance implications of global request retrieval in high-concurrency scenarios.
  • Compatibility with async/ASGI-based Zope deployments.

Package facts

License ZPL (unclear)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — setuptools, zope.interface, zope.publisher, zope.traversing
Maintenance aging — 336 days since the last release
Last repo commit
First released
Downloads 125,023/month — #11,839 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: zope_globalrequest-3.0-py3-none-any.whl

Keywords: zope, request, global

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: PloneFramework :: Zope :: 3Framework :: Zope :: 5Intended Audience :: DevelopersIntended Audience :: Other AudienceIntended Audience :: System AdministratorsLicense :: OSI Approved :: Zope Public LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPython

Tags

zope request contextglobal request object zopezope request retrievalcontextless request accesszope web framework requestplone request handlingzope3 request pattern
zope-ecosystemrequest-contextplone

More Application Frameworks packages