Skip to main content

Random.org Api Wrapped in Python

Project description

This Python module provides a wrapper for the Random.org API to generate various types of random data such as integers, sequences, decimal fractions, Gaussian numbers, strings, UUIDs, and random blobs.

Features

  • Generate random integers, integer sequences, decimal fractions, and Gaussian-distributed numbers.

  • Generate random strings, UUIDs, and blobs.

  • Retrieve API usage statistics, including remaining bits and requests.

Installation

Usage

  1. Import the BasicApi class and initialize it with your Random.org API key:

    from basic_api import BasicApi
    
    api = BasicApi(api_key="your_api_key")
  2. Call the available methods to generate random data. For example, to generate random integers:

    random_integers = api.generate_integers(num=5, minimum=1, maximum=100)
    print(random_integers)
  3. You can also check your API usage:

    usage_stats = api.get_usage()
    print(usage_stats)

Running Tests

The project includes tests written using pytest. To run the tests:

  1. Install pytest:

    pip install pytest
  2. Run the tests:

    pytest

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

py_random_dot_org-1.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

py_random_dot_org-1.0.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file py_random_dot_org-1.0.2.tar.gz.

File metadata

  • Download URL: py_random_dot_org-1.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for py_random_dot_org-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e945a973aa0250dda9409fc9623a1234cf39a46cf337d9e2a4dae1e0c1d77d38
MD5 2fe735b50a76844067ae2d1c71b1b854
BLAKE2b-256 ab5203911dd01e2eccc54e54a381d07a5012c6d2549b8068c9a24b9ffe51b0f9

See more details on using hashes here.

File details

Details for the file py_random_dot_org-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for py_random_dot_org-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 421baed47d8ebc5673bb0a588c8b52dcf3c0632eb9dce0b1148f5d49f1e151ca
MD5 e39922d9173c328e0e052ad67239a62f
BLAKE2b-256 c0f02976dd3172a4cc15549a37d3c6d81a3cabdf9c17b6b94616b952484845db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page