Skip to content

rubenafo/faker_marketdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

faker_marketdata

Generates random, valid market identifiers following most common formats in the industry.

Installation

pip install faker_marketdata

Usage

Add as a provider to your Faker instance:

>>> from faker import Faker
>>> from faker_marketdata import MarketDataProvider
>>> fake = Faker()
>>> fake.add_provider(MarketDataProvider)

Optionally you can define a seed value to have repeatable identifiers:

>> Faker.seed(123)
>> fake.add_provider(MarketDataProvider)

Now you can start to generate market identifiers, some examples:

>> fake.isin()   # "GTYMQXUIYPB6"
>> fake.sedol()  # "NKDEKC8"
>> fake.cusip()  # "Z57XGDJW7"
>> fake.ticker() # "GRTT"

Documentation

Supported market data formats:

  • ISIN
  • SEDOL
  • MIC
  • LEI
  • CUSIP
  • RIC
  • TICKER
  • NSIN
  • FIGI
  • Market type (e.g. "bond", "commodity", "otc")