lixplore-cli 1.0.0__py3-none-any.whl
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.
- lixplore/__init__.py +0 -0
- lixplore/__main__.py +10 -0
- lixplore/cli.py +57 -0
- lixplore/commands.py +1543 -0
- lixplore/dispatcher.py +814 -0
- lixplore/search.py +33 -0
- lixplore/sources/__init__.py +0 -0
- lixplore/sources/arxiv.py +108 -0
- lixplore/sources/crossref.py +102 -0
- lixplore/sources/doaj.py +108 -0
- lixplore/sources/europepmc.py +96 -0
- lixplore/sources/pubmed.py +131 -0
- lixplore/templates/__init__.py +1 -0
- lixplore/templates/ieee.json +15 -0
- lixplore/templates/nature.json +15 -0
- lixplore/templates/science.json +15 -0
- lixplore/utils/annotations.py +486 -0
- lixplore/utils/cache.py +20 -0
- lixplore/utils/citations.py +269 -0
- lixplore/utils/custom_apis.py +291 -0
- lixplore/utils/enhanced_tui.py +849 -0
- lixplore/utils/enrichment.py +338 -0
- lixplore/utils/export.py +833 -0
- lixplore/utils/interactive_tui.py +425 -0
- lixplore/utils/pdf_downloader.py +495 -0
- lixplore/utils/profiles.py +213 -0
- lixplore/utils/reference_managers.py +302 -0
- lixplore/utils/shell_mode.py +563 -0
- lixplore/utils/statistics.py +355 -0
- lixplore/utils/template_engine.py +187 -0
- lixplore/utils/terminal.py +246 -0
- lixplore/utils/wizard_mode.py +334 -0
- lixplore_cli-1.0.0.dist-info/METADATA +619 -0
- lixplore_cli-1.0.0.dist-info/RECORD +38 -0
- lixplore_cli-1.0.0.dist-info/WHEEL +5 -0
- lixplore_cli-1.0.0.dist-info/entry_points.txt +2 -0
- lixplore_cli-1.0.0.dist-info/licenses/LICENSE +21 -0
- lixplore_cli-1.0.0.dist-info/top_level.txt +1 -0
lixplore/__init__.py
ADDED
|
File without changes
|
lixplore/__main__.py
ADDED
lixplore/cli.py
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import sys
|
|
5
|
+
from . import commands
|
|
6
|
+
from lixplore.utils.cache import cleanup_cache # import correctly
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _configure_stdio():
|
|
10
|
+
"""Ensure stdout/stderr won't crash on Windows consoles.
|
|
11
|
+
|
|
12
|
+
Prefer UTF-8, but at minimum avoid UnicodeEncodeError by replacing
|
|
13
|
+
unencodable characters. This helps when running under cp1252 on
|
|
14
|
+
GitHub Actions Windows runners.
|
|
15
|
+
"""
|
|
16
|
+
try:
|
|
17
|
+
if hasattr(sys.stdout, "reconfigure"):
|
|
18
|
+
try:
|
|
19
|
+
# Try UTF-8 first
|
|
20
|
+
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
21
|
+
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
|
|
22
|
+
except Exception:
|
|
23
|
+
# Fallback to current encoding with replacement
|
|
24
|
+
sys.stdout.reconfigure(errors="replace")
|
|
25
|
+
sys.stderr.reconfigure(errors="replace")
|
|
26
|
+
else:
|
|
27
|
+
import io
|
|
28
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
|
|
29
|
+
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8", errors="replace")
|
|
30
|
+
except Exception:
|
|
31
|
+
# Last resort: ignore failures, but keep running
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def main():
|
|
36
|
+
# Ensure safe I/O early
|
|
37
|
+
_configure_stdio()
|
|
38
|
+
|
|
39
|
+
# run cleanup first
|
|
40
|
+
cleanup_cache(days=7)
|
|
41
|
+
|
|
42
|
+
parser = argparse.ArgumentParser(
|
|
43
|
+
description="Lixplore Literature CLI Tool",
|
|
44
|
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
|
45
|
+
)
|
|
46
|
+
commands.add_commands(parser)
|
|
47
|
+
args = parser.parse_args()
|
|
48
|
+
|
|
49
|
+
if hasattr(args, "func"):
|
|
50
|
+
args.func(args)
|
|
51
|
+
else:
|
|
52
|
+
parser.print_help()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
main()
|
|
57
|
+
|