skillfed

xlocal

execution locals: killing global state (including thread locals)

xlocal v0.5 132.5K downloads/30d#11,552 on PyPI
License unclear UNKNOWN Abandoned released

What it is and what it does

xlocal implements execution-local storage—a restricted variant of thread-local storage where attribute bindings are scoped to a context-managed code block and all functions it calls, rather than persisting globally or thread-wide. Attributes set via a with-statement are visible to all code invoked within that block, including nested function calls, but are automatically cleaned up when the block exits and do not leak to other threads or greenlets.

The package is designed for frameworks and libraries that invoke handler or plugin code and want to pass execution-specific state without using globals or thread locals. It prevents called code from rebinding state of its caller and ensures clean lifecycle management. However, the package has been abandoned since 2012-11-16 and is not actively maintained.

Use it for:

  • Pass request-specific context to handler functions spawned in threads or greenlets without using globals.
  • Implement per-execution state in web frameworks or plugin systems where multiple concurrent executions need isolated bindings.
  • Prevent state leakage when invoking user code that should not modify the caller's execution context.
  • Manage thread-local or greenlet-local state with explicit lifecycle control via context managers.

Worth the install?

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

Provides execution-local storage that scopes attribute bindings to a code block and its callees, preventing state leakage across threads or greenlets.

No. The package is abandoned (last release 2012-11-16, no maintenance since), has unclear licensing, high install friction (zip-only distribution), and unspecified Python version support. Modern alternatives provide similar functionality with active maintenance. Use only if maintaining legacy code already depending on it.

Install

xlocal on PyPI

pip

pip install xlocal

uv

uv add xlocal

poetry

poetry add xlocal

Installing xlocal

Before you install

High install friction: distributed as a zip file rather than a wheel or sdist. Package is abandoned—last release was 2012-11-16 with no commits or maintenance activity since. Not suitable for new projects.

License in practice

License is marked UNKNOWN with no SPDX identifier; actual licensing terms are unclear. Verify the LICENSE file in the source before using in commercial or copyleft-sensitive contexts.

Quickstart

from xlocal import xlocal

xcurrent = xlocal()

with xcurrent(x=1):
    print(xcurrent.x)  # prints 1

# Outside the context, xcurrent.x raises AttributeError

Python version support is unspecified; package was last released in 2012 and may not work on modern Python versions.

Verify before relying

  • Whether xlocal works on current Python versions or only on Python 2.x.
  • Current compatibility with modern threading or async/await patterns.
  • Whether the zip distribution includes all necessary files or if setup.py is present.

Package facts

License UNKNOWN (unclear)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 5,019 days since the last release
First released
Downloads 132,453/month — #11,552 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: xlocal-0.5.zip

Tags

execution local storagethread-safe context variablesscoped attribute bindinggreenlet-safe localscontext manager state isolation
abandonedlegacy

More Software Development packages