This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Pycopine is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.

As this copy-pasted text suggests, pycopine is heavily inspired by Hystrix.


Pycopine requires Python 3.2+, but may be backportet to 2.7 in the future.


Pycopine is not released yet.

(Planned) Features

  • Detect and report failing services.
  • Short-circuit services that fail on high load to help them recover.
  • Monitor failure rates and performance metrics to detect bottlenecks.
  • Manage thread pool and queue sizes on demand, at runtime, from everywhere.
  • … (more to come)


Lets say we want to speak to a remote service that is slow, unreliable or both:

import time
import random

def crappy_service(input):
    ''' The most useless piece of code ever.'''
    if 'OK' != random.choice(['OK', 'OK', 'f**ck']):
        raise RuntimeError('We broke something.')
    return input

You could throw lots of threads and try/except clauses at the problem and hope to not break the internet. Or you could use pycopine:

from pycopine import Command

class MyCommand(Command):
    ''' Does nothing with the input, but with style. '''

    def run(self, input):
        return crappy_service(input)

    def fallback(self, input):
        return input

# Run and wait for the result
result = MyCommand('input').result()

# Give up after 2 seconds
result = MyCommand('input').result(timeout=2)

# Fire and forget

# Do stuff in parallel
foo = MyCommand('input_a').submit()
bar = MyCommand('input_b').submit()
results = [foo.result(), bar.result()]

# Change your mind midway through
foobar = MyCommand('input').submit()
if foobar.wait(timeout=2):
    result = foobar.reault()
    foobar.cancel(RuntimeError('No time for this sh**t'))
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pycopine-0.1.dev1.tar.gz (8.1 kB) Copy SHA256 Checksum SHA256 Source May 16, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting