Expand description
§🧙♀️ Warlock’s Cauldron
🦀 Fake Data Generator written in Rust - fully inspired by https://mimesis.name 🐍
§Installation
All localizations are enabled by default feature, you can specify localizations in features!
[dependencies.warlocks-cauldron]
version = "0.26.9"
# git = "https://github.com/hack-wrench/warlocks-cauldron"
# features = ["en"] # For example to use only english localization§Supported languages
There are currently 26 languages available: cs, da, de, el, en, es, et, fa, fi, fr, hu, is, it, ja, kk, ko, nl, no, pl, pt, ru, sk, sv, tr, uk, zh
§Supported providers
There are currently 18 providers available: Address, Choice, Code, Cryptographic, Date, Development, File, Finance, Food, Hardware, Internet, Numeric, Path, Payment, Person, Science, Text, Transport
§Examples
Visit /examples for detailed examples. In the process of development it was decided to make the workflow as close to mimesis as possible, most of the methods and namespace were taken from there.
use warlocks_cauldron::*;
fn main() {
// A common option for most providers
let complex = ComplexProvider::new(&Locale::EN);
println!("Person: {}", complex.person.full_name(None, false));
println!("Telephone: {}", complex.person.telephone(None));
println!("Address: {}", complex.address.full_address());
println!("Birthday: {}", Datetime::date(1940, 2000));
println!("Weight: {} kg", Person::weight(30, 90));
println!("Height: {} m", Person::height(1.5, 2.0));
// But you can also use single providers
let russian_person = Person(&Locale::RU);
println!("Their Russian friend: {}", russian_person.full_name(Some(Gender::MALE), false));
}§License
This project is licensed under the GPL-3.0 license
Macros§
Structs§
- Address
- Struct for generate fake address data.
- Algorithm
- Provides algorithms which available
- Audio
File - Provides the audio file types
- Brazil
Spec Provider - Methods collection provides special data for Brazil (pt-br)
- Card
Type - Provides credit card types
- Choice
- Methods collection for generating a random choice from items in a sequence
- Code
- Methods collection which provides methods for generating codes
- Complex
Provider - Collection of every provider, which uses locales
- Compressed
File - Provides the compressed file types
- Country
Code - Provides types of country codes
- Credit
Card - Cryptographic
- Methods collection that provides cryptographic data
- DSNType
- Provides URI and port of DSN
- Date
Time - ISO 8601 combined date and time with time zone.
- Datetime
- Struct for generating data related to the date and time
- Denmark
Spec Provider - Methods collection provides special data for Denmark (da)
- Development
- Methods collection for getting fake data for Developers
- Document
File - Provides the document file types
- EANFormat
- Provides formats of EAN
- File
- Methods collection for generate data related to files
- File
Type - Provides file types
- Finance
- A struct for generating finance data
- Food
- Struct for generating data related to food
- Gender
- Represents genders
- Hardware
- Methods collection for generate data related to hardware
- ISBN
Format - Provides formats of ISBN
- Image
File - Provides the image file types
- Internet
- Methods collection for generating data related to the internet
- Italy
Spec Provider - Methods collection provides special data for Italy (it)
- Local
- The local timescale.
- Measure
Unit - Provide unit names
- Metric
Prefix Sign - Provides prefix signs
- Mime
Type - Provides common mime types
- Naive
Date - ISO 8601 calendar date without timezone. Allows for every proleptic Gregorian date from Jan 1, 262145 BCE to Dec 31, 262143 CE. Also supports the conversion from ISO 8601 ordinal and week date.
- Netherlands
Spec Provider - Methods collection provides special data for Netherlands (nl)
- NumType
- Provides the number types
- Numeric
- Methods collection for generate any numeric values
- Path
- Methods collection that provides methods and property for generate paths
- Payment
- Methods collection for generating data related to payments
- Person
- Struct for generating personal data
- Poland
Spec Provider - Methods collection provides special data for Poland (pl)
- Port
Range - Represents port ranges
- Random
Pool - Russia
Spec Provider - Methods collection provides special data for Russia (ru)
- Science
- Methods collection for generating pseudo-scientific data
- TLDType
- Provides top level domain types
- Text
- A struct for generating text data
- Timezone
Region - Provides regions of timezones
- Title
Type - Represents title types
- Tracking
Service - Transport
- Methods collection for generating data related to transports
- URLScheme
- Provides URL schemes
- USASpec
Provider - Methods collection provides special data for USA (en)
- Ukraine
Spec Provider - Methods collection provides special data for Ukraine (uk)
- Utc
- The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).
- Video
File - Provides the vide file types
Enums§
- Coordinates
- Float
Number - Locale
- This enum provides access to the supported locales from one place
- Platform
Type - Enum for init path-gen struct
- SexType
- Stock
Type - Timestamp
Type
Traits§
- Datelike
- The common set of methods for date component.
- Valued
Enum