refactor: better typing

dataclass replacing dict
This commit is contained in:
eneller
2025-03-03 23:09:19 +01:00
parent 7be0fbc126
commit 9ae25e40ad
2 changed files with 16 additions and 10 deletions

View File

@@ -6,15 +6,14 @@ from bs4 import ResultSet
import os
from urllib.parse import urljoin
from convert import GBConvert, allbooks_url, get_all_books
from convert import GBConvert, allbooks_url, get_all_books, Book
def main():
books = get_all_books()
# NOTE consider making this a map()
for book in tqdm(books):
book_url = book['url']
if book_url is not None:
GBConvert(book_url).run()
if book.url is not None:
GBConvert(book.url).run()
if __name__ == "__main__":