Philiprehberger.DataFaker 0.3.0

dotnet add package Philiprehberger.DataFaker --version 0.3.0
                    
NuGet\Install-Package Philiprehberger.DataFaker -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Philiprehberger.DataFaker" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Philiprehberger.DataFaker" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Philiprehberger.DataFaker" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Philiprehberger.DataFaker --version 0.3.0
                    
#r "nuget: Philiprehberger.DataFaker, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Philiprehberger.DataFaker@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Philiprehberger.DataFaker&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Philiprehberger.DataFaker&version=0.3.0
                    
Install as a Cake Tool

Philiprehberger.DataFaker

CI NuGet Last updated

Lightweight test data generator with locale support, structured builders, and UUID generation.

Installation

dotnet add package Philiprehberger.DataFaker

Usage

using Philiprehberger.DataFaker;

var name = Faker.Name();        // "Mary Johnson"
var email = Faker.Email();      // "james.smith@example.com"
var phone = Faker.Phone();      // "(555) 867-5309"
var address = Faker.Address();  // "742 Oak Ave"

Internet Data

using Philiprehberger.DataFaker;

var url = FakerInternet.Url();           // "https://alpha-tech.io/data/flux"
var domain = FakerInternet.DomainName(); // "cyber-wave.dev"
var ip4 = FakerInternet.IPv4();          // "192.168.45.12"
var ip6 = FakerInternet.IPv6();          // "2a01:0db8:85a3:0000:0000:8a2e:0370:7334"
var mac = FakerInternet.MacAddress();    // "a4:5e:60:b3:21:ff"
var ua = FakerInternet.UserAgent();      // "Mozilla/5.0 (Windows NT 10.0; ...)"
var slug = FakerInternet.Slug();         // "meta-sync-nova"

Finance Data

using Philiprehberger.DataFaker;

var cc = FakerFinance.CreditCardNumber();  // "4532015112830366" (valid Luhn)
var iban = FakerFinance.Iban();            // "DE89370400440532013000"
var bic = FakerFinance.BicSwift();         // "DEUTDEFF"
var currency = FakerFinance.CurrencyCode(); // "EUR"
var amount = FakerFinance.Amount(10m, 500m); // 247.83m

Weighted Selection

using Philiprehberger.DataFaker;

var items = new List<(string item, double weight)>
{
    ("common", 10.0),
    ("uncommon", 3.0),
    ("rare", 0.5)
};

var picked = Faker.PickWeighted(items); // "common" (most likely)

Collection Helpers

using Philiprehberger.DataFaker;

var names = Faker.List(5, () => Faker.Name());
// ["Mary Johnson", "Robert Garcia", "Jennifer Wilson", ...]

var scores = Faker.List(3, 8, () => Faker.Between(1, 100));
// [42, 87, 15, 63, 91] (random count between 3 and 8)

Locale Support

using Philiprehberger.DataFaker;

var de = Faker.WithLocale("de-DE");
var name = de.Name();     // "Hans Mueller"
var city = de.City();     // "Berlin"
var phone = de.Phone();   // "+49 172 9384756"
var email = de.Email();   // "hans.mueller@example.com"

var fr = Faker.WithLocale("fr-FR");
var frName = fr.Name();   // "Jean Martin"

var es = Faker.WithLocale("es-ES");
var esCity = es.City();   // "Madrid"

UUID Generation

using Philiprehberger.DataFaker;

var uuid = Faker.Uuid();            // "a3b8f042-1c7e-4d9a-b5e6-8f2c3a7d1e09"
var seqId = Faker.UuidSequential();  // time-sortable UUID v7-style

Object Builder

using Philiprehberger.DataFaker;

public class User
{
    public string FirstName { get; set; } = "";
    public string Email { get; set; } = "";
    public int Age { get; set; }
    public bool IsActive { get; set; }
}

var user = FakerBuilder.Build<User>();
// user.FirstName = "Mary"
// user.Email = "james.smith@example.com"
// user.Age = 427
// user.IsActive = true

Seeded Reproducibility

using Philiprehberger.DataFaker;

var faker = Faker.WithSeed(42);

// Same seed always produces the same sequence
var name1 = faker.Name();   // deterministic
var name2 = faker.Name();   // deterministic
var email = faker.Email();  // deterministic

API

Faker (static)

Method Description
Name() Random full name (first + last)
FirstName() Random first name
LastName() Random last name
Email() Random email address
Phone() Random US phone number
Address() Random US street address
City() Random US city name
ZipCode() Random 5-digit US zip code
Company() Random company name
Lorem(wordCount) Random lorem ipsum words (default 5)
Sentence() Random lorem ipsum sentence
Paragraph() Random lorem ipsum paragraph
Between(min, max) Random int in range (inclusive)
Between(min, max) Random DateTime in range
Bool() Random boolean
Pick<T>(items) Random element from a list
PickWeighted<T>(items) Weighted random selection
List<T>(count, generator) Generate a list of fake items
List<T>(min, max, generator) Generate a list with random count
Uuid() Random UUID v4
UuidSequential() Time-sortable sequential UUID
WithLocale(locale) Create a locale-specific LocaleFaker
WithSeed(seed) Create a seeded FakerInstance

LocaleFaker

Method Description
Name() Locale-specific full name
FirstName() Locale-specific first name
LastName() Locale-specific last name
City() Locale-specific city name
Phone() Locale-specific formatted phone number
Email() Email using locale-specific names

FakerBuilder (static)

Method Description
Build<T>() Populate an object using convention-based rules

FakerInternet (static)

Method Description
Url() Random HTTP/HTTPS URL
DomainName() Random domain name
IPv4() Random valid IPv4 address
IPv6() Random IPv6 address
MacAddress() Random MAC address
UserAgent() Random realistic browser user agent
Slug() Random URL-friendly slug

FakerFinance (static)

Method Description
CreditCardNumber() Valid Luhn credit card (Visa/MC)
Iban(countryCode) Realistic IBAN (default "DE")
BicSwift() Random BIC/SWIFT code
CurrencyCode() Random ISO 4217 currency code
Amount(min, max, decimals) Random monetary amount

FakerInstance

Same methods as Faker (except WithSeed, WithLocale, PickWeighted, List), plus Uuid() and UuidSequential(), but instance-based with a seeded Random for deterministic output.

Development

dotnet build src/Philiprehberger.DataFaker.csproj --configuration Release

Support

If you find this project useful:

Star the repo

🐛 Report issues

💡 Suggest features

❤️ Sponsor development

🌐 All Open Source Projects

💻 GitHub Profile

🔗 LinkedIn Profile

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 122 4/1/2026
0.2.1 108 4/1/2026
0.2.0 118 3/28/2026
0.1.2 108 3/27/2026
0.1.1 112 3/23/2026
0.1.0 109 3/21/2026