Crate warlocks_cauldron

Crate warlocks_cauldron 

Source
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§

dict
generate_payload
list
py_enum
rust_enum
valued_enum

Structs§

Address
Struct for generate fake address data.
Algorithm
Provides algorithms which available
AudioFile
Provides the audio file types
BrazilSpecProvider
Methods collection provides special data for Brazil (pt-br)
CardType
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
ComplexProvider
Collection of every provider, which uses locales
CompressedFile
Provides the compressed file types
CountryCode
Provides types of country codes
CreditCard
Cryptographic
Methods collection that provides cryptographic data
DSNType
Provides URI and port of DSN
DateTime
ISO 8601 combined date and time with time zone.
Datetime
Struct for generating data related to the date and time
DenmarkSpecProvider
Methods collection provides special data for Denmark (da)
Development
Methods collection for getting fake data for Developers
DocumentFile
Provides the document file types
EANFormat
Provides formats of EAN
File
Methods collection for generate data related to files
FileType
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
ISBNFormat
Provides formats of ISBN
ImageFile
Provides the image file types
Internet
Methods collection for generating data related to the internet
ItalySpecProvider
Methods collection provides special data for Italy (it)
Local
The local timescale.
MeasureUnit
Provide unit names
MetricPrefixSign
Provides prefix signs
MimeType
Provides common mime types
NaiveDate
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.
NetherlandsSpecProvider
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
PolandSpecProvider
Methods collection provides special data for Poland (pl)
PortRange
Represents port ranges
RandomPool
RussiaSpecProvider
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
TimezoneRegion
Provides regions of timezones
TitleType
Represents title types
TrackingService
Transport
Methods collection for generating data related to transports
URLScheme
Provides URL schemes
USASpecProvider
Methods collection provides special data for USA (en)
UkraineSpecProvider
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).
VideoFile
Provides the vide file types

Enums§

Coordinates
FloatNumber
Locale
This enum provides access to the supported locales from one place
PlatformType
Enum for init path-gen struct
SexType
StockType
TimestampType

Traits§

Datelike
The common set of methods for date component.
ValuedEnum

Type Aliases§

Duration
Alias of TimeDelta.