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! π
- 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.
Install Randize via pip:
pip install randizeOr, clone the repository and install manually:
git clone https://github.com/Flaymie/randize.git
cd randize
pip install -r requirements.txtFirst, import the library in your Python script:
from randize import Randizerandom_number = Randize.number(1, 100) # Returns a random number between 1 and 100
print(random_number)password = Randize.password(length=16, include_digits=True, include_punctuation=True)
print(password) # Example: 'aB3$dEfGhI8!K@Lm'unique_id = Randize.uuid()
print(unique_id) # Example: '123e4567-e89b-12d3-a456-426614174000'email = Randize.email(domain='example.com')
print(email) # Example: 'john@example.com'name = Randize.name()
print(name) # Example: 'John Doe'random_date = Randize.date(start_year=2000, end_year=2023)
print(random_date) # Example: '2015-06-21'random_time = Randize.time()
print(random_time) # Example: '14:30:45'user_profile = Randize.struct({
'name': 'name',
'email': 'email',
'birthdate': 'date',
'address': 'random_coordinate'
})
print(user_profile)payment_card = Randize.payment_card()
print(payment_card)ipv4 = Randize.ipv4()
print(ipv4) # Example: '192.168.1.1'ipv6 = Randize.ipv6()
print(ipv6) # Example: '2001:0db8:85a3:0000:0000:8a2e:0370:7334'color_palette = Randize.random_color_palette(n=5)
print(color_palette) # Example: ['#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3']coordinates = Randize.random_coordinate()
print(coordinates) # Example: {'latitude': 40.7128, 'longitude': -74.0060}emoji_pair = Randize.random_emoji_pair()
print(emoji_pair) # Example: ('π', 'π')weather = Randize.random_weather()
print(weather) # Example: {'condition': 'Sunny', 'temperature': 25, 'humidity': 60}mac_address = Randize.random_mac_address()
print(mac_address) # Example: '00:14:22:01:23:45'url = Randize.random_url()
print(url) # Example: 'https://www.example.com/about'text = Randize.random_text(language='italian', word_count=10)
print(text) # Example: Random text in Italianuser_agent = Randize.random_user_agent()
print(user_agent) # Example: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'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}")- 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
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.
This project is licensed under the MIT License - see the LICENSE file for details.
β¨ Happy Randomizing! β¨