Skip to main content

Python interface system

Project description

Interfaced

Python interface system

Install

pip install interfaced

Quick Start

from interfaced import interface, implements, is_implementation

@interface
class DataStore:
    def save(self, data: str) -> bool: ...
    async def load(self, id: str) -> str: ...

@implements(DataStore)
class MemoryStore:
    def save(self, data: str) -> bool:
        return True
    
    async def load(self, id: str) -> str:
        return "data"

store = MemoryStore()
print(is_implementation(store, DataStore))  # True

Features

  • Strict type enforcement for methods and attributes
  • Generic interfaces with type variables
  • Zero configuration required

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

interfaced-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interfaced-0.1.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file interfaced-0.1.0.tar.gz.

File metadata

  • Download URL: interfaced-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.6 Windows/11

File hashes

Hashes for interfaced-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d466246f663337436e79688758e8a5911ac45459d5eaabd52f86b9843b9366d3
MD5 8becb33e19407f956615e6c66c52867d
BLAKE2b-256 ac1f008a90d5b778a4d40118a0f9b1ee6b15ca44e5779d01a5a528f46cc00a1d

See more details on using hashes here.

File details

Details for the file interfaced-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: interfaced-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.12.6 Windows/11

File hashes

Hashes for interfaced-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 745aee57edcac57c33ac54409c7c6ba77d79fcffeddb16b14c1c0639ef7b6dbc
MD5 488e22e37e89105221161390303bf73c
BLAKE2b-256 b584b6d70467ab83f3ca29f41a1f8abe46c8539f69668ffeffcf489004b8425a

See more details on using hashes here.

Supported by

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