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
# streak

streak is a library for calculating win/loss streaks. It uses Redis as its backend for collecting the data.
This is a Python port of the original [streak]( Ruby gem.

## Installation

## Usage

>>> from streak import Streak
>>> streak = Streak()
>>> streak.aggregate('david', 3)
>>> streak.aggregate('david', -2)
>>> streak.aggregate('david', 5)
>>> streak.aggregate('david', -1)
>>> statistics = streak.statistics('david')
>>> print statistics
{'losses_streak': 2, 'wins_streak': 5, 'wins': 0, 'losses_total': 3, 'losses': 1, 'wins_total': 8, 'total': 11}
>>> streak.reset_statistics('david')
>>> statistics = streak.statistics('david')
>>> print statistics
{'losses_streak': 0, 'wins_streak': 0, 'wins': 0, 'losses_total': 0, 'losses': 0, 'wins_total': 0, 'total': 0}

You can also configure the keys used in Redis:

>>> streak = Streak(dict(
namespace = 'streak',
positive_key = 'kills',
positive_total_key = 'kills_total',
positive_streak_key = 'kills_streak',
negative_key = 'deaths',
negative_total_key = 'deaths_total',
negative_streak_key = 'deaths_streak',
total_key = 'total'

If you need to set the Redis instance to something other than `localhost:6379/0`, you can do:

streak.redis = redis.StrictRedis(host = '', port = 6379, db = 7)

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Copyright

Copyright (c) 2012 David Czarnecki. See LICENSE for further details.
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

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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