Skip to main content

Bringing interfaces to Python.

Project description

python-interfaces

CircleCI

Installation

pip install python-interfaces

Usage

from interface import interface

class Iterable:
    def be_iterable(self):
        pass

@interface(Iterable)
class Foo:
    def __init__(self):
        pass

# raises InterfaceException

Local Development

git clone https://github.com/tyleragreen/python-interfaces.git && cd python-interfaces
virtualenv ~/.env/interface
source ~/.env/interface/bin/activate

pip install -r requirements_dev.txt

# Since the tests live outside the package, we install the package in editable mode
pip install -e .
py.test

Other Ideas

  1. Support dunder methods
  2. Enforce method signatures
  3. Require interface methods to be empty/abstract/pass-only

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-interfaces-0.1.2.tar.gz (2.0 kB view hashes)

Uploaded Source

Built Distribution

python_interfaces-0.1.2-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page