diff --git a/x_notes/__main__.py b/x_notes/__main__.py index f5b8e899..64cee18e 100644 --- a/x_notes/__main__.py +++ b/x_notes/__main__.py @@ -1,8 +1,8 @@ from loguru import logger + +from .helpers import load_notes, save_metadata, save_notes from .notes import get_notes from .statuses import add_statuses -from .helpers import load_notes, save_notes, save_metadata - if __name__ == "__main__": logger.info("Fetching notes ...") diff --git a/x_notes/fetch_tweets.py b/x_notes/fetch_tweets.py index ead8d193..ccb05c29 100644 --- a/x_notes/fetch_tweets.py +++ b/x_notes/fetch_tweets.py @@ -1,6 +1,6 @@ import asyncio -from .tweets import fetch_tweets +from .tweets import fetch_tweets if __name__ == "__main__": loop = asyncio.get_event_loop() diff --git a/x_notes/github.py b/x_notes/github.py index eb8a92a1..a79969bb 100644 --- a/x_notes/github.py +++ b/x_notes/github.py @@ -1,9 +1,9 @@ -from typing import Tuple from base64 import b64encode from os import environ -from nacl import encoding, public -import requests +from typing import Tuple +import requests +from nacl import encoding, public _base_url = f"https://api.github.com/repos/{environ['REPO']}/actions/secrets" _headers = { diff --git a/x_notes/helpers.py b/x_notes/helpers.py index 8bf4f885..6aa749fa 100644 --- a/x_notes/helpers.py +++ b/x_notes/helpers.py @@ -1,9 +1,10 @@ -from collections import defaultdict import csv +import json +from collections import defaultdict from datetime import date, datetime, timedelta, timezone from io import StringIO -import json from typing import Any, Generator + import requests diff --git a/x_notes/notes.py b/x_notes/notes.py index 5bbc17a2..29c3f78f 100644 --- a/x_notes/notes.py +++ b/x_notes/notes.py @@ -1,8 +1,8 @@ -from datetime import datetime, timedelta, timezone import re +from datetime import datetime, timedelta, timezone from typing import Any -from .helpers import to_isoformat, get_generator +from .helpers import get_generator, to_isoformat url_re = re.compile(r"(https?://[^\s]+)") one_week_ago = (datetime.now(timezone.utc) - timedelta(days=7)).timestamp() diff --git a/x_notes/statuses.py b/x_notes/statuses.py index 001e4863..92ddbbfc 100644 --- a/x_notes/statuses.py +++ b/x_notes/statuses.py @@ -1,6 +1,6 @@ from typing import Any -from .helpers import get_generator, to_isoformat +from .helpers import get_generator, to_isoformat helpful = "CURRENTLY_RATED_HELPFUL" unhelpful = "CURRENTLY_RATED_NOT_HELPFUL" diff --git a/x_notes/tweets.py b/x_notes/tweets.py index ec125d08..3d11ffb0 100644 --- a/x_notes/tweets.py +++ b/x_notes/tweets.py @@ -1,10 +1,12 @@ import json from os import environ from typing import Any + from loguru import logger from twscrape import API, NoAccountError + from .github import update_secret -from .helpers import load_notes, save_notes, get_tweets_with_multi_notes +from .helpers import get_tweets_with_multi_notes, load_notes, save_notes async def login() -> API: