Simple library for random generations
Project description
GodRandom - A Simple Library for Generating Random Data
Note: This is my first library, so please don't judge too harshly. If you have questions, feel free to reach out! 😊
Installation
Install via pip:
pip install godrandom
Or download the source code and install it locally:
pip install .
Alternatively, clone the repository:
git clone https://github.com/Dron3916/GodRandom.git
Usage
First, import the library:
test.py
from GodRandom import Random
# Your API key
api = "YOUR API KEY FROM RANDOM.ORG!"
# Example usage
# Basic check
Random.hello()
# Generate random integers
data_int = Random.get_randint(api=api, min=1, max=5, amount=4, replacement=True) # 'replacement' defaults to False
# Generate random decimals
data_dec = Random.get_randdec(api=api, amount=4, decimalPlaces=2)
# Generate random UUIDs
data_uuid = Random.get_randuuid(api=api, amount=1)
# Generate random strings
data_string = Random.get_randstring(api=api, amount=1, length=4, characters="abcdifghufslpo")
# Get API usage information
data_user = Random.get_api_info(api=api)
# Print all generated data
print(data_int, data_dec, data_uuid, data_string, data_user)
Parameters
Here is a quick reference for key parameters used in the library:
api: Your API key from RANDOM.ORG. Ensure it is valid and active.min(int): Minimum value for generating integers.max(int): Maximum value for generating integers.amount(int): Number of random values to generate.replacement(bool): Whether values can repeat (default:False).decimalPlaces(int): Number of decimal places for random decimals. Example:decimalPlaces=1→0.1decimalPlaces=5→0.00000
length(int): Length of each generated string (must be between 1 and 32). All strings will have the same length.characters(str): A string containing the set of characters to be used in random strings. The maximum length is 128 characters.
Features
The library is simple and easy to use. It provides the following functionalities:
- Generate random integers (
get_randint) - Generate random decimal numbers (
get_randdec) - Generate random UUIDs (
get_randuuid) - Generate random strings (
get_randstring) - Get your API usage details (
get_api_info)
Feel free to explore and use it in your projects! 🎉
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file GodRandom-0.1.tar.gz.
File metadata
- Download URL: GodRandom-0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61f94a7e613ff5382ad499ab9f09da7708b50d5be8689cf15e913d0c49a8d707
|
|
| MD5 |
a819eb51f31eddbe816d676fa67adb34
|
|
| BLAKE2b-256 |
a2150fa9c405a9f6230a7ae9252b73c383970c33c1c3d971d9f3ff839ae57b37
|
File details
Details for the file GodRandom-0.1-py3-none-any.whl.
File metadata
- Download URL: GodRandom-0.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed183e1aa76652ee4978026e43c5e381f8be224125f553fe7c39276220989e79
|
|
| MD5 |
b779c46bff00a41025353c7f985d01c6
|
|
| BLAKE2b-256 |
602db51dbf3d1515db932826ab53487c7fd2e19b9289501b29d30d6be9ccb715
|