Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Architectural foundation for Python applications.

Project description

Wiring provides architectural foundation for Python applications, featuring:

  • dependency injection
  • interface definition and validation
  • modular component configuration
  • small, extremely pedantic codebase

Wiring is supported and tested on Python 2.7, Python 3.4, Python 3.5, PyPy and PyPy 3.

Quick Peek

import wiring
from wiring import provides, scope, inject, injected, implements

class DatabaseModule(wiring.Module):
   def provide_db_connection(self, database_url=injected('database_url')):
      return db_engine.connect(database_url)

class IUserManager(wiring.Interface):
   def get(id):
      """Get user by ID."""

class DefaultUserManager(object):

   def __init__(self, db_connection):
      self.db = db_connection

   def get(self, id):
      return self.db.sql('SELECT * FROM users WHERE id = :id', id=id)

class UserModule(wiring.Module):
   factories = {
      IUserManager: DefaultUserManager,

graph = wiring.Graph()
graph.register_instance('database_url', 'sqlite://some.db')

user_manager = graph.get(IUserManager)
user = user_manager.get(12)


Full documentation is available at


Support is provided on a best-effort basis, through Stack Overflow. Please tag your question wiring.

For commercial support, please contact me directly at


You can install package for development and testing with:

virtualenv environment
. environment/bin/activate
pip install sphinx tox flake8 wheel sphinx_rtd_theme
pip install -e .

To run the test suite on supported Python versions use:


Or on a single version:

tox -e py27

To validate PEP8 compliance and run code static checking:

tox -e flake8

To generate test coverage report:

rm -rf .coverage coverage
tox -- --with-coverage
open coverage/index.html

To generate html documentation:

cd docs
make html
open _build/html/index.html

To release:

git tag -s -u v0.4.0
python register
python sdist upload -s -i
python bdist_wheel upload -s -i
git push origin v0.4.0


Copyright 2014-2015 Mikołaj Siedlarek <>

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this software except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details

Download files

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

Files for wiring, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size wiring-0.4.0-py2.py3-none-any.whl (23.0 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size wiring-0.4.0.tar.gz (22.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page