Skip to main content

An inversion-of-control (IoC) container for building decoupled, configurable, pluggable applications.

Project description

https://img.shields.io/pypi/v/wired.svg https://github.com/mmerickel/wired/workflows/Build/test%20on%20Linux/badge.svg https://github.com/mmerickel/wired/workflows/Build/test%20on%20MacOS/badge.svg https://github.com/mmerickel/wired/workflows/Build/test%20on%20Windows/badge.svg Documentation Status

Have a large application where you want to decrease coupling between components? Need to supply configuration to your application’s various services? Want to make a pluggable application where others can supply services?

Inversion of Control and Dependency Injection are two patterns commonly used for these goals.

wired is an implementation of an inversion-of-control (IoC) container and may be used as the core of a dependency injection (DI) framework or simply as a way to separate config-time from runtime for services in an application. It also provides caching such that a container maintains a local copy of each service as they are instantiated.

wired aims to scale down to the simplest cases and up to very large, custom systems. It has one dependency and that dependency has one dependency.

See https://wired.readthedocs.io or docs/index.rst in this distribution for detailed documentation.

0.3 (2020-11-29)

  • Added the __wired_factory__ protocol which enables classes/functions. This feature allows objects to declare their factory in a reusable way near the definition of the class/function instead of near the ServiceRegistry.register_factory invocation. Build some decorators that automatically inject this protocol! See https://github.com/mmerickel/wired/pull/41

  • Added the wired.service_factory venusian decorator which can be used to discover factories by setting up a venusian.Scanner and scanning your code to auto-register the services. In the future wired will likely provide top-level scanning, but for now you have to do it yourself and there are examples in the docs. See https://github.com/mmerickel/wired/pull/41

0.2.2 (2020-05-26)

0.2.1 (2019-08-12)

0.2 (2019-04-22)

Backward Incompatibilities

  • wired.ServiceContainer.set has been redefined to set a service instance for a specific context object instead of for a type-of-context. The new method wired.ServiceContainer.register_singleton is a direct replacement for the old behavior.

Features

  • Add wired.ServiceContainer.register_factory and wired.ServiceContainer.register_singleton which are per-container analogues to their per-registry variants on wired.ServiceRegistry.

  • Edit docs to (a) improve sales pitch, (b) split into a couple of sub-pages, and (c) provide a tutorial. Update README and setup.py description a bit as well. See https://github.com/mmerickel/wired/pull/6

0.1.2 (2019-03-23)

  • Add support for Python 3.7.

  • Fix an issue where two different service classes with the same name would be treated as the same service, defeating the type-based lookup.

0.1.1 (2018-08-04)

  • Improve memory management slightly in cases where many short-lived context objects are used by tracking and cleaning up their weakrefs.

0.1 (2018-08-01)

  • Initial release.

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

wired-0.3.tar.gz (53.5 kB view details)

Uploaded Source

Built Distribution

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

wired-0.3-py2.py3-none-any.whl (14.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file wired-0.3.tar.gz.

File metadata

  • Download URL: wired-0.3.tar.gz
  • Upload date:
  • Size: 53.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for wired-0.3.tar.gz
Algorithm Hash digest
SHA256 1122ff2df20aed18e8fe318daba13afc80640bc81f4bb0c2499c73c6a1dc4df0
MD5 a15d1e0d954937a7f15cbd485ff74879
BLAKE2b-256 1b04826a527e121d9d50d4ca61c9ebb591a90eaf5287fd8c806e5953250a5464

See more details on using hashes here.

File details

Details for the file wired-0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: wired-0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for wired-0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 08dcb4ccfe8c0ee5d7a65e73520b4cd838420491a640b5c8d12d39e26aee8e84
MD5 c0d887f6aa3968f7afb9e8e63b5d7f57
BLAKE2b-256 1e3e6ddb3d4370db51847a56a6e5fecada7181543d3302789063dad9b4645cf4

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