Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cieslarmichal/faker-cxx
C++ Faker library for generating fake (but realistic) data.
https://github.com/cieslarmichal/faker-cxx
cpp cpp20 data-generation development-tools fake fake-data faker faker-cpp faker-generator faker-library test-data-generator
Last synced: about 2 months ago
JSON representation
C++ Faker library for generating fake (but realistic) data.
- Host: GitHub
- URL: https://github.com/cieslarmichal/faker-cxx
- Owner: cieslarmichal
- License: mit
- Created: 2023-06-24T19:56:47.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-09T12:20:14.000Z (2 months ago)
- Last Synced: 2024-04-10T00:53:25.122Z (2 months ago)
- Topics: cpp, cpp20, data-generation, development-tools, fake, fake-data, faker, faker-cpp, faker-generator, faker-library, test-data-generator
- Language: C++
- Homepage: https://cieslarmichal.github.io/faker-cxx/
- Size: 5.53 MB
- Stars: 190
- Watchers: 7
- Forks: 80
- Open Issues: 46
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Lists
- awesome-cpp - faker-cxx - C++20 Faker library for generating fake (but realistic) data for testing and development. [MIT] (Miscellaneous)
- AwesomeCppGameDev - faker-cxx - C++20 Faker library for generating fake (but realistic) data for testing and development. (C++)
- awesome-game-engine-dev - faker-cxx - C++20 Faker library for generating fake (but realistic) data for testing and development. (Libraries / C++)
- fucking-awesome-cpp - faker-cxx - C++20 Faker library for generating fake (but realistic) data for testing and development. [MIT] (Miscellaneous)
- awesome-stars - faker-cxx
- awesome-cpp - faker-cxx - C++20 Faker library for generating fake (but realistic) data for testing and development. [MIT] (Miscellaneous)
README
![]()
Faker C++
Generate fake (but realistic) data for testing and development.
[![clang++](https://github.com/cieslarmichal/faker-cxx/actions/workflows/linux-clang-build.yml/badge.svg?branch=main)](https://github.com/cieslarmichal/faker-cxx/actions/workflows/linux-clang-build.yml?query=branch%3Amain)
[![apple clang++](https://github.com/cieslarmichal/faker-cxx/actions/workflows/macos-clang-build.yml/badge.svg?branch=main)](https://github.com/cieslarmichal/faker-cxx/actions/workflows/macos-clang-build.yml?query=branch%3Amain)
[![g++](https://github.com/cieslarmichal/faker-cxx/actions/workflows/linux-gxx-build.yml/badge.svg?branch=main)](https://github.com/cieslarmichal/faker-cxx/actions/workflows/linux-gxx-build.yml?query=branch%3Amain)
[![msvc](https://github.com/cieslarmichal/faker-cxx/actions/workflows/windows-msvc-build.yml/badge.svg?branch=main)](https://github.com/cieslarmichal/faker-cxx/actions/workflows/windows-msvc-build.yml?query=branch%3Amain)
[![codecov](https://codecov.io/github/cieslarmichal/faker-cxx/branch/main/graph/badge.svg?token=0RTV4JFH2U)](https://codecov.io/github/cieslarmichal/faker-cxx)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Chat on Discord](https://img.shields.io/badge/chat-discord-blue?style=flat&logo=discord)](https://discord.gg/h2ur8H6mK6)## ๐ฏ Goal
Goal of the Faker C++ is to provide a library like [Faker.js](https://github.com/faker-js/faker) for C++ community.
## Usage
```cpp
#include#include "faker-cxx/Date.h"
#include "faker-cxx/Internet.h"
#include "faker-cxx/Location.h"
#include "faker-cxx/String.h"int main()
{
const auto id = faker::String::uuid();
const auto email = faker::Internet::email();
const auto password = faker::Internet::password();
const auto verificationCode = faker::String::numeric(8);
const auto createdAt = faker::Date::pastDate();
const auto city = faker::Location::city();
const auto streetAddress = faker::Location::streetAddress();std::cout << id << std::endl; // 58018063-ce5a-4fa7-adfd-327eb2e2d9a5
std::cout << email << std::endl; // [email protected]
std::cout << password << std::endl; // @cWLwgM#Knalxeb
std::cout << verificationCode << std::endl; // 31457428
std::cout << createdAt << std::endl; // 2023-06-20T02:06:36Z
std::cout << city << std::endl; // Sayreville
std::cout << streetAddress << std::endl; // 1716 Harriet Alleyreturn 0;
}
```## ๐ Modules
- ๐ฉ Airline - aircraft types, airlines, airports, flight numbers
- ๐ผ Animal - animal types and species
- ๐ Book - book title, genre, author, publisher, ISBN
- ๐จ Color - color names, rgb, hex, hcl
- ๐ Commerce - commerce department, product name, sku, price
- ๐ข Company - company name, type, industry, catch phrase, buzz phrase
- ๐ฅ๏ธ Computer - type, manufacturer, model, CPU info, GPU info
- ๐พ Database - column names, column types, database engines
- โน๏ธ Datatype - booleans
- ๐ Date - past, future dates
- ๐ฆ Finance - currency, IBAN, BIC, account name, account number, pin, credit card numbers
- ๐ Food - food category, vegetables, fruits, meats, dishes
- ๐ Git - branch names, commit messages, commit hash
- ๐จโ๐ป Hacker - hacker words
- โ Helper - random element from container
- ๐ Internet - emails, usernames, passwords, IP, HTTP
- ๐ผ๏ธ Image - images urls, github avatar urls, image dimensions
- ๐ Location - countries, cities, zip codes, street addresses
- ๐ Lorem - lorem words, sentences, paragraphs
- ๐ฅ Medicine - conditions, medical tests, specialties
- ๐ฅ Movie - actors, actresses, genres, movie titles
- ๐ถ Music - artists, song names, genres
- ๐ข Number - random integers, floating point numbers
- ๐ง Person - first, last names, job titles, hobby, genders, sex, nationalitiy, language
- ๐ Phone - phone number, IMEI
- โฝ Sport - sport names, athletes, events
- ๐ข String - uuids, alphanumeric, numeric, hexadecimal
- ๐ป System - file paths, file extensions, file names, directories, semantic version
- ๐ฎ Video game - title, genre, platform, studio
- ๐ค๏ธ Weather - temperature, pressure, humidity, weather description
- ๐ฌ Word - sample words, nouns, verbs## ๐ Documentation
https://cieslarmichal.github.io/faker-cxx/
## Consuming library with CMake (CMake 3.22 or newer)
1. Add faker to git submodules (execute in project root):
```
mkdir externals && cd externals
git submodule add https://github.com/cieslarmichal/faker-cxx.git
git submodule update --init --recursive
```2. Link with library:
```cmake
set(BUILD_FAKER_TESTS OFF)
add_subdirectory(externals/faker-cxx)
add_executable(main Main.cpp)
target_link_libraries(main faker-cxx)
```## Compiler support
- [MSVCโ](https://en.wikipedia.org/wiki/Microsoft_Visual_Studio) version 143 or newer.
- [GCCโ](https://gcc.gnu.org/) version 13 or newer.
- [Clangโ](https://clang.llvm.org/) version 16 or newer.
- [Apple Clangโ](https://clang.llvm.org/) version 16 or newer.## Dependencies
- GTest (```BUILD_FAKER_TESTS=OFF``` CMake flag to disable)
- fmt (only for Apple Clang++ compiler)## โจ Contributing
Feel free to join Faker C++ development! ๐
Please check [CONTRIBUTING](https://github.com/cieslarmichal/faker-cxx/blob/main/CONTRIBUTING.md) guide.
[Discord Channel](https://discord.gg/h2ur8H6mK6) for contributors.
## ๐ Compilation guides
- [Clang++](./docs/guides/clang-compilation-guide.md)
- [Apple Clang++](./docs/guides/apple-clang-compilation-guide.md)
- [G++](./docs/guides/gcc-compilation-guide.md)
- [MSVC](./docs/guides/msvc-compilation-guide.md)