Include documentation on website and utils.

This commit is contained in:
Vishnu KS
2020-10-12 12:53:50 +05:30
parent 44c779acb5
commit c527547008
8 changed files with 2102 additions and 2582 deletions

View File

@@ -36,7 +36,7 @@ def clean_category(category_raw):
if __name__ == "__main__":
library = load("../README.md", "new")
existing_book_names_to_details = json.load(open("books.json"))
existing_book_names_to_details = json.load(open("book_name_to_details.json"))
for category in library:
category_name = clean_category(category)
@@ -56,7 +56,7 @@ if __name__ == "__main__":
if fetched:
print(f"{title}")
existing_book_names_to_details[title] = new_book
with open("books.json", "w") as f:
with open("book_name_to_details.json", "w") as f:
json.dump(
existing_book_names_to_details,
f,
@@ -68,7 +68,7 @@ if __name__ == "__main__":
book_list = []
for _, book in existing_book_names_to_details.items():
book_list.append(book)
with open("books_list.json", "w") as f:
with open("books.json", "w") as f:
json.dump(book_list, f, sort_keys=True, indent=4, separators=(",", ": "))
else:
print(f"❌ Error while fetching {title}")