def from_html_one(html_code, **kwargs):
 tables = from_html(html_code, **kwargs)
 try:
  assert (len(tables) == 1)
 except AssertionError:
  raise Exception('More than one <table> in provided HTML code!  Use from_html instead.')
 return tables[0]

def from_html_one ( html_code , ** kwargs ) : tables = from_html ( html_code , ** kwargs ) try : assert ( len ( tables ) == 1 ) except AssertionError : raise Exception ( 'More than one <table> in provided HTML code!  Use from_html instead.' ) return tables [ 0 ]
generates a prettytables from a string of html code which contains only a single <table> .