# stdnum.cfi

CFI (ISO 10962 Classification of Financial Instruments).

The CFI is a 6-character code used to classify financial instruments. It is issued alongside an ISIN and describes category such as equity or future and category-specific properties such as underlying asset type or payment status.

More information:

- https://en.wikipedia.org/wiki/ISO_10962

- https://www.iso.org/standard/73564.html

- https://www.six-group.com/en/products-services/financial-information/data-standards.html

    >>> validate('ELNUFR')
    'ELNUFR'
    >>> validate('ELNUFQ')
    Traceback (most recent call last):
        ...
    InvalidComponent: ...
    >>> import json
    >>> print(json.dumps(info('ELNUFR'), indent=2, sort_keys=True))
    {
      "Form": "Registered",
      "Ownership/transfer/sales restrictions": "Free",
      "Payment status": "Fully paid",
      "Voting right": "Non-voting",
      "category": "Equities",
      "group": "Limited partnership units"
    }

stdnum.cfi.compact(number: str) → str

  Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.cfi.info(number: str) → dict[str, str]

  Look up information about the number.

stdnum.cfi.is_valid(number: str) → bool

  Check if the number provided is valid. This checks the length and check digit.

stdnum.cfi.validate(number: str) → str

  Check if the number provided is valid. This checks the length and format.