Randum - Random Universal Data Generator for Python
Project description
Randum
Randum - Random Universal Data Generator for Python. A powerful package that generates fake data for testing, development, and data anonymization.
Overview
Randum is a comprehensive fake data generator based on the popular Faker library. It provides an easy-to-use interface for generating realistic fake data across multiple categories including personal information, addresses, companies, internet data, dates, and much more.
Installation
pip install randum
Or install from source:
git clone https://github.com/kactlabs/randum
cd randum
pip install -e .
Quick Start
from randum import Randum
# Initialize Randum
rand = Randum()
# Generate fake data
print(rand.name()) # 'John Doe'
print(rand.email()) # 'john.doe@example.com'
print(rand.address()) # '123 Main St, Springfield, IL 62701'
print(rand.phone_number()) # '(555) 123-4567'
print(rand.company()) # 'Acme Corporation'
print(rand.animal()) # 'Lion'
print(rand.dog_breed()) # 'Labrador Retriever'
print(rand.music_genre()) # 'Rock'
print(rand.song_title()) # 'Dancing in the Moonlight'
print(rand.sport()) # 'Basketball'
print(rand.team_name()) # 'Chicago Bulls'
print(rand.food()) # 'Pizza'
print(rand.dish()) # 'Grilled Salmon with Asparagus'
print(rand.book_title()) # 'The Shadow of Time'
print(rand.author_name()) # 'Jane Smith'
print(rand.vehicle_make_model()) # 'Toyota Camry'
print(rand.license_plate()) # 'ABC-1234'
print(rand.weather()) # 'Sunny'
print(rand.temperature()) # '72°F'
print(rand.medical_profession()) # 'Doctor'
print(rand.disease()) # 'Diabetes'
print(rand.blood_type()) # 'O+'
print(rand.degree()) # 'Bachelor of Science in Computer Science'
print(rand.university_name()) # 'Springfield State University'
print(rand.gpa()) # '3.75'
Features
Personal Information
- Names (first, last, full)
- Email addresses
- Phone numbers
- Social Security Numbers
- Job titles
Address Information
- Full addresses
- Cities, states, countries
- Zip codes
- Coordinates (latitude/longitude)
Company Information
- Company names
- Business emails
- Catch phrases
- Business jargon
Internet & Technology
- Usernames and passwords
- IP addresses (IPv4, IPv6)
- MAC addresses
- URLs and domains
- User agents
Dates & Times
- Random dates
- Past and future dates
- Times and timestamps
- Date ranges
Financial
- Credit card numbers
- Credit card providers
- Currency codes
- IBAN numbers
Text & Lorem Ipsum
- Words, sentences, paragraphs
- Text of various lengths
Colors
- Color names
- Hex colors
- RGB colors
Animals (New!)
- Random animals from all categories
- Mammals, birds, reptiles, amphibians, fish
- Invertebrates
- Domestic and wild animals
- Endangered species
- Dog and cat breeds
Music (New!)
- Music genres and instruments
- Song titles and album names
- Artist and band names
- Record labels and formats
- Streaming platforms
- Concert venues and awards
- Musical terms and keys
- BPM, duration, and track info
- Playlist names
Sports (New!)
- All major sports (team and individual)
- Olympic sports
- Team names and athlete names
- Sport positions and equipment
- Venues and famous stadiums
- Leagues and competitions
- Awards and honors
- Scores, rankings, and records
- Jersey numbers and seasons
Food (New!)
- Fruits, vegetables, meats, and seafood
- Dairy products and grains
- Spices, herbs, and ingredients
- Desserts and beverages
- Cuisines and cooking methods
- Dishes and recipes
- Restaurant types and meal types
- Dietary preferences and taste profiles
- Food prices and nutrition info
Books & Literature (New!)
- Book titles and author names
- Literary genres and publishers
- Book series and chapter titles
- Book formats and editions
- ISBN numbers and publication years
- Literary awards and reading levels
- Book ratings and reviews
- Bookstore types and book clubs
- Literary terms and languages
Vehicles & Automotive (New!)
- Vehicle types and manufacturers
- Car makes and models
- Vehicle years and colors
- Fuel types and transmissions
- Engine sizes and drive types
- Vehicle features and specifications
- License plates and VIN numbers
- Mileage and pricing
- Dealerships and insurance
Weather & Climate (New!)
- Weather conditions and descriptions
- Temperature (Fahrenheit and Celsius)
- Wind speed and direction
- Humidity and precipitation
- Cloud cover and visibility
- Atmospheric pressure
- UV index and air quality
- Weather alerts and seasons
- Moon phases and sunrise/sunset times
Medical & Healthcare (New!)
- Medical specialties and professions
- Diseases and symptoms
- Medical tests and procedures
- Medications and dosages
- Medical equipment
- Hospital departments
- Blood types and vital signs
- Blood pressure and heart rate
- Body temperature and oxygen saturation
- Medical record numbers and patient IDs
- Prescription numbers and ICD-10 codes
- BMI and allergies
- Insurance providers
Education (New!)
- Degree types and abbreviations
- Fields of study and majors
- University and school names
- Course names and codes
- Academic subjects and titles
- Student classifications and IDs
- GPA and letter grades
- Academic terms and years
- Campus facilities and departments
- Extracurricular activities
- Academic honors and awards
- Scholarships and tuition fees
- Credit hours and class sizes
- Graduation years and attendance rates
Advanced Usage
Using Locales
Randum supports multiple locales for generating localized data:
from randum import Randum
# French locale
rand_fr = Randum('fr_FR')
print(rand_fr.name()) # 'Jean Dupont'
print(rand_fr.address()) # French address
# Spanish locale
rand_es = Randum('es_ES')
print(rand_es.name()) # 'María García'
# Multiple locales
rand_multi = Randum(['en_US', 'fr_FR', 'es_ES'])
print(rand_multi.name()) # Randomly picks from any locale
Seeding for Reproducibility
from randum import Randum
# Set seed for reproducible results
Randum.seed(12345)
rand = Randum()
print(rand.name()) # Always generates the same name
# Reset seed
Randum.seed(12345)
rand2 = Randum()
print(rand2.name()) # Same as above
Unique Values
from randum import Randum
rand = Randum()
# Generate unique emails
for _ in range(5):
print(rand.unique.email())
# Clear unique cache
rand.unique.clear()
Optional Values
from randum import Randum
rand = Randum()
# 50% chance of returning None
print(rand.optional.name())
# 80% chance of returning a value
print(rand.optional.email(prob=0.8))
Examples
See example.py for comprehensive usage examples:
python example.py
API Reference
Common Methods
name()- Full namefirst_name()- First namelast_name()- Last nameemail()- Email addressphone_number()- Phone numberaddress()- Full addresscity()- City namestate()- State namecountry()- Country namezipcode()- Zip codecompany()- Company namejob()- Job titletext()- Random textdate()- Random datetime()- Random timeurl()- Random URLipv4()- IPv4 addresscredit_card_number()- Credit card numberrandom_int(min, max)- Random integerpybool()- Random booleancolor_name()- Color namehex_color()- Hex color codeanimal()- Random animalmammal()- Random mammalbird()- Random birdfish()- Random fishdog_breed()- Random dog breedcat_breed()- Random cat breedmusic_genre()- Random music genreinstrument()- Random instrumentsong_title()- Random song titleartist_name()- Random artist namealbum_name()- Random album namesport()- Random sportteam_sport()- Random team sportindividual_sport()- Random individual sportolympic_sport()- Random Olympic sportteam_name()- Random team nameathlete_name()- Random athlete namesport_position()- Random sport positionsport_equipment()- Random sport equipmentfamous_sport_venue()- Famous sport venuesport_league()- Random sport leaguesport_award()- Random sport awardjersey_number()- Random jersey numberseason_year()- Season year formatscore()- Random scorerecord()- Win-loss recordranking()- Ranking positionfood()- Random food itemfruit()- Random fruitvegetable()- Random vegetablemeat()- Random meatseafood_item()- Random seafooddairy_product()- Random dairy productgrain()- Random grainspice()- Random spice or herbdessert()- Random dessertbeverage()- Random beveragecuisine()- Random cuisine typecooking_method()- Random cooking methodmeal_type()- Random meal typedish()- Random dish nameingredient()- Random ingredientrestaurant_type()- Random restaurant typedietary_preference()- Random dietary preferencerecipe_name()- Random recipe namefood_price()- Random food pricecalories()- Random calorie countserving_size()- Random serving sizebook_title()- Random book titleauthor_name()- Random author nameliterary_genre()- Random literary genrepublisher()- Random publisherbook_format()- Random book formatbook_series()- Random book serieschapter_title()- Random chapter titleliterary_award()- Random literary awardreading_level()- Random reading levelbook_condition()- Random book conditionbookstore_type()- Random bookstore typepublication_year()- Random publication yearpage_count()- Random page countisbn()- Random ISBN numberbook_rating()- Random book ratingreview_count()- Random review countedition()- Random book editionlanguage()- Random languagevehicle()- Random vehicle typevehicle_type()- Random vehicle typecar_make()- Random car manufacturercar_model()- Random car modelvehicle_make_model()- Random make and modelvehicle_year()- Random vehicle yearvehicle_color()- Random vehicle colorfuel_type()- Random fuel typetransmission()- Random transmission typeengine_size()- Random engine sizedrive_type()- Random drive typevehicle_feature()- Random vehicle featurelicense_plate()- Random license platevin()- Random VIN numbervehicle_condition()- Random vehicle conditionmileage()- Random mileagevehicle_price()- Random vehicle pricedealership_type()- Random dealership typeinsurance_type()- Random insurance typempg()- Random MPGhorsepower()- Random horsepowerseating_capacity()- Random seating capacityweather()- Random weather conditionweather_description()- Detailed weather descriptiontemperature()- Random temperaturetemperature_celsius()- Temperature in Celsiustemperature_fahrenheit()- Temperature in Fahrenheitwind_speed()- Random wind speedwind_direction()- Random wind directionhumidity()- Random humidity percentageprecipitation()- Random precipitation typeprecipitation_amount()- Random precipitation amountcloud_cover()- Random cloud cover levelvisibility()- Random visibility distancepressure()- Random atmospheric pressureuv_index()- Random UV indexuv_index_level()- UV index level descriptionair_quality()- Random air quality levelair_quality_index()- Random AQIweather_alert()- Random weather alertseason()- Random seasonmoon_phase()- Random moon phasesunrise_time()- Random sunrise timesunset_time()- Random sunset timefeels_like_temperature()- Feels like temperaturedew_point()- Random dew pointchance_of_rain()- Chance of rain percentagemedical_specialty()- Random medical specialtymedical_profession()- Random medical professiondisease()- Random diseasesymptom()- Random symptommedical_test()- Random medical testmedication()- Random medicationmedical_equipment()- Random medical equipmenthospital_department()- Random hospital departmentblood_type()- Random blood typemedical_abbreviation()- Random medical abbreviationbody_system()- Random body systemblood_pressure()- Random blood pressureheart_rate()- Random heart raterespiratory_rate()- Random respiratory ratebody_temperature()- Random body temperatureoxygen_saturation()- Random oxygen saturationmedical_record_number()- Random medical record numberpatient_id()- Random patient IDprescription_number()- Random prescription numbericd10_code()- Random ICD-10 codedosage()- Random medication dosagefrequency()- Random medication frequencybmi()- Random BMIallergy()- Random allergyinsurance_provider()- Random insurance providerdiagnosis()- Random diagnosisdegree_type()- Random degree typedegree_abbr()- Random degree abbreviationdegree()- Full degree namefield_of_study()- Random field of studyuniversity_name()- Random university nameschool_level()- Random school levelschool_name()- Random school nameacademic_subject()- Random academic subjectcourse_name()- Random course namecourse_code()- Random course codeacademic_title()- Random academic titleextracurricular_activity()- Random extracurricular activityacademic_honor()- Random academic honorletter_grade()- Random letter gradegpa()- Random GPAacademic_term()- Random academic termacademic_year()- Random academic yearcampus_facility()- Random campus facilitystudent_classification()- Random student classificationstudent_id()- Random student IDacademic_department()- Random academic departmentcredit_hours()- Random credit hoursgraduation_year()- Random graduation yearclass_size()- Random class sizetuition_fee()- Random tuition feescholarship_name()- Random scholarship namescholarship_amount()- Random scholarship amountattendance_rate()- Random attendance ratestudy_hours()- Random study hours per week
Requirements
- Python >= 3.10
- numpy
- pandas
License
MIT License - see LICENSE file for details
Credits
Randum is based on the excellent Faker library by joke2k and contributors. We are grateful for their work in creating such a comprehensive and well-maintained fake data generation library.
Original Faker Library:
- Repository: https://github.com/joke2k/faker
- Author: joke2k
- License: MIT
Randum has been customized and rebranded with additional features and modifications while maintaining the core functionality and spirit of the original Faker library.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions, please open an issue on GitHub: https://github.com/kactlabs/randum/issues
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
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 randum-1.0.9.tar.gz.
File metadata
- Download URL: randum-1.0.9.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea62aa687de07c221dd6b2072da023bffed32fc84f18df791199ec80940b9cf5
|
|
| MD5 |
d1e2e01852f9949a127e43fe70c15a73
|
|
| BLAKE2b-256 |
74b43d4c2485da8f7493948b39475840a171744d327b7208f3034395ff464bea
|
File details
Details for the file randum-1.0.9-py3-none-any.whl.
File metadata
- Download URL: randum-1.0.9-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d1b62e1cecd3c9f35b50b42b3d434968c3993dbdd884ec5e3e49c8a0a15d9a9
|
|
| MD5 |
b4cb8b8ecc4ee28622c88f8cf7e942d7
|
|
| BLAKE2b-256 |
6ba32e96abb50853e67b1eadcd53b9743573ab6b4921e61793def4772978ffe5
|