Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Effect Examples

This repository contains examples of using Effect. They demonstrate basic use of Effect to isolate side-effects from code, but also to provide alternative implementations of those side-effecting actions without requiring changes to core application logic.

This package isn't meant to be installed, but rather just copied to your local dev environment and tinkered with. To install dependencies use pip install -r requirements.txt.


The ehttp directory contains a very simple HTTPRequest intent and performers using common HTTP client libraries: requests and treq.

treq is a Twisted-based library, showing that Effect can be used (with the additional txeffect package) to write generic code that can use either Twisted-based asynchronous IO or normal blocking IO. Other asynchronous frameworks (such as Python 3's asyncio) could also be used in this way.


The file has a simple ReadLine intent that uses raw_input (or input in Py3) to prompt the user for input.


The github directory contains a simple application that lets the user input a GitHub username and prints out a list of all repositories that that user has access to. It depends on the ehttp and readline_intent modules.

Note that if you run this example too rapidly, GitHub might temporarily block your IP from making anonymous API requests for some short period of time.

There are two entrypoints into the example: github.sync_main and github.twisted_main. sync_main does typical blocking IO, and twisted_main uses asynchronous IO. Note that the vast majority of the code doesn't need to care about this difference; the only part that cares about it is the * files. All of the logic in is generic.

To run them:

python -m github.sync_main


python -m github.twisted_main

Note that the twisted example does not run on Python 3, but all other examples do.

The github example app has unit tests in They can be discovered and run simply by running py.test in the top-level directory.


Examples for using Effect






No releases published


No packages published