• Stars
    star
    283
  • Rank 146,066 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C++ Faker library for generating fake (but realistic) data.
C++ Faker, a powerful tool for generating realistic and randomized fake data in C++ programming, enhancing data testing and development workflows

Faker C++

Generate fake (but realistic) data for testing and development

clang++ apple clang++ g++ msvc codecov PRs Welcome Chat on Discord

๐ŸŽฏ Goal

The goal of Faker C++ is to provide a library similar to Faker.js for C++ community. Faker C++ helps with the creation of realistic and customizable fake data for testing and development purposes within C++ applications.

Usage and Documentation

To properly use Faker C++ you must first consume the Faker library (see Consuming Library with CMake). Once that is done, you need to include the proper header files depending on the module you wish to generate data from. The module header file names can be found in docs.

Below is an example of how to use Faker C++ in your code.

#include <iostream>

#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 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 << city << std::endl;             // Sayreville
    std::cout << streetAddress << std::endl;    // 1716 Harriet Alley

    return 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

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:

    set(BUILD_FAKER_TESTS OFF)
    
    add_subdirectory(externals/faker-cxx)
    
    add_executable(main Main.cpp)
    
    target_link_libraries(main faker-cxx)

Compiler support

Use one of these compilers when working with Faker C++.

If you have any confusion please refer to the respective guides.

Dependencies

  • GTest (set BUILD_CONFIG_CXX_TESTS=OFF CMake flag to disable this dependency)
  • fmt (only for Apple Clang++ compiler)

โœจ Contributing

We would love it if you contributed to Faker C++! ๐Ÿš€

Before contributing please review our CONTRIBUTING guide.

Additionally, we encourage you to join our Discord Channel for contributors.

More Repositories

1

config-cxx

C++ Config library for managing application configuration.
C++
18
star
2

glossary

Desktop Qt application for learning english words.
C++
6
star
3

chimarrao-platformer

A single-player plaftormer game using SFML as a graphics library.
C++
5
star
4

ticketing-app

Ticket purchasing application based on microservices and event-driven architecture.
TypeScript
4
star
5

bucketeer

A platform for seamless file exploration and transfer to and from AWS S3. Focuses on serving images and videos.
TypeScript
4
star
6

rpg

A role-playing game inspired by Tibia and made using SFML as a graphics library. Finding the shortest path is done using the A* algorithm.
C++
3
star
7

bookstore

E-commerce backend designed for a book store inspired by Amazon.
TypeScript
3
star
8

smart-rename

A simple utility for bulk renaming using search and replace.
TypeScript
3
star
9

cieslarmichal

Profile repository.
3
star
10

character-prediction

Application for character prediction using machine learning. The application is implemented using LSTM neural networks.
Jupyter Notebook
3
star
11

transcoder

Video transcoder system
TypeScript
3
star
12

berthier

App for budgeting and controlling money transactions directly from bank account.
C++
2
star
13

simple-shooter

Simple shooter game with Unreal Engine 4
C++
2
star
14

e-commerce-app

E-commerce application based on event-driven architecture. The application is built based on AWS Lambda functions that communicate using AWS EventBridge and AWS SQS and saves data into AWS DynamoDB.
TypeScript
2
star
15

bookcoin

A proof of work cryptocurrency implementation.
TypeScript
2
star
16

url-shortener

URL shortener built with Node.js, Fastify, MongoDB, Kafka and ELK Stack.
TypeScript
2
star
17

algoexpert-cpp

C++ solutions to the coding interview problems on AlgoExpert.
C++
2
star
18

weather-app

Weather desktop application that checks current weather conditions based on geolocation.
C#
2
star
19

neighbourly

A platform for connecting with your neighbours.
TypeScript
2
star
20

ncloc

Node.js command line tool for counting lines of code.
TypeScript
2
star
21

knowlegde-based-ai-mini-projects

Mini projects for Knowledge-Based AI class at Georgia Tech
Python
1
star
22

ravens-progressive-matrices-solver

AI Agent for solving Raven's Progressive Matrices as a test of general intelligence
Python
1
star
23

calculator

Calculator App in C# using WPF
C#
1
star
24

calculator-app

Simple calculator in SFML
C++
1
star
25

contacts-app

App for storing contacts using C# with SQLite and WPF
C#
1
star
26

tanks

Tank game with Unreal Engine 4
C++
1
star
27

ocr

Basic OCR setup in C++ with Tesseract
C++
1
star
28

a-star

A* algorithm C++ implementation with SFML visualization.
C++
1
star
29

keylogger

Keylogger for Windows.
C++
1
star
30

simple-paint

Simple Paint application in C# using WPF
C#
1
star
31

multi-k8s

Learning kubernetes
JavaScript
1
star
32

task-mate

Task managment website in Python using Django
HTML
1
star
33

game-of-life

Implementation of Conway's Game of Life.
Python
1
star
34

multi-docker

Learning docker, docker-compose, aws
JavaScript
1
star
35

join-us

Simple nodejs app with connection to MySQL database developed with dockers
JavaScript
1
star
36

k8s-notes

Notes from learning to Certified Kubernetes Application Developer.
Dockerfile
1
star
37

pdf-to-speech

API for converting PDF documents to audio.
TypeScript
1
star
38

github-discord-bot

Discord bot for the community of project contributors. Responds to various events from discord server and github project.
TypeScript
1
star
39

tweet-fleet

Serverless app for aggregating tweets and sending them daily by email. Built with AWS Lambda, DynamoDB, ElastiCache and SQS.
TypeScript
1
star
40

video-resizer

Video processing service using serverless architecture with AWS Lambda, ECS, Fargate, SNS, SQS and S3.
TypeScript
1
star