Skip to content

feat(scholar): Citation graph visualization + Flask GUI + API cleanup#163

Merged
ywatanabe1989 merged 11 commits intomainfrom
develop
Feb 18, 2026
Merged

feat(scholar): Citation graph visualization + Flask GUI + API cleanup#163
ywatanabe1989 merged 11 commits intomainfrom
develop

Conversation

@ywatanabe1989
Copy link
Owner

Summary

  • Citation graph visualization: Pluggable backend system (figrecipe > scitex.plt > matplotlib > pyvis) with _XXX_AVAILABLE flags for graceful degradation. Added to_networkx() to CitationGraph model.
  • Standalone Flask GUI: scitex scholar gui command launches interactive web app with Citation Graph tab (force-directed SVG). Ported from scitex-cloud's scholar_app. Library/Search/Enrichment tabs as placeholders.
  • API minimization: Public API reduced from 59 to 14 names. Power-user classes hidden via __getattr__ with backward compatibility.
  • ZoteroLocalReader: Added list_collections() and list_tags() methods.

Test plan

  • scitex scholar gui --help shows options
  • Flask smoke tests pass (all 5 endpoints: /, /api/health, /api/graph/*)
  • scitex scholar list-python-apis shows 14 clean public names
  • scitex scholar mcp list-tools -v shows 22 tools (consistent with main command)
  • Pre-commit hooks pass on all commits

🤖 Generated with Claude Code

ywatanabe1989 and others added 11 commits February 18, 2026 00:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use XARRAY_AVAILABLE flag pattern (consistent with TORCH_AVAILABLE,
CATBOOST_AVAILABLE, etc.) to avoid ModuleNotFoundError when xarray
is not installed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t-local symlinks, and normalized search filenames

- SearchQueryParser.from_shell_syntax(): parses -t/-a/-j/-ymin/-ymax/-cmin/-cmax/-ifmin/-ifmax operators
- scitex.scholar.filters: apply_filters() for plain-dict paper filtering (no Django ORM)
- normalize_search_filename(): timestamped YYYYMMDD-HHMMSS-keyword-keyword.bib naming
- LibraryManager.project_dir: mirrors paper symlinks into {project_dir}/scitex/scholar/library/{project}/
- SymlinkHandlersMixin._create_project_local_symlink(): absolute-path symlinks in project tree
- scitex.writer: re-export export module from scitex_writer
- fix: metadata_engines/utils broken import scitex.scholar.utils → scitex.scholar._utils
- fix: test__describe.py stat names nanmean/nanstd → mean/std/median
- fix: pre-commit config empty YAML → repos: []
- tests: 42 tests for normalize_search_filename and _create_project_local_symlink (42/42 pass)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_key, sanitize_filename

Three new public helpers extracted from scitex-cloud to scitex.scholar as single source of truth:
- paper_from_search_result(result): normalises raw search-API dicts (handles externalUrl, snippet aliases)
- make_citation_key(last_name, year): citation key generation from author/year components
- sanitize_filename(filename, max_length=50): safe download filename generation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix circular import: import ScholarConfig before Scholar/Paper/Papers
  (ScholarPDFDownloader imports ScholarConfig from scitex.scholar)
- Remove ensure_workspace from delattr list (function same name as module)
- Hide local_dbs exports with underscore prefix (_crossref_scitex, _openalex_scitex)
- Use delattr loop to remove leaked submodule attributes from namespace
- Power-user classes accessible but excluded from __all__

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Read papers directly from Zotero's SQLite database without API key.
Auto-detects Linux (~/Zotero/) and Windows WSL (/mnt/c/Users/*/Zotero/)
installations. Reuses existing ZoteroMapper for data conversion.

- ZoteroLocalReader: read_all(), read_by_tags(), read_by_collection()
- export_for_zotero(): write BibTeX/RIS for Zotero > File > Import
- Batch SQL queries (4 queries total, no N+1)
- 16 tests, all passing against actual ~/Zotero/zotero.sqlite

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add to_networkx() to CitationGraph model and create visualization.py
with 4 backends (figrecipe > scitex.plt > matplotlib > pyvis) using
_XXX_AVAILABLE flags for graceful degradation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hide power-user classes and internal helpers via __getattr__ with
backward compatibility. Expose CitationGraphBuilder and plot_citation_graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ported from scitex-cloud's scholar_app to standalone Flask app.
Includes force-directed SVG graph visualization, dark theme, 4 API
endpoints, and CLI command (scitex scholar gui). Library, Search,
and Enrichment tabs are placeholders for future phases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ywatanabe1989 ywatanabe1989 merged commit 45aea4c into main Feb 18, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments