warlocks_cauldron/lib.rs
1#![allow(non_camel_case_types)]
2#![allow(unused_imports)]
3#![allow(dead_code)]
4
5//! # 🧙♀️ Warlock's Cauldron
6//! 🦀 Fake Data Generator written in Rust - fully inspired by <https://mimesis.name> 🐍
7//!
8//! ## Installation
9//! All localizations are enabled by default feature, you can specify localizations in features!
10//! ```toml
11//! [dependencies.warlocks-cauldron]
12//! version = "0.26.9"
13//! # git = "https://github.com/hack-wrench/warlocks-cauldron"
14//! # features = ["en"] # For example to use only english localization
15//! ```
16//!
17//! ## Supported languages
18//! 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`
19//!
20//! ## Supported providers
21//! There are currently 18 providers available: `Address, Choice, Code, Cryptographic, Date, Development, File, Finance, Food, Hardware, Internet, Numeric, Path, Payment, Person, Science, Text, Transport`
22//!
23//! ## Examples
24//! Visit [`/examples`](https://github.com/hack-wrench/warlocks-cauldron/tree/main/examples) for detailed examples. In the process of development it was decided to make the workflow as close to [mimesis](https://mimesis.name) as possible, most of the methods and namespace were taken from there.
25//! ``` rust
26//! use warlocks_cauldron::*;
27//!
28//! fn main() {
29//! // A common option for most providers
30//! let complex = ComplexProvider::new(&Locale::EN);
31//! println!("Person: {}", complex.person.full_name(None, false));
32//! println!("Telephone: {}", complex.person.telephone(None));
33//! println!("Address: {}", complex.address.full_address());
34//! println!("Birthday: {}", Datetime::date(1940, 2000));
35//! println!("Weight: {} kg", Person::weight(30, 90));
36//! println!("Height: {} m", Person::height(1.5, 2.0));
37//!
38//! // But you can also use single providers
39//! let russian_person = Person(&Locale::RU);
40//! println!("Their Russian friend: {}", russian_person.full_name(Some(Gender::MALE), false));
41//! }
42//! ```
43//!
44//!
45//! ## License
46//! This project is licensed under the [GPL-3.0 license](https://github.com/hack-wrench/warlocks-cauldron/blob/main/LICENSE)
47
48#[macro_use] extern crate itertools;
49
50#[macro_use] extern crate lazy_static;
51
52pub(crate) mod data;
53pub(crate) mod random;
54
55mod providers;
56mod enums;
57
58mod pool;
59
60mod macros;
61
62#[cfg(test)]
63mod tests;
64
65pub use pool::RandomPool;
66
67pub use providers::*;
68pub use enums::*;