def search(cls, text=None, title=None, author=None, year=None, page=0): client = mc.create_client() results = client.search(text, page=page+1) try: docs = results["documents"] return cls._parse(docs) except: return []
def details(cls, id, type=None): client = mc.create_client() results = client.details(id, type=type) try: article = cls._parse_article(results) article[type] = id return article except: return None