python-interface
Pythonic Interface definitions
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-interfaceuv
uv add python-interfacepoetry
poetry add python-interfaceInstalling 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
Tags
More Pre-processors packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
asttokensAnnotates Python abstract syntax trees with the…
permissive · top 1,000 on PyPI
progressbar2progressbar2 renders text-based progress bars…
permissive · top 5,000 on PyPI
jusTextjusText removes boilerplate content…
permissive · top 5,000 on PyPI
shtabGenerates shell tab completion scripts for…
copyleft · top 5,000 on PyPI
jsminMinifies JavaScript code by removing…
permissive · top 5,000 on PyPI
interface-metaProvides a metaclass-based system for building…
permissive · top 5,000 on PyPI
dealDeal is a Python library for design by contract…
permissive · top 15,000 on PyPI
abstractcpAllows you to define abstract class properties…
permissive · top 15,000 on PyPI
apimatic-core-interfacesProvides abstract interfaces and type…
permissive · top 15,000 on PyPI
icontracticontract enforces design-by-contract in Python…
permissive · top 15,000 on PyPI
backports_abcProvides backports of abstract base classes…
permissive · top 15,000 on PyPI
zope.interfaceProvides a Python implementation of object…
unclear · top 1,000 on PyPI
noneA library providing additional utilities and…
permissive · top 15,000 on PyPI
assertsProvides stand-alone assertion functions for…
unclear · top 15,000 on PyPI
mypy-zopeA mypy plugin that treats zope.interface…
permissive · top 15,000 on PyPI