Skip to content

Commit c32d9c2

Browse files
committed
Fix import sorting with isort
- Fix import order in pygetpapers.py - Fix import order in hocr_builder.py - Fix import order in repository_config.py - Fix import order in rxiv.py - Fix import order in debug_api.py All files now pass isort checks.
1 parent 300d4e4 commit c32d9c2

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

pygetpapers/core/hocr_builder.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
PURPOSE: Create unified hOCR output format for PDF and image processing
1111
"""
1212

13-
import logging
1413
import html
14+
import logging
1515
import re
16-
from pathlib import Path
17-
from typing import Dict, List, Optional, Tuple, Any, Union
1816
from dataclasses import dataclass, field
1917
from datetime import datetime
18+
from pathlib import Path
19+
from typing import Any, Dict, List, Optional, Tuple, Union
20+
2021
import lxml.etree as ET
2122

2223
logger = logging.getLogger(__name__)

pygetpapers/core/repository_config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from typing import Any, Dict, List, Optional
1111

1212
import yaml
13-
1413
from src.pygetpapers.abstract_repository import AbstractRepository
1514

1615
logger = logging.getLogger(__name__)

pygetpapers/pygetpapers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,13 @@ def _create_datatables(self, query_namespace):
563563
"""Create datatables HTML files for the corpus."""
564564
try:
565565
import os
566+
566567
from pygetpapers.tools.datatables_integration import PygetpapersDatatables
567568

568569
# Debug logging (can be removed in production)
569570
# logging.info(f"Query namespace output: {query_namespace.get('output')}")
570571
# logging.info(f"Query namespace datatables: {query_namespace.get('datatables')}")
571572
# logging.info(f"Self default path: {self.default_path}")
572-
573573
# Initialize datatables
574574
dt = PygetpapersDatatables()
575575

@@ -1057,10 +1057,10 @@ def run_pygetpapers(command_string):
10571057
>>> result = run_pygetpapers(cmd)
10581058
>>> print(result)
10591059
"""
1060+
import contextlib
10601061
import shlex
10611062
import sys
10621063
from io import StringIO
1063-
import contextlib
10641064

10651065
# Parse the command string
10661066
if command_string.startswith("pygetpapers"):

pygetpapers/repositories/biorxiv/rxiv.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
from pygetpapers.core.download_tools import DownloadTools
1010
from pygetpapers.core.pgexceptions import PygetpapersError
1111
from pygetpapers.core.repositoryinterface import (
12+
BIORXIV,
1213
COLLECTION,
1314
DOI,
1415
RXIV_RESULT,
1516
RepositoryInterface,
16-
BIORXIV,
1717
)
1818

1919
TOTAL_HITS = "total_hits"
@@ -319,12 +319,14 @@ def noexecute(self, query_namespace):
319319
if self._is_text_query(query):
320320
logging.info(f"Using {source} web scraper for text query (noexecute mode)")
321321
try:
322+
from urllib.parse import quote_plus
323+
324+
import requests
325+
from bs4 import BeautifulSoup
326+
322327
from pygetpapers.repositories.biorxiv.biorxiv_advanced_scraper import (
323328
BioRxivAdvancedScraper,
324329
)
325-
import requests
326-
from bs4 import BeautifulSoup
327-
from urllib.parse import quote_plus
328330

329331
# Use the correct base URL based on the source
330332
if source == "medrxiv":

pygetpapers/repositories/upspace/debug_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"""
55

66
import json
7-
import requests
87
from pathlib import Path
98

9+
import requests
10+
1011
from pygetpapers.repositories.upspace.upspace import UPSpace
1112

1213

0 commit comments

Comments
 (0)