Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/__pycache__
**/dist
**/randomapi.egg-info
7 changes: 4 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)
MIT License (MIT)

Copyright (c) 2014 mitchchn
Original work Copyright (c) 2014 mitchchn
Modified work Copyright (c) 2020 Tantusar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
randomapi
=========

[![PyPI version](https://badge.fury.io/py/randomapi.svg)](https://badge.fury.io/py/randomapi)

Python implementation of the RANDOM.org JSON-RPC API:
http://api.random.org/json-rpc/1/
http://api.random.org/json-rpc/2/

RANDOM.org generates true random numbers using a seed based on atmospheric radio noise. This is useful for applications where pseudo-random generators are not good enough, such as cryptography.

Expand All @@ -18,13 +20,16 @@ Features
Requirements
------------

- Python 2.6 or higher
- Python 2.6 or higher, or 3.6 or higher
- An API key from: http://api.random.org

Example Usage
-------------
```py
from randomapi import RandomJSONRPC

# Returns a list of 5 true random numbers between 0 and 10
# Returns a list of 5 true random numbers between 0 and 10

random_client = RandomJSONRPC(api_key) # Requires a valid API key
nums = random_client.generate_integers(n=5, min=0, max=10)
random_client = RandomJSONRPC(api_key) # Requires a valid API key
nums = random_client.generate_integers(n=5, min=0, max=10).parse()
```
Loading