bookget 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bookget-0.3.0 → bookget-0.3.2}/PKG-INFO +1 -1
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/registry.py +22 -45
- {bookget-0.3.0 → bookget-0.3.2}/bookget.egg-info/PKG-INFO +1 -1
- {bookget-0.3.0 → bookget-0.3.2}/pyproject.toml +1 -1
- {bookget-0.3.0 → bookget-0.3.2}/README.md +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/__main__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/base.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/base_iiif.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/harvard.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/kyoto.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/ndl.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/princeton.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/iiif/stanford.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/archive_org.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/ctext.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/european.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/hanchi.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/nlc_guji.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/shidianguji.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/taiwan.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/wikimedia_commons.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/adapters/other/wikisource.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/config.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/core/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/core/resource_manager.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/downloaders/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/downloaders/base.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/downloaders/iiif.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/exceptions.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/logger.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/main.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/models/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/models/book.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/models/manifest.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/models/search.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/scripts/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/scripts/images_to_pdf.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/scripts/siku_catalog_parser.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/scripts/strip_tu_marker.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/server/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/server/app.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/server/routes.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/server/sse.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/server/static.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/server/tasks.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/storage/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/storage/file_storage.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_converters/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_converters/markdown_converter.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_converters/plaintext_converter.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_parsers/__init__.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_parsers/base.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_parsers/ctext_parser.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_parsers/hanchi_parser.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_parsers/shidianguji_parser.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/text_parsers/wikisource_parser.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget/utils.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget.egg-info/SOURCES.txt +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget.egg-info/dependency_links.txt +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget.egg-info/entry_points.txt +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget.egg-info/requires.txt +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/bookget.egg-info/top_level.txt +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/setup.cfg +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_adapters.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_config.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_downloaders.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_exceptions.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_file_storage.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_hanchi.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_manifest.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_models.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_resource_manager.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_text_parsers.py +0 -0
- {bookget-0.3.0 → bookget-0.3.2}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bookget
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Download and parse ancient Chinese book resources from digital libraries
|
|
5
5
|
Keywords: ancient-books,digital-library,downloader,classical-chinese
|
|
6
6
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -83,60 +83,37 @@ class AdapterRegistry:
|
|
|
83
83
|
cls._discover_adapters()
|
|
84
84
|
cls._initialized = True
|
|
85
85
|
|
|
86
|
-
#
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
'bookget.adapters.iiif.harvard',
|
|
90
|
-
'bookget.adapters.iiif.kyoto',
|
|
91
|
-
'bookget.adapters.iiif.ndl',
|
|
92
|
-
'bookget.adapters.iiif.princeton',
|
|
93
|
-
'bookget.adapters.iiif.stanford',
|
|
94
|
-
'bookget.adapters.other.archive_org',
|
|
95
|
-
'bookget.adapters.other.ctext',
|
|
96
|
-
'bookget.adapters.other.european',
|
|
97
|
-
'bookget.adapters.other.hanchi',
|
|
98
|
-
'bookget.adapters.other.nlc_guji',
|
|
99
|
-
'bookget.adapters.other.shidianguji',
|
|
100
|
-
'bookget.adapters.other.taiwan',
|
|
101
|
-
'bookget.adapters.other.wikisource',
|
|
102
|
-
'bookget.adapters.other.wikimedia_commons',
|
|
103
|
-
]
|
|
86
|
+
# Adapter sub-packages to scan. Add a new entry only when introducing
|
|
87
|
+
# a whole new category of adapters; individual modules are auto-discovered.
|
|
88
|
+
_ADAPTER_PACKAGES = ["bookget.adapters.iiif", "bookget.adapters.other"]
|
|
104
89
|
|
|
105
90
|
@classmethod
|
|
106
91
|
def _discover_adapters(cls):
|
|
107
92
|
"""
|
|
108
|
-
Auto-discover and import adapter
|
|
93
|
+
Auto-discover and import every adapter module under the configured
|
|
94
|
+
sub-packages.
|
|
109
95
|
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
Works in both normal and PyInstaller frozen environments because
|
|
97
|
+
``pkgutil.iter_modules`` honours each package's ``__path__``,
|
|
98
|
+
which PyInstaller's FrozenImporter populates correctly when the
|
|
99
|
+
modules are bundled (the spec uses ``collect_submodules`` to
|
|
100
|
+
ensure that).
|
|
112
101
|
"""
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
except Exception as e:
|
|
120
|
-
logger.warning(f"Failed to import {module_name}: {e}")
|
|
121
|
-
else:
|
|
122
|
-
# Normal: scan subdirectories
|
|
123
|
-
adapters_path = Path(__file__).parent
|
|
124
|
-
for subdir in ["iiif", "other"]:
|
|
125
|
-
subdir_path = adapters_path / subdir
|
|
126
|
-
if subdir_path.exists():
|
|
127
|
-
cls._import_from_directory(subdir_path, f"bookget.adapters.{subdir}")
|
|
102
|
+
for pkg_name in cls._ADAPTER_PACKAGES:
|
|
103
|
+
try:
|
|
104
|
+
pkg = importlib.import_module(pkg_name)
|
|
105
|
+
except Exception as e:
|
|
106
|
+
logger.warning(f"Failed to import package {pkg_name}: {e}")
|
|
107
|
+
continue
|
|
128
108
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
for item in directory.iterdir():
|
|
133
|
-
if item.suffix == ".py" and not item.name.startswith("_"):
|
|
134
|
-
module_name = f"{package_prefix}.{item.stem}"
|
|
109
|
+
for mod_info in pkgutil.iter_modules(pkg.__path__, prefix=pkg.__name__ + "."):
|
|
110
|
+
if mod_info.name.rsplit(".", 1)[-1].startswith("_"):
|
|
111
|
+
continue
|
|
135
112
|
try:
|
|
136
|
-
importlib.import_module(
|
|
137
|
-
logger.debug(f"Imported adapter module: {
|
|
113
|
+
importlib.import_module(mod_info.name)
|
|
114
|
+
logger.debug(f"Imported adapter module: {mod_info.name}")
|
|
138
115
|
except Exception as e:
|
|
139
|
-
logger.warning(f"Failed to import {
|
|
116
|
+
logger.warning(f"Failed to import {mod_info.name}: {e}")
|
|
140
117
|
|
|
141
118
|
|
|
142
119
|
def get_adapter(url: str, config=None) -> Optional[BaseSiteAdapter]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bookget
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Download and parse ancient Chinese book resources from digital libraries
|
|
5
5
|
Keywords: ancient-books,digital-library,downloader,classical-chinese
|
|
6
6
|
Classifier: Development Status :: 3 - Alpha
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|