Skip to content

Instantly share code, notes, and snippets.

@8vius
Last active December 20, 2015 16:09
Show Gist options
  • Save 8vius/6159684 to your computer and use it in GitHub Desktop.
Save 8vius/6159684 to your computer and use it in GitHub Desktop.
Code block to check for non-us currencies
non_us_currencies = re.compile(ur'''
^(HK|S\$|AED|CHF|NT\$|Rs|\xa3|x80|\xc5|\u20ac|\u00a3|\u0141|\u00a5) | # Prefix Currencies
\d(Fr|Kr)$ # Postfix Currencies
''', re.MULTILINE | re.VERBOSE)
if non_us_currencies.search(soup.getText('\n')):
raise ValueError('Non US currency')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment