finance¶
- validators.finance.cusip(value: str)¶
Return whether or not given value is a valid CUSIP.
Checks if the value is a valid [CUSIP][1]. [1]: https://en.wikipedia.org/wiki/CUSIP
Examples
>>> cusip('037833DP2') True >>> cusip('037833DP3') ValidationError(func=cusip, args={'value': '037833DP3'})
- Parameters:
value – CUSIP string to validate.
- Returns:
If value is a valid CUSIP string. (ValidationError): If value is an invalid CUSIP string.
- Return type:
(Literal[True])
- validators.finance.isin(value: str)¶
Return whether or not given value is a valid ISIN.
Checks if the value is a valid [ISIN][1]. [1]: https://en.wikipedia.org/wiki/International_Securities_Identification_Number
Examples
>>> isin('037833DP2') ValidationError(func=isin, args={'value': '037833DP2'}) >>> isin('037833DP3') ValidationError(func=isin, args={'value': '037833DP3'})
- Parameters:
value – ISIN string to validate.
- Returns:
If value is a valid ISIN string. (ValidationError): If value is an invalid ISIN string.
- Return type:
(Literal[True])
- validators.finance.sedol(value: str)¶
Return whether or not given value is a valid SEDOL.
Checks if the value is a valid [SEDOL][1]. [1]: https://en.wikipedia.org/wiki/SEDOL
Examples
>>> sedol('2936921') True >>> sedol('29A6922') ValidationError(func=sedol, args={'value': '29A6922'})
- Parameters:
value – SEDOL string to validate.
- Returns:
If value is a valid SEDOL string. (ValidationError): If value is an invalid SEDOL string.
- Return type:
(Literal[True])