SecuritiesFakers 0.2.0
dotnet add package SecuritiesFakers --version 0.2.0
NuGet\Install-Package SecuritiesFakers -Version 0.2.0
<PackageReference Include="SecuritiesFakers" Version="0.2.0" />
<PackageVersion Include="SecuritiesFakers" Version="0.2.0" />
<PackageReference Include="SecuritiesFakers" />
paket add SecuritiesFakers --version 0.2.0
#r "nuget: SecuritiesFakers, 0.2.0"
#:package SecuritiesFakers@0.2.0
#addin nuget:?package=SecuritiesFakers&version=0.2.0
#tool nuget:?package=SecuritiesFakers&version=0.2.0
<h1 align="center">SecuritiesFakers</h1>
<p align="center"> <a href="https://github.com/thomas-fazzari/SecuritiesFakers/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/thomas-fazzari/SecuritiesFakers/ci.yml?branch=master&style=flat-square&labelColor=11111B&label=CI&logo=githubactions&logoColor=white" alt="CI"></a> <a href="https://codecov.io/gh/thomas-fazzari/SecuritiesFakers"><img src="https://img.shields.io/codecov/c/github/thomas-fazzari/SecuritiesFakers?style=flat-square&label=Coverage&labelColor=11111B&logo=codecov&logoColor=white" alt="Coverage"></a> <a href="https://www.nuget.org/packages/SecuritiesFakers"><img src="https://img.shields.io/nuget/v/SecuritiesFakers?style=flat-square&labelColor=11111B&label=Version&logo=nuget&logoColor=white&color=313244" alt="Package version"></a> <a href="#license"><img src="https://img.shields.io/badge/License-MIT%20%2B%20CC%20BY%204.0-313244?style=flat-square&labelColor=11111B&logo=opensourceinitiative&logoColor=white" alt="MIT and CC BY 4.0 License"></a> </p>
Generate realistic security identifiers with Bogus.
SecuritiesFakers ships an embedded dataset of exchange-listed instruments. It returns real ISINs, tickers, MICs, currencies, and issuer countries without performing any network calls at runtime.
Install
dotnet add package SecuritiesFakers
Use
using Bogus;
using SecuritiesFakers;
var faker = new Faker();
var isin = faker.Securities().Isin();
var ticker = faker.Securities().Ticker();
var instrument = faker.Securities().One();
var frenchIsin = faker.Securities().Isin(filter => filter.FromCountry("FR"));
var nasdaqTicker = faker.Securities().Nasdaq().Ticker();
var euroInstrument = faker.Securities().One(filter => filter.WithCurrency("EUR"));
Presets
Markets
Market presets restrict generation by listing exchange MIC. They can be combined with regular filters.
var usTicker = faker.Securities().UnitedStates().Ticker();
var londonInstrument = faker.Securities().London().One();
var nasdaqTickers = faker.Securities().Nasdaq().Tickers(10);
Market presets:
| Method | Markets | MICs |
|---|---|---|
UnitedStates() |
NYSE, Nasdaq | XNYS, XNAS |
Canada() |
Toronto | XTSE |
London() |
London | XLON |
Euronext() |
Amsterdam, Paris | XAMS, XPAR |
Frankfurt() |
Frankfurt | XFRA |
Switzerland() |
Swiss Exchange | XSWX |
HongKong() |
Hong Kong | XHKG |
Exchange presets use PascalCase MIC method names plus common aliases.
| MIC Method | Aliases | Market |
|---|---|---|
Xams() |
Amsterdam() |
Amsterdam |
Xasx() |
Asx() |
Australian Securities Exchange |
Xbom() |
Bse() |
Bombay Stock Exchange |
Xfra() |
Frankfurt() |
Frankfurt |
Xhkg() |
HongKong() |
Hong Kong |
Xjpx() |
Jpx() |
Japan Exchange Group |
Xkrx() |
Krx() |
Korea Exchange |
Xlon() |
London() |
London Stock Exchange |
Xmad() |
Madrid() |
Madrid |
Xmil() |
Milan() |
Milan |
Xnas() |
Nasdaq() |
Nasdaq |
Xnys() |
Nyse() |
New York Stock Exchange |
Xpar() |
Paris() |
Paris |
Xswx() |
SwissExchange() |
Swiss Exchange |
Xtse() |
Toronto() |
Toronto Stock Exchange |
Batch
Batch methods return unique values within one call.
var isins = faker.Securities().Isins(10);
var tickers = faker.Securities().Tickers(10);
var instruments = faker.Securities().Instruments(10);
Strict mode throws when the filtered pool is too small.
faker.Securities().Xkrx().Isins(100);
Best-effort mode returns as many values as possible.
var values = faker.Securities().Xkrx().Isins(100, mode: StrictMode.BestEffort);
Filters
Filters are case-insensitive.
Note: Exchange presets cover the embedded dataset, so
FromExchangeis rarely needed. It remains available for custom MICs.
var instruments = faker.Securities().Instruments(
25,
filter => filter
.FromCountry("US")
.FromExchange("XNAS")
.WithCurrency("USD")
);
Supported fields:
| Method | Meaning | Example |
|---|---|---|
FromCountry |
ISIN country prefix | US, FR, DE |
FromExchange |
ISO 10383 MIC | XNAS, XNYS, XPAR |
WithCurrency |
ISO 4217 currency | USD, EUR, GBP |
Targets
SecuritiesFakers targets net8.0 and net10.0.
License
Library code is licensed under MIT. The embedded dataset is derived from FinanceDatabase and is licensed under CC BY 4.0.
See THIRD-PARTY-NOTICES.md for source commit, attribution, and transformation details.
| Product | Versions 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 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.