From 1ad2d31f1539899f5876ca23d2a5b7de4dafdd86 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Sun, 28 Jan 2024 22:33:30 +0100 Subject: [PATCH] Standardized project structure --- .gitignore | 4 ++++ __main__.py => personal_data/__main__.py | 8 ++++---- data.py => personal_data/data.py | 0 crunchyroll.py => personal_data/fetchers/crunchyroll.py | 3 ++- playstation.py => personal_data/fetchers/playstation.py | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .gitignore rename __main__.py => personal_data/__main__.py (90%) rename data.py => personal_data/data.py (100%) rename crunchyroll.py => personal_data/fetchers/crunchyroll.py (98%) rename playstation.py => personal_data/fetchers/playstation.py (98%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f183a0a --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pyc +__pycache__/ +/secrets.py +*.sqlite diff --git a/__main__.py b/personal_data/__main__.py similarity index 90% rename from __main__.py rename to personal_data/__main__.py index 0874e04..f76de5a 100644 --- a/__main__.py +++ b/personal_data/__main__.py @@ -10,13 +10,13 @@ import logging logger = logging.getLogger(__name__) -import playstation -import crunchyroll +import personal_data.fetchers.playstation +import personal_data.fetchers.crunchyroll def determine_scrapers(): scrapers = [] - #scrapers += playstation.SCRAPERS - scrapers += crunchyroll.SCRAPERS + #scrapers += personal_data.fetchers.playstation.SCRAPERS + scrapers += personal_data.fetchers.crunchyroll.SCRAPERS return scrapers def extend_csv_file(filename, new_dicts , deduplicate = False): diff --git a/data.py b/personal_data/data.py similarity index 100% rename from data.py rename to personal_data/data.py diff --git a/crunchyroll.py b/personal_data/fetchers/crunchyroll.py similarity index 98% rename from crunchyroll.py rename to personal_data/fetchers/crunchyroll.py index 5c2d301..b69185a 100644 --- a/crunchyroll.py +++ b/personal_data/fetchers/crunchyroll.py @@ -1,8 +1,9 @@ -from data import Scraper import secrets import functools import logging +from personal_data.data import Scraper + logger = logging.getLogger(__name__) API_ROOT = 'https://www.crunchyroll.com' diff --git a/playstation.py b/personal_data/fetchers/playstation.py similarity index 98% rename from playstation.py rename to personal_data/fetchers/playstation.py index 3cb157f..6187a42 100644 --- a/playstation.py +++ b/personal_data/fetchers/playstation.py @@ -1,8 +1,8 @@ - -from data import Scraper import secrets import logging +from personal_data.data import Scraper + logger = logging.getLogger(__name__) URL_RECENTLY_PLAYED_HTML = 'https://library.playstation.com/recently-played'