skillfed

backcall

Specifications for callback functions passed in to an API

backcall v0.2.0 14.8M downloads/30d#1,216 on PyPI19
Permissive license Abandoned released

What it is and what it does

backcall is a small utility for specifying and enforcing callback function signatures in APIs. When you accept callbacks from users of your library, backcall lets you define a prototype function that describes the expected signature, then automatically adapts incoming callbacks to match it. If a callback has fewer parameters than the prototype, backcall wraps it to discard extras; if it requires more, backcall raises a TypeError at registration time rather than at call time.

The package has no runtime dependencies and installs cleanly. It is designed for library authors who want to evolve their callback APIs without breaking existing user code. However, the project has been abandoned since 2020 with no recent maintenance, so it should only be used in stable, low-change codebases or as a reference for implementing similar validation logic.

Use it for:

  • Library authors defining stable callback APIs that may evolve over time while maintaining backward compatibility
  • Validating event handler signatures before registering them in event systems or plugin frameworks
  • Adapting third-party callbacks to match your API's expected parameter list without manual wrapping
  • Catching callback signature mismatches early at registration time rather than at runtime

Worth the install?

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

backcall lets you define and validate callback function signatures, automatically adapting callbacks that have fewer parameters than expected and rejecting those that require more.

Yes, if you are maintaining a library with a stable callback API and want lightweight signature validation without dependencies. No, if you need active maintenance or are starting a new project—the package is abandoned and there are no recent updates. Consider it for mature, low-change codebases only.

Install

backcall on PyPI

pip

pip install backcall

uv

uv add backcall

poetry

poetry add backcall

Installing backcall

Before you install

Installation is straightforward with no runtime dependencies. However, the package is abandoned—last release was 2020-06-09 and no commits since then—so it will not receive bug fixes or maintenance.

License in practice

Licensed under BSD (permissive), so you can use it freely in commercial and open-source projects without copyleft obligations.

Quickstart

from backcall import callback_prototype

@callback_prototype
def handle_ping(sender, delay=None):
    pass

callback = handle_ping.adapt(your_callback_function)

Verify before relying

  • Whether the package works correctly with modern Python versions (classifiers list Python 2.7 and Python 3, but no specific version bounds are declared)

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,257 days since the last release
Last repo commit
First released
Downloads 14,815,737/month — #1,216 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: backcall-0.2.0-py2.py3-none-any.whl

License :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3

Tags

callback function signature validationcallback adapter wrapperfunction parameter checkingcallback prototype decoratorAPI callback specificationcallback compatibility checkfunction signature adapter
callback-validationapi-design

More Software Development packages