Support no venue or suffix symbols (normally crypto$)

fqsns
Tyler Goodlet 2022-03-19 13:47:25 -04:00
parent 7f36e85815
commit 76f398bd9f
1 changed files with 13 additions and 1 deletions

View File

@ -97,9 +97,21 @@ def uncons_fqsn(fqsn: str) -> tuple[str, str, str]:
Unpack a fully-qualified-symbol-name to ``tuple``. Unpack a fully-qualified-symbol-name to ``tuple``.
''' '''
venue = ''
suffix = ''
# TODO: probably reverse the order of all this XD # TODO: probably reverse the order of all this XD
tokens = fqsn.split('.') tokens = fqsn.split('.')
if len(tokens) > 3: if len(tokens) < 3:
# probably crypto
symbol, broker = tokens
return (
broker,
symbol,
'',
)
elif len(tokens) > 3:
symbol, venue, suffix, broker = tokens symbol, venue, suffix, broker = tokens
else: else:
symbol, venue, broker = tokens symbol, venue, broker = tokens