skillfed

venusian

A library for deferring decorator actions

venusian v3.1.1 2.9M downloads/30d#2,835 on PyPI
Permissive license BSD-derived (Repoze) DORMANT released

What it is and what it does

Venusian is a decorator deferral library used primarily by web frameworks and Zope-based systems. Instead of executing decorator logic when a function or class is decorated at import time, venusian lets you attach metadata to the decorated object and then run all registered callbacks during a separate "scan" phase. This separation is useful when you need to defer decisions until after all modules are loaded, or when you want to collect and process decorations in batch.

The library works by attaching callbacks to decorated objects via a `__venusian_callbacks__` attribute, then providing a Scanner that walks through packages and modules to invoke those callbacks. It handles edge cases like inherited decorations, imported objects that shouldn't be double-scanned, and metaclasses that don't behave normally. Venusian has no runtime dependencies and supports Python 3.7 through 3.13 on both CPython and PyPy.

Use it for:

  • Building web frameworks that need to collect route or view decorations from multiple modules before setting up routing tables.
  • Implementing plugin systems where decorators mark plugin entry points but registration must happen after all modules load.
  • Creating configuration systems that defer decorator-driven setup until after dependency injection or configuration is complete.
  • Zope-based applications that use decorators to register adapters, utilities, or event handlers in a deferred manner.
  • Testing frameworks that need to collect test markers or fixtures from decorated functions without executing them at import time.

Worth the install?

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

Venusian defers decorator actions from import time to a separate scan phase, allowing framework authors to register decorated functions and classes after modules are loaded rather than at decoration time.

Yes, if you are building a framework or plugin system that benefits from deferred decorator registration. Venusian is mature, well-tested, and has no dependencies. However, it is dormant (620 days since last release), so adopt it only if you are comfortable with minimal ongoing maintenance and can handle any issues yourself. For typical application code, you likely don't need it.

Install

venusian on PyPI

pip

pip install venusian

uv

uv add venusian

poetry

poetry add venusian

Installing venusian

Before you install

Low friction: pure Python wheel with no runtime dependencies. Dormant maintenance (620 days since last release), but marked Mature and actively supports current Python versions through 3.13.

License in practice

BSD-derived Repoze license is permissive; you can use venusian in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install venusian

from venusian import Scanner

scanner = Scanner()
scanner.scan()

Verify before relying

  • Whether the scan phase can handle circular imports or complex module dependency graphs.
  • Performance characteristics when scanning large codebases with many decorated objects.
  • Specific use cases and integration patterns beyond the Pylons/Zope ecosystem.

Package facts

License BSD-derived (Repoze) (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 620 days since the last release
First released
Downloads 2,893,607/month — #2,835 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: venusian-3.1.1-py3-none-any.whl

Keywords: web, wsgi, zope

Development Status :: 6 - MatureIntended Audience :: DevelopersLicense :: Repoze Public LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

deferred decorator registrationdecorator action deferralscan-time decorator executionframework decorator patterndelayed decorator activationdecorator callback registrationimport-time decorator deferral
decorator-patternframework-utilityzope-ecosystem

More Application Frameworks packages