Faker-Rust

Quick links
Table of Contents
Features
- ๐ High Performance: Built in Rust for blazing-fast data generation
- ๐ Locale-Aware: Multi-language support with fallback mechanism
- ๐ฒ Reproducible: Seedable RNG for deterministic data generation
- ๐ฆ Complete Parity: 100% API compatibility with Ruby Faker gem
- ๐งช Well Tested: 549+ unit tests ensuring reliability
- ๐ข 100+ Modules: Internet, Person, Location, Finance, and much more
Getting Started
Add this to your Cargo.toml:
[]
= "0.1.0"
Then run cargo build.
Usage
use name;
use internet;
use address;
use lorem;
use programming_language;
๐ฅ๏ธ Command Line Interface (CLI)
Faker-Rust now includes a powerful CLI tool for generating fake data directly from the command line:
Installation
Or run directly with:
# Run the CLI binary
# Run from installed binary
Quick CLI Examples
# Generate a random name
# Or using cargo run
# Generate an email
# Generate multiple values
# Generate deterministic output (repeatable)
# List all available generators
CLI Demo Example
Run the interactive CLI demo example:
CLI Commands
| Command | Description | Example |
|---|---|---|
name |
Generate names | faker-rust name --first |
email |
Generate emails | faker-rust email |
address |
Generate addresses | faker-rust address --full |
company |
Generate company names | faker-rust company |
phone |
Generate phone numbers | faker-rust phone --cell |
internet |
Generate internet data | faker-rust internet --username |
games |
Generate game data | faker-rust games --pokemon |
movies |
Generate movie data | faker-rust movies --star-wars |
tv |
Generate TV show data | faker-rust tv --simpsons |
For complete CLI documentation, see CLI.md.
Generators
To see the full list, check out the GENERATORS document.
Default Generators
| Category | Generators |
|---|---|
| Person | name, first_name, last_name, job, gender, blood |
| Internet | email, password, domain, url, ip, user_agent |
| Address | city, street_address, zip_code, state, country |
| Finance | bank, credit_card, crypto, currency, iban, bic |
| Company | company_name, bs, catch_phrase, industry |
| Date & Time | date, time, datetime, timezone |
| Number | digit, number, decimal, hexadecimal |
| String | alphanumeric, alpha, numeric, hex, uuid |
| Lorem | word, sentence, paragraph, question |
| Color | hex_color, rgb_color, safe_color |
| Code | isbn, ean, barcode, sku |
| Hacker | abbreviation, adjective, noun, verb, ingverb |
| App | name, version, author |
| Crypto | md5, sha1, sha256 |
| Device | model, platform, serial |
Entertainment Generators
| Category | Generators |
|---|---|
| Movies | star_wars, harry_potter, lord_of_the_rings, avatar, hackers, hitchhikers_guide_to_the_galaxy |
| TV Shows | game_of_thrones, breaking_bad, simpsons, rick_and_morty, aqua_teen_hunger_force, archer, how_i_met_your_mother, suits, supernatural, the_expanse, the_it_crowd, the_thick_of_it, and 30+ more |
| Gaming | pokemon, zelda, mario, minecraft, dnd, wow, lol, esport, dc_comics, superhero, cosmere |
| Books | book, culture_series, dune, lovecraft, kingkiller_chronicle |
| Music | rock_band, opera, grateful_dead, prince, pearl_jam, bossa_nova |
Specialty Generators
| Category | Generators |
|---|---|
| Anime | naruto, dragon_ball, one_piece, sword_art_online, studio_ghibli |
| Sports | football, basketball, baseball, volleyball, world_cup |
| Blockchain | bitcoin, ethereum, tezos |
| Travel | airport, train_station |
| Fantasy | tolkien_race, creature, location, weapon, spell |
| Locations | community, neighborhood, building_type, place |
| Quotes | famous_last_words, motivational, philosophical, shakespeare, movie |
| Religion | name, figure, text, practice, holiday |
Regional & Tech Generators
| Category | Generators |
|---|---|
| Regional | chile_rut, driving_licence, id_number, south_africa, national_health_service |
| Tech | drone, electrical_components, html, programming_language, internet_http |
| Security | vulnerability_identifier, omniauth |
| Misc | slack_emoji, lorem_flickr, placeholdit, x (Twitter), source |
Notes
- While Faker generates data at random, returned values are not guaranteed to be unique by default.
- Values can be deterministic if you use the seeded RNG feature.
- This is the
mainbranch and may contain unreleased changes. See CHANGELOG for all versions.
Deterministic Random
Faker supports seeding of its pseudo-random number generator to provide deterministic output:
use Faker;
use name;
Localization
Faker supports locale-aware data generation:
// Set locale for data generation
set_locale;
// The library will use locale-specific data where available,
// falling back to English defaults for missing translations
Contributing
Contributions are welcome! Feel free to open issues and pull requests.
Inspiration
Faker-Rust is inspired by the legendary Ruby Faker gem and aims to bring the same ease of use and comprehensive coverage to the Rust ecosystem.
License
This code is free to use under the terms of the MIT license.
Links
https://github.com/faker-rust/faker-rust
https://github.com/faker-rust/faker-rust/issues
https://github.com/faker-rust/faker-rust/discussions
https://github.com/faker-rust/faker-rust/pulls
https://github.com/faker-rust/faker-rust/wiki
https://github.com/faker-rust/faker-rust/blob/main/SECURITY.md
https://github.com/faker-rust/faker-rust/blob/main/CONTRIBUTING.md
https://github.com/faker-rust/faker-rust/blob/main/CODE_OF_CONDUCT.md