Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Stop being so black & white. Mix things up a bit and execute code sometimes.

Project Description

Stop being so black and white. Mix things up a bit and execute code sometimes. This is a Python port of the Ruby sometimes gem.


You can install via pip:

$ pip install sometimes

Or by cloning from Github:

$ git clone
$ cd sometimes
$ python install


Say something every other time:

from sometimes import sometimes

def hello():
    print "Hey, you are awesome. You really are."  # executes warm fuzzies 50% of the time

Have a 50% chance of saying something:

from sometimes import sometimesish

def hello():
    print "Hey, you are awesome. You really are."

Maybe you want to do something several times, but not always the exact same number of times:

from sometimes import times

def pick_nose():

Maybe you want to remind someone of something, but not toooo often (It gets annoying!):

from sometimes import percent_of_the_time

def naughty():
    print "Howdy, Don't forget to register!"  # be annoying, but only 15% of the time

def be_very_polite():

Share a rare moment with your user:

from sometimes import rarely

def spam():
    print "How would you like some spammy spam spam!"  # be really annoying about 5% of the time

Do something most of the time:

from sometimes import mostly

def be_awesome():
    print "Want to see something really cool?"  # Be awesome about 95% of the time

Hold on a minute

Why does it have @sometimes and @sometimesish? I wanted sometimes to behave as described by the gem docs, not how it operates in the gem. I included sometimesish if anyone wanted the gem style functionality.

Release History

This version
History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(2.8 kB) Copy SHA256 Hash SHA256
Source None Feb 9, 2016

Supported By

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 Google Google Cloud Servers