Skip to main content

Ultimate Python Randomizer Library

Project description

🌟 Randize: The Ultimate Python Randomizer Library 🌟

Welcome to Randize — your all-in-one solution for generating random data in Python! This library offers a wide variety of functions to produce random numbers, strings, names, emails, colors, coordinates, and much more. Perfect for testing, simulations, and fun projects! 🎉

📚 Table of Contents

✨ Features

  • Random Number Generation: Generate random integers, floats, dates, times, and UUIDs.
  • Random String Utilities: Create random strings, passwords, and emails.
  • Data Structure Generators: Generate random dictionaries, JSON objects, and more.
  • Web Testing Utilities: Random user agents, URLs, and HTTP request data.
  • Custom Data Mocks: Random color palettes, coordinates, weather conditions, and more!
  • Flexible API: Easy-to-use static methods to integrate with your code.

🔧 Installation

Install Randize via pip:

pip install randize

Or, clone the repository and install manually:

git clone https://github.com/BlazeDevelop/randize.git
cd randize
pip install -r requirements.txt

🚀 Usage

Basic Randomization

First, import the library in your Python script:

from randize import Randize

Generate a Random Number

random_number = Randize.number(1, 100)  # Returns a random number between 1 and 100
print(random_number)

Generate a Random Password

password = Randize.password(length=16, include_digits=True, include_punctuation=True)
print(password)  # Example: 'aB3$dEfGhI8!K@Lm'

Generate a Random UUID

unique_id = Randize.uuid()
print(unique_id)  # Example: '123e4567-e89b-12d3-a456-426614174000'

Generate a Random Email

email = Randize.email(domain='example.com')
print(email)  # Example: 'john@example.com'

Generate a Random Name

name = Randize.name()
print(name)  # Example: 'John Doe'

Generate a Random Date

random_date = Randize.date(start_year=2000, end_year=2023)
print(random_date)  # Example: '2015-06-21'

Generate a Random Time

random_time = Randize.time()
print(random_time)  # Example: '14:30:45'

Advanced Randomization

Create a Random User Profile

user_profile = Randize.struct({
    'name': 'name',
    'email': 'email',
    'birthdate': 'date',
    'address': 'random_coordinate'
})
print(user_profile)

Generate a Random Payment Card

payment_card = Randize.payment_card()
print(payment_card)

Generate Random IPv4 Address

ipv4 = Randize.ipv4()
print(ipv4)  # Example: '192.168.1.1'

Generate Random IPv6 Address

ipv6 = Randize.ipv6()
print(ipv6)  # Example: '2001:0db8:85a3:0000:0000:8a2e:0370:7334'

Generate Random Color Palette

color_palette = Randize.random_color_palette(n=5)
print(color_palette)  # Example: ['#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3']

Generate Random Geographic Coordinates

coordinates = Randize.random_coordinate()
print(coordinates)  # Example: {'latitude': 40.7128, 'longitude': -74.0060}

Generate Random Emoji Pair

emoji_pair = Randize.random_emoji_pair()
print(emoji_pair)  # Example: ('😀', '🚀')

Generate Random Weather Conditions

weather = Randize.random_weather()
print(weather)  # Example: {'condition': 'Sunny', 'temperature': 25, 'humidity': 60}

Generate Random MAC Address

mac_address = Randize.random_mac_address()
print(mac_address)  # Example: '00:14:22:01:23:45'

Generate a Random URL

url = Randize.random_url()
print(url)  # Example: 'https://www.example.com/about'

Generate Random Text with Translation

text = Randize.random_text(language='italian', word_count=10)
print(text)  # Example: Random text in Italian

Generate Random User-Agent String

user_agent = Randize.random_user_agent()
print(user_agent)  # Example: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'

📋 Examples

Here's a quick example of how you can use Randize to generate random data:

# Generate a random color palette
color_palette = Randize.random_color_palette(n=5)
print(f"🎨 Color Palette: {color_palette}")

# Generate a random date between 2000 and 2023
random_date = Randize.date(start_year=2000, end_year=2023)
print(f"📅 Random Date: {random_date}")

📋 To-Do

  • Implement a function to generate random texts.
  • Update documentation with examples of using new functions.
  • Optimize performance of random data generators.
  • Replace random lib to secrets

🤝 Contributing

Contributions are welcome! If you have ideas for new features or have found a bug, feel free to open an issue or submit a pull request. Please read our contributing guide first.

📄 License

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


✨ Happy Randomizing! ✨

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

randize-1.2.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

randize-1.2.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file randize-1.2.1.tar.gz.

File metadata

  • Download URL: randize-1.2.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for randize-1.2.1.tar.gz
Algorithm Hash digest
SHA256 fb3c7bc7bd81ce1abe94c30db9937bed4c3787e731bbc892686881ce8049cbf0
MD5 cb0d1f4e9132671aeab1b85f972d592f
BLAKE2b-256 c7eccfa326dbf6cf6679db2f95fe4262ad9974dfd792d109f7019da76912e5fb

See more details on using hashes here.

File details

Details for the file randize-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: randize-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for randize-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 889dac1bf627d9b1378467cc3bc67072a6399b78d4c55ff2c7633443d6fdc759
MD5 1422054731ad9b877a410e1459e5def2
BLAKE2b-256 b07d013a59a6e59cd81b7a25f9e0802f8871c2dfc0323ae9e31fc90a2debbd4b

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