Skip to main content

Build Status Code Coverage

Switchboard

Switchboard is a Python WSGI app that makes it easy to toggle features in a variety of Python web frameworks. Created to enable A/B and user testing at SourceForge, it features an easy-to-use admin dashboard with powerful conditions for activating a particular feature.

Admin Dashboard

What follows is an abbreviated version of Switchboard's full documentation.

Getting Started

Want to use Switchboard in your application? Keep reading. Interested in developing on Switchboard or running a small example locally? Take a look at the Development section.

Installing

Install Switchboard and its dependencies using pip:

pip install switchboard

Setup

Next, embed Switchboard and its admin UI within the application. Framework-specific details can be found in Switchboard's documentation.

Using Switches

Switchboard's basic unit is a switch. Every switch has a unique key associated with it and is either active (on) or inactive (off), so using it in code is simple:

>>> from switchboard import operator
>>> operator.is_active('foo')
False

In this case we checked to see if the "foo" switch was active. By default, Switchboard will auto-create any switches that don't already exist, such as "foo". Auto-created switches default to an inactive state. This just scratches the surface; there's so much more that a switch can do.

Development

These instructions cover setting Switchboard up locally for development and testing purposes. See Getting Started for notes on how to use Switchboard within a web application.

Prerequisites

  • Virtualenv: $ sudo easy_install virtualenv

Bootstrapping

  1. Make a virtualenv workspace: $ virtualenv --no-site-packages .venv
  2. Activate the virtualenv: $ source .venv/bin/activate
  3. Install all dependencies: $ make install

Running the Example App

Switchboard includes an example application, which is handy both for doing development and for taking it for a test drive in a very simple environment. It also provides an example of setting Switchboard up to run within a Bottle-based application.

To run:

$ make example

At this point a very simple application is now running at http://localhost:8080 and the admin UI is accessible at http://localhost:8080/_switchboard/. The application has one switch (example) and outputs text that tells you whether the switch is active.

Running Tests

Switchboard includes both unit tests and functional tests of the admin dashboard, using the example application.

To run the unit tests:

$ make test

The functional test requires both an updated Firefox and geckodriver:

$ npm install -g geckodriver

To run the functional tests:

$ make functional-test

Releasing

To distribute a new release of Switchboard:

  1. Update the version in setup.py, following Semantic Versioning.
  2. Cut the release:
$ make release

Versioning

We use Semantic Versioning for versioning. For the versions available, see the tags on this repository.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License - see the LICENSE file for details.

Acknowledgments

Switchboard began life as a port of Disqus' Gargoyle, a feature flipper for Django. David Cramer's Pycon lightning talk on Gargoyle had me drooling for that same feature flipping fun in non-Django apps.

Release files for switchboard 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for switchboard 1.6.0
File Size Uploaded
switchboard-1.6.0.tar.gz 50.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for switchboard 1.6.0
File Interpreter ABI Platform
switchboard-1.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 111.2 kB

Release files / switchboard-1.6.0.tar.gz

Download URL switchboard-1.6.0.tar.gz
Size 50.9 kB
Tags Source
SHA-256 checksum
How to use checksums
42cc4b0715c4a1ba1e3c9bfcc10022f5f0a9f67794d9ea1d376b1ebe71045c17
BLAKE2b-256 checksum
How to use checksums
dfbd5dca6da53494fd809620fe85ea771f0c6f8a6b59e5cc6b92ba9dd8257e65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.26.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.8

Release files / switchboard-1.6.0-py3-none-any.whl

Download URL switchboard-1.6.0-py3-none-any.whl
Size 60.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1ca556c4796f816939b8c0ae3c4b1963ebdb0e139e3bd90b1e549a024ac5db8
BLAKE2b-256 checksum
How to use checksums
29f7beae8b6bbf918a2d62d347b0d697d012767f4ad250e41bf8341a50325ef3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.26.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.8

Release history Release notifications | RSS feed

1.6.10

2 release files

1.6.9

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

This release

1.6.0 This release

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

1 release file

1.5.0

2 release files

1.4.0

3 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page