import bs4
soup = lambda cont: bs4.BeautifulSoup(cont, "html.parser")
+__all__ = ["anime", "getlist",
+ "error", "incompatible"]
+
base = "http://www.animenewsnetwork.com/encyclopedia/"
class error(Exception):
for el in soup:
ret += cstr(el)
return ret
+ elif isinstance(soup, str):
+ return soup
elif soup is None:
return None
else:
return ret
return int(ret)
+ @cproperty
+ def vintage(self):
+ return cstr(self._info("vintage")).strip()
+
+ @cproperty
+ def genres(self):
+ return [cstr(el) for x in (self._info("genres") or []) if isinstance(x, bs4.Tag) for el in x.findAll("a")]
+
+ @cproperty
+ def themes(self):
+ return [cstr(el) for x in (self._info("themes") or []) if isinstance(x, bs4.Tag) for el in x.findAll("a")]
+
def __repr__(self):
return "<ann.anime: %r (%i)>" % (self.name, self.id)