{ "info": { "author": "David Fundingsland", "author_email": "david@fundings.land", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": "PyRando\n=======\nPyRando is a Python 3 module for interacting with the [random.org](https://random.org) JSON API. PyRando can generate random values using basic methods as well as digitally signed random values using the signed methods.\n\nPyRando is compatible with Python 3.6+.\n\nInstallation\n============\nTo install pyrando, use `pip3`:\n\n $ pip3 install pyrando\n\nGetting Started\n===============\nTo interact with random.org, you will first need to get an api key. Go to [api.random.org](https://api.random.org/json-rpc/1/) and click on *Get a Beta Key*. Once you have an API key, using PyRando is quite straightforward. \n\nFor example:\n\n >>> from pyrando import PyRando\n >>> pr = PyRando('YOUR_API_KEY')\n >>> pr.integers(5, 0, 10)\n [0, 7, 10, 3, 5]\n\nBasic Methods\n=============\n### Integers\nThe `integers` method generates true random integers within a user-defined range. Integer requests take up to four positional arguments:\n* `n` - How many random integers you need. Must be within the [1,1e4] range\n* `min` - The lower boundary for the range. Must be within the [-1e9,1e9] range\n* `max` - The upper boundary for the range. Must be within the [-1e9,1e9] range\n* `base` (optional) - If not provided, the default `base` is set to 10. Allowed values for base are 2, 8, 10, and 16\n\nExamples:\n\n pr.integers(10, 1, 6)\n pr.integers(10, 1, 100, 2)\n \n### Decimals\nThe `decimals` method generates true random decimal fractions from a uniform distribution across the [0,1] interval with a user-defined number of decimal places. Decimal requests take three positional arguments: \n* `n` - How many random decimal fractions you need. Must be within the [1,1e4] range\n* `decimalPlaces` - The number of decimal places to use. Must be within the [1,20] range\n\nExample:\n\n pr.decimals(10, 8)\n\n### Gaussians\nThe `gaussians` method generates true random numbers from a Gaussian distribution. Integer requests take four positional arguments: \n* `n` - How many random numbers you need\n* `mean` - The distributions mean. Must be within the [1,1e4] range\n* `standardDeviation` - The distributions standard deviation. Must be with the [-1e6,1e6] range\n* `significantDigits` - The number of significant digits to use. Must be within the [2,20] range\n\nExample:\n\n pr.gaussians(4, 0.0, 1.0, 8)\n\n\n### Strings\nThe `strings` method generates true random strings. String requests take three positional arguments:\n* `n` - How many random strings you need. Must be within the [1,1e4] range\n* `length` - The length of each string. Must bbe within the [1,20] range. All strings will be of the same length\n* `characters` - A string that contains the set of characters that are allowed to occur in the random stings. The maximum number of characters is 80\n\nExample:\n\n pr.strings(10, 20, 'abcdefghijklmnopqrstuvwxyz')\n\n### UUIDs\nThe `uuids` method generates version 4 true random UUIDs. UUID requests take a single positional argument:\n* `n` - How many random UUIDs you need. Must be within the [1,1e3] range\n\nExample:\n\n pr.uuids(1)\n \n### Blobs\nThe `blobs` method generates BLOBs containing true random data. Blob requests take up to three positional argument: \n* `n` - How many random blobs you need. Must be within the [1,100] range\n* `size` - The size of each blob, measured in bits. Must be within the [1,1048576] range and divisible by 8. The total size of all requested blobs much not exceed 1,048,576 bits (128KiB)\n* `format` - Specifies the format in which the blobs will be returned. Values allowed are `base64` and `hex`. If not value is provided, the default value of `base64` is used.\n\nExamples:\n\n pr.blobs(1, 2048)\n pr.blobs(1, 1024, 'hex')\n \n### Usage\nThe `usage` method returns information related to the usage of a given API.\n\nExample:\n\n pr.usage()\n\nSigned Methods\n==============\nUsage of signed methods is quite similar to that of basic methods. For example, to use signed methods you could input the commands as follows:\n\n >>> pr.signed_integers(10, 1, 6)\n >>> pr.signed_decimals(10, 8)\n >>> pr.signed_gaussians(4, 0.0, 1.0, 8)\n >>> pr.signed_strings(10, 20, 'abcdefghijklmnopqrstuvwxyz')\n >>> pr.signed_uuids(1)\n >>> pr.signed_blobs(1, 2048)\n exi \nThe difference between basic methods and signed methods is the response. Instead of just a list with the random values, signed methods return a dictionary with values for the following keys `data`, `random`, and `signature`. The `random` and `signature` values can be used to authenticate signed values.\n\nTo verify a response, use the `verify_signature` method. The method take the `random` and `signature` values as arguments and responds with a boolean value of either `True` or `False`. For example:\n\n >>> signed_ints = pr.signed_integers(10, 1, 6)\n >>> pr.verify_signature(signed_ints['random'], signed_ints['signature'])\n True", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/dfundingsland/pyrando/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dfundingsland/pyrando", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyrando", "package_url": "https://pypi.org/project/pyrando/", "platform": "", "project_url": "https://pypi.org/project/pyrando/", "project_urls": { "Download": "https://github.com/dfundingsland/pyrando/master.zip", "Homepage": "https://github.com/dfundingsland/pyrando" }, "release_url": "https://pypi.org/project/pyrando/0.3.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Python module for Random.org JSON API", "version": "0.3.0" }, "last_serial": 3743902, "releases": { "0.2.5": [ { "comment_text": "", "digests": { "md5": "83e1b08674747084c316c0add9f122d0", "sha256": "a289ca7bdac0a54e43009baef4144d86bb4be6eb7f91f56d0998a08927c0a062" }, "downloads": -1, "filename": "pyrando-0.2.5.tar.gz", "has_sig": false, "md5_digest": "83e1b08674747084c316c0add9f122d0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4450, "upload_time": "2018-03-27T17:38:23", "url": "https://files.pythonhosted.org/packages/3a/e1/89d0f00a1d14152f46038a61c73b0e5a2533fbf6fc68d1aed6552423dbb0/pyrando-0.2.5.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5e70d7fa3390bf0b89565bc2643dbb4d", "sha256": "8792e6f8ae5107335fe0c813df39d3cc05570a21a3858c755aace62f6216c90b" }, "downloads": -1, "filename": "pyrando-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5e70d7fa3390bf0b89565bc2643dbb4d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4921, "upload_time": "2018-04-07T16:55:11", "url": "https://files.pythonhosted.org/packages/a5/bc/610b6249e35c1fec8028a9d214e2f8fe717e42cd0706460aa306e08b9a96/pyrando-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5e70d7fa3390bf0b89565bc2643dbb4d", "sha256": "8792e6f8ae5107335fe0c813df39d3cc05570a21a3858c755aace62f6216c90b" }, "downloads": -1, "filename": "pyrando-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5e70d7fa3390bf0b89565bc2643dbb4d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 4921, "upload_time": "2018-04-07T16:55:11", "url": "https://files.pythonhosted.org/packages/a5/bc/610b6249e35c1fec8028a9d214e2f8fe717e42cd0706460aa306e08b9a96/pyrando-0.3.0.tar.gz" } ] }