RandomSources is a Python module, providing multiple implementations of Python's random-number generator interface backed by remote random-number sources. It provides simple, drop-in style replacements for Random with data provided by the ANU Quantum Random Numbers server (generated by measuring quantum fluctuations of the vacuum) and by random.org (generated by measuring atmospheric noise). Typical usage looks like this:
>>> import randomSources
>>> qRandom = randomSources.QuantumRandom()
>>> print qRandom.random()
>>> print qRandom.randint(1, 20)
>>> randomDotOrg = randomSources.RandomDotOrg()
>>> print randomDotOrg.random()
>>> print randomDotOrg.random(4)
[0.5996488097316547, 0.40146785806967766, 0.9956706001515375, 0.345638811037305]
>>> print randomDotOrg.randint(1, 20)
>>> print randomDotOrg.randint(1, 20, 12)
[6, 10, 13, 20, 3, 14, 5, 3, 10, 18, 20, 14]
Note that random.org provides a bit quota limited per IP per 24 hours; many functions therefore provide an optional final parameter 'n' to simulate multiple calls, allowing the system to merge some smaller requests in order to minimize bit waste. Towards the same goal, the RandomDotOrg class prefers to subdivide fetches, sending multiple smaller requests when it can prevent waste.
On the other hand, the ANU Quantum Random Numbers server has no bit limit; therefore, the QuantumRandom class fetches 16 KB at a time to serve small requests, minimizing requests to the server. Larger requests are fetched dynamically.