Skip to main content

Python API for HotBits random data generator

Project description

HotBits Python API

Latest Version Total Downloads License Build Status

Python API for HotBits random data generator.

Description

This project is random data generator. It uses is HotBits API web service for radioactively-generated random data.

The web service generates random data. Without API token, only pseudorandom data will be returned. For radioactively-generated random data, you would need to request free API key.

The project is not part of the HotBits. It is just API client for it, made by community. For any information about HotBits, you should use the official website.

Usage

First, you need to import the generator class:

from hotbits import RandomDataGenerator

Then you need to init the generator client, with default service URL:

generator = RandomDataGenerator()

Custom URL can be changed with parameters:

generator = RandomDataGenerator(custom_url='https://example.com')

You can then generate data with specific length and API key:

result = generator.generate(
    length='256',
    apikey='exampleAPIkey'
)

Length of 128 bytes is used by default. If no API key is specified, pseudorandom data will be returned.

Random data are returned as list:

print(result[0]) # First byte
print(result[1]) # Second byte
print(result[3]) # Third byte

You can also look to example file for more examples.

Versioning

This library uses SemVer for versioning. For the versions available, see the tags on this repository.

License

This library is licensed under the GPLv3+ 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

hotbits-1.0.0.tar.gz (16.0 kB view hashes)

Uploaded Source

Built Distributions

hotbits-1.0.0-py3.7.egg (6.6 kB view hashes)

Uploaded Source

hotbits-1.0.0-py3.6.egg (6.6 kB view hashes)

Uploaded Source

hotbits-1.0.0-py3.5.egg (6.7 kB view hashes)

Uploaded Source

hotbits-1.0.0-py3.4.egg (6.7 kB view hashes)

Uploaded Source

hotbits-1.0.0-py3-none-any.whl (16.6 kB view hashes)

Uploaded Python 3

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