RandomNameGeneratorLibrary 2.0.0
See the version list below for details.
dotnet add package RandomNameGeneratorLibrary --version 2.0.0
NuGet\Install-Package RandomNameGeneratorLibrary -Version 2.0.0
<PackageReference Include="RandomNameGeneratorLibrary" Version="2.0.0" />
<PackageVersion Include="RandomNameGeneratorLibrary" Version="2.0.0" />
<PackageReference Include="RandomNameGeneratorLibrary" />
paket add RandomNameGeneratorLibrary --version 2.0.0
#r "nuget: RandomNameGeneratorLibrary, 2.0.0"
#:package RandomNameGeneratorLibrary@2.0.0
#addin nuget:?package=RandomNameGeneratorLibrary&version=2.0.0
#tool nuget:?package=RandomNameGeneratorLibrary&version=2.0.0
DotNetRandomNameGenerator
Generates random people and place names drawn from freely available US census data.
dotnet add package RandomNameGeneratorLibrary
Targets netstandard2.0 (any .NET Framework 4.6.2+, .NET Core, Mono, Unity) and net10.0. Version 2.0.0 is the same API as 1.2.2, rebuilt with the current SDK, SourceLink and this README in the package; the net40 and netstandard1.6 targets are gone. Try it live at https://www.markdavidrogers.com/tools (random names) or through the site's MCP server tool random_name.
The library contains a stripped down lists of human names from the US Census names list, and a list of place names from another census list. The library allows you to get random first and last names or both and you can get male and female first names. You can also generate random place names as well. To access this functionality create a NameGenerator in namespace RandomNameGenerator, and call one of the functions like GenerateRandomFirstAndLastName(). The functions names describe literally and simply what those functions do.
Typical Usage (generating a person name):
var personGenerator = new PersonNameGenerator();
var name = _personGenerator.GenerateRandomFirstAndLastName();
Console.WriteLine(name); //Outputs some random first and last name combination in the format "{first} {last}" example: "Mark Rogers"
Generating a place name:
var placeGenerator = new PlaceNameGenerator();
var name = _personGenerator.GenerateRandomPlaceName();
Console.WriteLine(name); //Outputs some random place name, example: "Hoboken"
Male and female first names can be generated with or without a last name
var personGenerator = new PersonNameGenerator();
var name = _personGenerator.GenerateRandomFemaleFirstName();
Console.WriteLine(name); //Outputs some random first female name, example: "Jane"
More than one name can be generated at a time. There are a variety of functions that let you choose gender if desired, and the number of names to be produced.
var personGenerator = new PersonNameGenerator();
var numberOfNames = 1;
var names = _personGenerator.GenerateRandomFemaleFirstAndLastName(numberOfNames);
var name = names.First();
Console.WriteLine(name); //Outputs some random first and last female name combination in the format "{first} {last}" example: "Rose Jones"
An existing random object can be passed in, rather than generated by the name generator.
var randomObj = new Random(42);
var personGenerator = new PersonNameGenerator(randomObj);
var name = personGenerator.GenerateRandomFemaleFirstName();
Console.WriteLine(name); //Outputs some random first female name using the passed Random obj, example: "Lindsay"
This functionality can also be exercised has an extension method to a random object.
var randomObj = new Random(42);
var name = randomObj.GenerateRandomFemaleFirstName();
Console.WriteLine(name); //Outputs some random first female name using the passed Random obj, example: "Lindsay"
Building and releasing
dotnet test
dotnet pack RandomNameGeneratorLibrary -c Release -o artifacts
CI (.github/workflows/ci.yml) builds, tests and packs on every push. To publish: bump <Version> in RandomNameGeneratorLibrary.csproj, tag the commit v<version> and push the tag; the publish job signs in to nuget.org with Trusted Publishing (GitHub OIDC, no stored API key; a NUGET_USER secret holding the nuget.org profile name lives in the nuget environment) and pushes the package.
The census lists are embedded resources (Resources.*.stripped); CensusListStripper and FileCompressor are the tools that produced them and are kept public for compatibility.
License
MIT, see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 is compatible. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on RandomNameGeneratorLibrary:
| Package | Downloads |
|---|---|
|
shubcasinocommon
ShubCasino Common |
|
|
Lombiq.Hosting.Tenants.Maintenance
Lombiq Hosting - Tenants Maintenance for Orchard Core: With the help of this module you can execute maintenance tasks on tenants. See the project website for detailed documentation. |
|
|
IntechCommon
Intech Common Lib |
|
|
SchoolTest
Package Description |
|
|
DAP.Utils
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on RandomNameGeneratorLibrary:
| Repository | Stars |
|---|---|
|
microsoft/WhatTheHack
A collection of challenge based hack-a-thons including student guide, coach guide, lecture presentations, sample/instructional code and templates. Please visit the What The Hack website at: https://aka.ms/wth
|
|
|
JonPSmith/EfCore.TestSupport
Tools for helping in unit testing applications that use Entity Framework Core
|
2.0.0: rebuilt for netstandard2.0 and net10.0 (net40 and netstandard1.6 dropped), SourceLink and deterministic build, README in the package. No API changes.