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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file python-interfaces-0.1.2.tar.gz.

File metadata

  • Download URL: python-interfaces-0.1.2.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.2

File hashes

Hashes for python-interfaces-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0b809d02d9b9ee635cd1f7088a41184aac0b4ffd8c63424da39c937122972b26
MD5 5d2f2d1c23d3543dbcb19a5c81e558e0
BLAKE2b-256 a864bd3ba8648283efa8b403716f82e0275f5315fd69e65f94e631e6f56dca04

See more details on using hashes here.

File details

Details for the file python_interfaces-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: python_interfaces-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.2

File hashes

Hashes for python_interfaces-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61d2ffdecaff2ffd7166b654bb6ee667823fe4008dee6d23a19d4d5a51242e2e
MD5 0eac8afd8d13f89c4d0b0fc27dced186
BLAKE2b-256 671462c06ba8b8c33e23f361ff28cbe95bf1ea960f8c69fa4edf643c74947bb8

See more details on using hashes here.

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