scitex 2.15.2__py3-none-any.whl → 2.15.4__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.
Files changed (77) hide show
  1. scitex/_mcp_resources/__init__.py +2 -0
  2. scitex/_mcp_resources/_scholar.py +148 -0
  3. scitex/_mcp_tools/scholar.py +50 -99
  4. scitex/_mcp_tools/social.py +15 -232
  5. scitex/_mcp_tools/writer.py +7 -17
  6. scitex/canvas/mcp_server.py +16 -3
  7. scitex/capture/mcp_server.py +16 -2
  8. scitex/cli/audio.py +90 -20
  9. scitex/cli/capture.py +120 -0
  10. scitex/cli/introspect.py +19 -12
  11. scitex/cli/plt.py +78 -21
  12. scitex/cli/scholar/__init__.py +160 -2
  13. scitex/cli/scholar/_crossref_scitex.py +25 -266
  14. scitex/cli/scholar/_openalex_scitex.py +55 -0
  15. scitex/cli/social.py +63 -22
  16. scitex/cli/stats.py +121 -3
  17. scitex/cli/writer.py +49 -423
  18. scitex/dev/plt/data/mpl/PLOTTING_FUNCTIONS.yaml +90 -0
  19. scitex/dev/plt/data/mpl/PLOTTING_SIGNATURES.yaml +1571 -0
  20. scitex/dev/plt/data/mpl/PLOTTING_SIGNATURES_DETAILED.yaml +6262 -0
  21. scitex/dev/plt/data/mpl/SIGNATURES_FLATTENED.yaml +1274 -0
  22. scitex/dev/plt/data/mpl/dir_ax.txt +459 -0
  23. scitex/introspect/_list_api.py +5 -2
  24. scitex/plt/docs/EXTERNAL_PACKAGE_BRANDING.md +2 -2
  25. scitex/scholar/__init__.py +14 -9
  26. scitex/scholar/_mcp/crossref_tool_schemas.py +133 -0
  27. scitex/scholar/_mcp/openalex_handlers.py +212 -0
  28. scitex/scholar/_mcp/openalex_tool_schemas.py +96 -0
  29. scitex/scholar/_mcp/tool_schemas.py +16 -1
  30. scitex/scholar/data/.gitkeep +0 -0
  31. scitex/scholar/data/README.md +44 -0
  32. scitex/scholar/data/bib_files/bibliography.bib +1952 -0
  33. scitex/scholar/data/bib_files/neurovista.bib +277 -0
  34. scitex/scholar/data/bib_files/neurovista_enriched.bib +441 -0
  35. scitex/scholar/data/bib_files/neurovista_enriched_enriched.bib +441 -0
  36. scitex/scholar/data/bib_files/neurovista_processed.bib +338 -0
  37. scitex/scholar/data/bib_files/openaccess.bib +89 -0
  38. scitex/scholar/data/bib_files/pac-seizure_prediction_enriched.bib +2178 -0
  39. scitex/scholar/data/bib_files/pac.bib +698 -0
  40. scitex/scholar/data/bib_files/pac_enriched.bib +1061 -0
  41. scitex/scholar/data/bib_files/pac_processed.bib +0 -0
  42. scitex/scholar/data/bib_files/pac_titles.txt +75 -0
  43. scitex/scholar/data/bib_files/paywalled.bib +98 -0
  44. scitex/scholar/data/bib_files/related-papers-by-coauthors.bib +58 -0
  45. scitex/scholar/data/bib_files/related-papers-by-coauthors_enriched.bib +87 -0
  46. scitex/scholar/data/bib_files/seizure_prediction.bib +694 -0
  47. scitex/scholar/data/bib_files/seizure_prediction_processed.bib +0 -0
  48. scitex/scholar/data/bib_files/test_complete_enriched.bib +437 -0
  49. scitex/scholar/data/bib_files/test_final_enriched.bib +437 -0
  50. scitex/scholar/data/bib_files/test_seizure.bib +46 -0
  51. scitex/scholar/data/impact_factor/JCR_IF_2022.xlsx +0 -0
  52. scitex/scholar/data/impact_factor/JCR_IF_2024.db +0 -0
  53. scitex/scholar/data/impact_factor/JCR_IF_2024.xlsx +0 -0
  54. scitex/scholar/data/impact_factor/JCR_IF_2024_v01.db +0 -0
  55. scitex/scholar/data/impact_factor.db +0 -0
  56. scitex/scholar/docs/EXTERNAL_PACKAGE_BRANDING.md +2 -2
  57. scitex/scholar/local_dbs/__init__.py +31 -0
  58. scitex/scholar/local_dbs/crossref_scitex.py +30 -0
  59. scitex/scholar/local_dbs/openalex_scitex.py +30 -0
  60. scitex/scholar/mcp_server.py +59 -4
  61. scitex/social/docs/EXTERNAL_PACKAGE_BRANDING.md +2 -2
  62. scitex/stats/mcp_server.py +16 -3
  63. scitex/template/mcp_server.py +16 -3
  64. scitex/ui/mcp_server.py +16 -3
  65. scitex/writer/__init__.py +43 -34
  66. {scitex-2.15.2.dist-info → scitex-2.15.4.dist-info}/METADATA +22 -3
  67. {scitex-2.15.2.dist-info → scitex-2.15.4.dist-info}/RECORD +70 -38
  68. scitex/scholar/crossref_scitex.py +0 -367
  69. scitex/scholar/url_finder/.tmp/open_url/KNOWN_RESOLVERS.py +0 -462
  70. scitex/scholar/url_finder/.tmp/open_url/README.md +0 -223
  71. scitex/scholar/url_finder/.tmp/open_url/_DOIToURLResolver.py +0 -694
  72. scitex/scholar/url_finder/.tmp/open_url/_OpenURLResolver.py +0 -1160
  73. scitex/scholar/url_finder/.tmp/open_url/_ResolverLinkFinder.py +0 -344
  74. scitex/scholar/url_finder/.tmp/open_url/__init__.py +0 -24
  75. {scitex-2.15.2.dist-info → scitex-2.15.4.dist-info}/WHEEL +0 -0
  76. {scitex-2.15.2.dist-info → scitex-2.15.4.dist-info}/entry_points.txt +0 -0
  77. {scitex-2.15.2.dist-info → scitex-2.15.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env python3
2
+ # Timestamp: 2026-01-29
3
+ # File: src/scitex/scholar/local_dbs/openalex_scitex.py
4
+ """OpenAlex-SciTeX: Minimal API for openalex-local.
5
+
6
+ Usage:
7
+ >>> from scitex.scholar.local_dbs import openalex_scitex
8
+ >>> results = openalex_scitex.search("machine learning")
9
+ >>> work = openalex_scitex.get("10.1038/nature12373")
10
+ """
11
+
12
+ try:
13
+ from openalex_local import (
14
+ SearchResult,
15
+ # Classes
16
+ Work,
17
+ count,
18
+ get,
19
+ info,
20
+ # Core functions
21
+ search,
22
+ )
23
+ except ImportError as e:
24
+ raise ImportError(
25
+ "openalex-local not installed. Install with: pip install openalex-local"
26
+ ) from e
27
+
28
+ __all__ = ["search", "get", "count", "info", "Work", "SearchResult"]
29
+
30
+ # EOF
@@ -3,8 +3,17 @@
3
3
  # File: src/scitex/scholar/mcp_server.py
4
4
  # ----------------------------------------
5
5
 
6
- """
7
- MCP Server for SciTeX Scholar - Scientific Literature Management
6
+ """MCP Server for SciTeX Scholar - Scientific Literature Management.
7
+
8
+ .. deprecated::
9
+ This standalone server is deprecated. Use the unified scitex MCP server instead:
10
+
11
+ CLI: scitex serve
12
+ Python: from scitex.mcp_server import run_server
13
+
14
+ The unified server includes all scholar tools plus other scitex tools.
15
+ Scholar tools are prefixed with 'scholar_' (e.g., scholar_search_papers).
16
+ Scholar resources are available at scholar://library and scholar://bibtex.
8
17
 
9
18
  Provides tools for:
10
19
  - Searching papers across multiple databases
@@ -16,6 +25,15 @@ Provides tools for:
16
25
 
17
26
  from __future__ import annotations
18
27
 
28
+ import warnings
29
+
30
+ warnings.warn(
31
+ "scitex.scholar.mcp_server is deprecated. Use 'scitex serve' or "
32
+ "'from scitex.mcp_server import run_server' for the unified MCP server.",
33
+ DeprecationWarning,
34
+ stacklevel=2,
35
+ )
36
+
19
37
  import asyncio
20
38
  import os
21
39
  from datetime import datetime
@@ -67,11 +85,18 @@ class ScholarServer:
67
85
 
68
86
  self._scholar_instance = Scholar()
69
87
  except ImportError as e:
70
- raise RuntimeError(f"Scholar module not available: {e}")
88
+ raise RuntimeError(f"Scholar module not available: {e}") from e
71
89
  return self._scholar_instance
72
90
 
73
91
  def setup_handlers(self):
74
92
  """Set up MCP server handlers."""
93
+ from ._mcp.crossref_handlers import (
94
+ crossref_citations_handler,
95
+ crossref_count_handler,
96
+ crossref_get_handler,
97
+ crossref_info_handler,
98
+ crossref_search_handler,
99
+ )
75
100
  from ._mcp.handlers import (
76
101
  add_papers_to_project_handler,
77
102
  authenticate_handler,
@@ -186,6 +211,36 @@ class ScholarServer:
186
211
  elif name == "get_job_result":
187
212
  return await self._wrap_result(get_job_result_handler(**arguments))
188
213
 
214
+ # CrossRef-Local Tools
215
+ elif name == "crossref_search":
216
+ return await self._wrap_result(crossref_search_handler(**arguments))
217
+ elif name == "crossref_get":
218
+ return await self._wrap_result(crossref_get_handler(**arguments))
219
+ elif name == "crossref_count":
220
+ return await self._wrap_result(crossref_count_handler(**arguments))
221
+ elif name == "crossref_citations":
222
+ return await self._wrap_result(crossref_citations_handler(**arguments))
223
+ elif name == "crossref_info":
224
+ return await self._wrap_result(crossref_info_handler(**arguments))
225
+
226
+ # OpenAlex-Local Tools
227
+ elif name == "openalex_search":
228
+ from ._mcp.openalex_handlers import openalex_search_handler
229
+
230
+ return await self._wrap_result(openalex_search_handler(**arguments))
231
+ elif name == "openalex_get":
232
+ from ._mcp.openalex_handlers import openalex_get_handler
233
+
234
+ return await self._wrap_result(openalex_get_handler(**arguments))
235
+ elif name == "openalex_count":
236
+ from ._mcp.openalex_handlers import openalex_count_handler
237
+
238
+ return await self._wrap_result(openalex_count_handler(**arguments))
239
+ elif name == "openalex_info":
240
+ from ._mcp.openalex_handlers import openalex_info_handler
241
+
242
+ return await self._wrap_result(openalex_info_handler(**arguments))
243
+
189
244
  else:
190
245
  raise ValueError(f"Unknown tool: {name}")
191
246
 
@@ -340,7 +395,7 @@ async def _run_server():
340
395
 
341
396
 
342
397
  def main():
343
- """Main entry point for the MCP server."""
398
+ """Run the MCP server."""
344
399
  if not MCP_AVAILABLE:
345
400
  import sys
346
401
 
@@ -115,7 +115,7 @@ from figrecipe import *
115
115
 
116
116
  ## Port Scheme
117
117
 
118
- SciTeX uses port scheme 3129X (sa-i-te-ku-su → 3-1-2-9 in Japanese):
118
+ SciTeX uses port scheme 3129X (TEX → te-ku-su → 2-9-3 in Japanese):
119
119
 
120
120
  | Port | Service |
121
121
  |-------|------------------|
@@ -130,7 +130,7 @@ External packages should use `{ENV_PREFIX}_{SETTING}`:
130
130
 
131
131
  ```
132
132
  SCITEX_PLT_MODE=local
133
- CROSSREF_LOCAL_API_URL=http://localhost:31291
133
+ CROSSREF_LOCAL_API_URL=http://localhost:8333
134
134
  SCITEX_AUDIO_RELAY_URL=http://localhost:31293
135
135
  ```
136
136
 
@@ -3,8 +3,12 @@
3
3
  # File: src/scitex/stats/mcp_server.py
4
4
  # ----------------------------------------
5
5
 
6
- """
7
- MCP Server for SciTeX Stats - Statistical Testing Framework
6
+ """MCP Server for SciTeX Stats - Statistical Testing Framework.
7
+
8
+ .. deprecated::
9
+ This standalone server is deprecated. Use the unified scitex MCP server:
10
+ CLI: scitex serve
11
+ Python: from scitex.mcp_server import run_server
8
12
 
9
13
  Provides tools for:
10
14
  - Recommending appropriate statistical tests
@@ -20,6 +24,15 @@ Provides tools for:
20
24
 
21
25
  from __future__ import annotations
22
26
 
27
+ import warnings
28
+
29
+ warnings.warn(
30
+ "scitex.stats.mcp_server is deprecated. Use 'scitex serve' or "
31
+ "'from scitex.mcp_server import run_server' for the unified MCP server.",
32
+ DeprecationWarning,
33
+ stacklevel=2,
34
+ )
35
+
23
36
  import asyncio
24
37
 
25
38
  # Graceful MCP dependency handling
@@ -380,7 +393,7 @@ async def _run_server():
380
393
 
381
394
 
382
395
  def main():
383
- """Main entry point for the MCP server."""
396
+ """Run the MCP server."""
384
397
  if not MCP_AVAILABLE:
385
398
  import sys
386
399
 
@@ -3,8 +3,12 @@
3
3
  # File: src/scitex/template/mcp_server.py
4
4
  # ----------------------------------------
5
5
 
6
- """
7
- MCP Server for SciTeX Template - Project Scaffolding Framework
6
+ """MCP Server for SciTeX Template - Project Scaffolding Framework.
7
+
8
+ .. deprecated::
9
+ This standalone server is deprecated. Use the unified scitex MCP server:
10
+ CLI: scitex serve
11
+ Python: from scitex.mcp_server import run_server
8
12
 
9
13
  Provides tools for:
10
14
  - Listing available project templates
@@ -15,6 +19,15 @@ Provides tools for:
15
19
 
16
20
  from __future__ import annotations
17
21
 
22
+ import warnings
23
+
24
+ warnings.warn(
25
+ "scitex.template.mcp_server is deprecated. Use 'scitex serve' or "
26
+ "'from scitex.mcp_server import run_server' for the unified MCP server.",
27
+ DeprecationWarning,
28
+ stacklevel=2,
29
+ )
30
+
18
31
  import asyncio
19
32
 
20
33
  # Graceful MCP dependency handling
@@ -161,7 +174,7 @@ async def _run_server():
161
174
 
162
175
 
163
176
  def main():
164
- """Main entry point for the MCP server."""
177
+ """Run the MCP server."""
165
178
  if not MCP_AVAILABLE:
166
179
  import sys
167
180
 
scitex/ui/mcp_server.py CHANGED
@@ -2,14 +2,27 @@
2
2
  # Timestamp: "2026-01-13 (ywatanabe)"
3
3
  # File: /home/ywatanabe/proj/scitex-code/src/scitex/ui/mcp_server.py
4
4
 
5
- """
6
- MCP Server for SciTeX Notifications - Multi-backend alert system.
5
+ """MCP Server for SciTeX Notifications - Multi-backend alert system.
6
+
7
+ .. deprecated::
8
+ This standalone server is deprecated. Use the unified scitex MCP server:
9
+ CLI: scitex serve
10
+ Python: from scitex.mcp_server import run_server
7
11
 
8
12
  Supports: audio, desktop, email, matplotlib, playwright, webhook backends.
9
13
  """
10
14
 
11
15
  from __future__ import annotations
12
16
 
17
+ import warnings
18
+
19
+ warnings.warn(
20
+ "scitex.ui.mcp_server is deprecated. Use 'scitex serve' or "
21
+ "'from scitex.mcp_server import run_server' for the unified MCP server.",
22
+ DeprecationWarning,
23
+ stacklevel=2,
24
+ )
25
+
13
26
  import asyncio
14
27
  from datetime import datetime
15
28
 
@@ -126,7 +139,7 @@ async def _run_server():
126
139
 
127
140
 
128
141
  def main():
129
- """Main entry point for the MCP server."""
142
+ """Run the MCP server."""
130
143
  if not MCP_AVAILABLE:
131
144
  import sys
132
145
 
scitex/writer/__init__.py CHANGED
@@ -1,46 +1,55 @@
1
1
  #!/usr/bin/env python3
2
- # File: /home/ywatanabe/proj/scitex-code/src/scitex/writer/__init__.py
3
-
4
2
  """
5
- SciTeX Writer - LaTeX Compilation System
6
-
7
- Python wrapper around scitex-writer shell scripts for LaTeX compilation.
3
+ SciTeX Writer - Thin wrapper delegating to scitex-writer package.
8
4
 
9
- Examples:
10
- >>> from scitex.writer import Writer, compile
5
+ Single source of truth: scitex-writer package
6
+ This module re-exports scitex-writer as-is, without modifications.
11
7
 
12
- # Using Writer class
13
- >>> writer = Writer(project_dir=Path("."))
14
- >>> result = writer.compile_manuscript()
15
-
16
- # Using unified compile function
17
- >>> result = compile("manuscript", project_dir=Path("."))
18
- >>> results = compile("manuscript", "supplementary", project_dir=Path("."))
19
- >>> results = await compile("all", project_dir=Path("."), async_=True)
8
+ Install: pip install scitex-writer
20
9
  """
21
10
 
22
- from . import utils
23
- from ._compile import compile
24
- from .Writer import Writer
11
+ import os as _os
12
+
13
+ # Set branding environment variables BEFORE importing scitex-writer
14
+ _os.environ.setdefault("SCITEX_WRITER_BRAND", "scitex.writer")
15
+ _os.environ.setdefault("SCITEX_WRITER_ALIAS", "sw")
16
+
17
+ # Re-export from scitex-writer package (single source of truth)
18
+ try:
19
+ from scitex_writer import __version__ as writer_version
20
+ from scitex_writer import (
21
+ bib,
22
+ compile,
23
+ figures,
24
+ guidelines,
25
+ project,
26
+ prompts,
27
+ tables,
28
+ )
29
+
30
+ HAS_WRITER_PKG = True
31
+
32
+ except ImportError:
33
+ HAS_WRITER_PKG = False
34
+ writer_version = None
35
+ bib = None
36
+ compile = None
37
+ figures = None
38
+ guidelines = None
39
+ project = None
40
+ prompts = None
41
+ tables = None
25
42
 
26
43
  __all__ = [
27
- "Writer",
44
+ "HAS_WRITER_PKG",
45
+ "writer_version",
46
+ "bib",
28
47
  "compile",
29
- "utils",
48
+ "figures",
49
+ "guidelines",
50
+ "project",
51
+ "prompts",
52
+ "tables",
30
53
  ]
31
54
 
32
-
33
- # Clean up namespace - hide internal submodules
34
- def _cleanup():
35
- import sys
36
-
37
- _this = sys.modules[__name__]
38
- for _attr in list(vars(_this).keys()):
39
- if _attr in ("_dataclasses",):
40
- delattr(_this, _attr)
41
-
42
-
43
- _cleanup()
44
- del _cleanup
45
-
46
55
  # EOF
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scitex
3
- Version: 2.15.2
3
+ Version: 2.15.4
4
4
  Summary: A comprehensive Python library for scientific computing and data analysis
5
5
  Project-URL: Homepage, https://github.com/ywatanabe1989/scitex-python
6
6
  Project-URL: Documentation, https://scitex.readthedocs.io
@@ -462,6 +462,7 @@ Requires-Dist: csv2latex; extra == 'writer'
462
462
  Requires-Dist: gitpython; extra == 'writer'
463
463
  Requires-Dist: matplotlib; extra == 'writer'
464
464
  Requires-Dist: pytest-asyncio; extra == 'writer'
465
+ Requires-Dist: scitex-writer; extra == 'writer'
465
466
  Requires-Dist: xlsx2csv; extra == 'writer'
466
467
  Requires-Dist: yq; extra == 'writer'
467
468
  Description-Content-Type: text/markdown
@@ -520,7 +521,7 @@ uv pip install scitex # Core only
520
521
  |-----------|-----|-------------|
521
522
  | 🐍 **Python API** | Human researchers | `import scitex as stx` — 70% less code |
522
523
  | 🖥️ **CLI Commands** | Terminal users | `scitex scholar fetch`, `scitex stats run` |
523
- | 🔧 **MCP Tools** | AI agents | 108 tools for Claude/GPT integration |
524
+ | 🔧 **MCP Tools** | AI agents | 145 tools for Claude/GPT integration |
524
525
 
525
526
  <details>
526
527
  <summary><strong>🐍 Python API</strong></summary>
@@ -588,7 +589,7 @@ scitex capture snap # Screenshot
588
589
  </details>
589
590
 
590
591
  <details>
591
- <summary><strong>🔧 MCP Tools — 108 tools for AI Agents</strong></summary>
592
+ <summary><strong>🔧 MCP Tools — 145 tools for AI Agents</strong></summary>
592
593
 
593
594
  <br>
594
595
 
@@ -628,6 +629,24 @@ Turn AI agents into autonomous scientific researchers.
628
629
 
629
630
  </details>
630
631
 
632
+ ## 🧩 Standalone Packages
633
+
634
+ SciTeX integrates several standalone packages that can be used independently:
635
+
636
+ | Package | scitex Module | Description |
637
+ |---------|--------------|-------------|
638
+ | [figrecipe](https://github.com/ywatanabe1989/figrecipe) | `scitex.plt` | Publication-ready matplotlib figures |
639
+ | [crossref-local](https://github.com/ywatanabe1989/crossref-local) | `scitex.scholar.crossref_scitex` | Local CrossRef database (167M+ papers) |
640
+ | [socialia](https://github.com/ywatanabe1989/socialia) | `scitex.social` | Social media posting (Twitter, LinkedIn) |
641
+ | [scitex-writer](https://github.com/ywatanabe1989/scitex-writer) | `scitex.writer` | LaTeX manuscript compilation |
642
+
643
+ Each package works standalone or as part of scitex:
644
+
645
+ ```bash
646
+ pip install figrecipe # Use independently
647
+ pip install scitex[plt] # Or via scitex
648
+ ```
649
+
631
650
  ## 📖 Documentation
632
651
 
633
652
  - **[Read the Docs](https://scitex.readthedocs.io/)**: Complete API reference