Skip to main content
Help us improve Python packaging – donate today!

A pure-python random number generator expander

Project Description

A pure-python random number generator expander.

Given a random number generator that yields numbers in the range 1-n, create a new random number generator that yields numbers in the range 1-y where y>x, x>1, y>1, y>x**2

Codeship Status Build Status Downloads Latest Version Supported Python versions Development Status Wheel Status Egg Status Download format License

How do I get set up?

  • python setup.py install
  • Dependencies: six
  • Dependencies (test): Coverage, nose
  • How to run tests: ./runtests.sh
  • Deployment instructions: pip install shifty

Contribution guidelines

I accept pull requests.

What about test coverage?

There is a full suite of unit-tests.

Who do I talk to?

  • Francis Horsman: francis.horsman@gmail.com

Example

>>> from randy import randy
>>> import random
>>> r = randy(5, 7, fn=lambda: random.randint(1, 5))

Slice it:
>>> random_value = r[2] 3

Call it:
>>> random_value = r() 1

Iterate with it:
>>> random_value = iter(r).next() 5

Print it:
>>> str(r) 'randy(7 from 5): [[1, 2, 3, 4, 5], [6, 7, 1, 2,3], [4, 5, 6, 7, 1], [2, 3, 4, 5, 6], [7, 0, 0, 0, 0]]'

Release history Release notifications

This version
History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

History Node

0.0.4

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
randy-0.9.3-py2.py3-none-any.whl (5.0 kB) Copy SHA256 hash SHA256 Wheel 2.7 Mar 18, 2015
randy-0.9.3.tar.gz (5.4 kB) Copy SHA256 hash SHA256 Source None Mar 18, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page