def get_book(book_name_or_ix=None, fullname_or_name=None, pid=None): book = get_book_object(fullname_or_name, book_name_or_ix, pid) return jsonify(serialize_book(book))
def get_books(pid=None): books = xw.apps[int(pid)].books if pid else xw.books return jsonify(books=[serialize_book(book) for book in books])