skillfed

python-interface

Pythonic Interface definitions

python-interface v1.6.1 575.6K downloads/30d#5,937 on PyPI111
Permissive license Apache 2.0 Abandoned released

What it is and what it does

python-interface provides a way to define interfaces in Python and verify at class definition time that implementations satisfy those interfaces. It wraps Python's abstract base class (abc) module with a stricter, more explicit API that aims to catch interface violations earlier and report them more clearly.

The package is a lightweight, dependency-free library that works by declaring interface contracts and then checking that concrete classes properly implement them. It's designed for developers who want compile-time-like interface checking in a dynamically-typed language, similar to protocols or interfaces in statically-typed languages.

Use it for:

  • Enforce strict interface contracts in large codebases where implicit duck-typing leads to hard-to-debug errors
  • Document expected method signatures and behavior for plugin or extension systems
  • Catch interface violations at class definition time rather than at runtime call sites
  • Replace or augment abc module when you need clearer error messages for interface mismatches

Worth the install?

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

Declares interfaces and statically asserts that classes implement them, offering stricter semantics and better error messages than Python's built-in abc module.

No. The package is abandoned (last release 2021-04-21, no commits since) and lacks support for modern Python versions. While the Apache 2.0 license is permissive and there are no known vulnerabilities, the high install friction combined with zero maintenance makes it a poor choice for new projects. Consider Python's built-in abc or typing.Protocol instead.

Install

python-interface on PyPI

pip

pip install python-interface

uv

uv add python-interface

poetry

poetry add python-interface

Installing python-interface

Before you install

High install friction and abandoned maintenance status since 2021-04-21—no updates in years. The package is marked Production/Stable but receives no active support or bug fixes.

License in practice

Apache 2.0 permissive license allows commercial and private use with minimal restrictions, suitable for most projects.

Quickstart

pip install python-interface

from interface import Interface, implements

class MyInterface(Interface):
    def my_method(self): pass

@implements(MyInterface)
class MyClass:
    def my_method(self):
        return 'implemented'

Package is abandoned and untested on Python versions beyond 3.8; compatibility with recent Python releases is unverified.

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.8, given its last release predates modern Python releases
  • Whether static assertion behavior matches current abc module semantics in recent Python versions
  • Real-world adoption and maintenance burden if issues arise in production use

Package facts

License Apache 2.0 (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 1,941 days since the last release
Last repo commit
First released
Downloads 575,589/month — #5,937 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python-interface-1.6.1.tar.gz

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Pre-processors

Tags

interface declaration pythonstatic interface checkingprotocol enforcementabstract base class alternativeinterface validationpythonic interface definitionsclass contract checking
interface-checkingabandoned

More Pre-processors packages