Skip to content

Commit b66f16a

Browse files
committed
BibexPy v2.0.0 "Helium" - local web platform rewrite
- FastAPI + Next.js (static export) shipped as a single pip-installable wheel - One-click Smart Merge (DOI + Jaro-Winkler record linkage, borderline review) - ORCID-first author disambiguation, address harmonization - Multi-source enrichment (CrossRef, OpenAlex, Scopus, DataCite, Unpaywall, ...) - Reproducible filtering presets, weighted quality dashboard, full provenance - Structured export: WoS, VOSviewer, BibTeX, RIS, CSV/TSV/XLSX - Corporate navy/purple palette, Helium logo set, launcher homepage - CI: tag-triggered wheel build + PyPI Trusted Publishing (OIDC)
0 parents  commit b66f16a

186 files changed

Lines changed: 38552 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Root .env — docker-compose tarafından okunur.
2+
3+
# --- Bibliometrik API anahtarları (opsiyonel) ---
4+
SCOPUS_API_KEY=
5+
SEMANTIC_SCHOLAR_API_KEY=
6+
UNPAYWALL_EMAIL=
7+
CROSSREF_EMAIL=
8+
9+
# --- DeepSeek (Deneysel disambiguation) ---
10+
DEEPSEEK_API_KEY=
11+
DEEPSEEK_MODEL=deepseek-chat
12+
DEEPSEEK_BASE_URL=https://api.deepseek.com
13+
DISAMBIGUATION_ENABLED=true

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Satır sonu normalizasyonu — repo LF saklar; shell scriptleri DAİMA LF (CI/Linux güvenli),
2+
# Windows scriptleri CRLF. Bu, scripts/build_wheel.sh'in CI'da \r yüzünden kırılmasını önler.
3+
* text=auto eol=lf
4+
*.sh text eol=lf
5+
*.ps1 text eol=crlf
6+
*.bat text eol=crlf
7+
8+
# İkili varlıklar
9+
*.png binary
10+
*.jpg binary
11+
*.jpeg binary
12+
*.gif binary
13+
*.ico binary
14+
*.whl binary

.github/assets/bibexpy-home.png

337 KB
Loading

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release (PyPI wheel)
2+
3+
# v* tag'i push edilince (örn. v2.0.0) tetiklenir:
4+
# git tag v2.0.0 && git push origin v2.0.0
5+
#
6+
# Akış: Node ile frontend static export → apps/api + bibex_core kopyala →
7+
# tek wheel build → PyPI'a yükle (Trusted Publishing / OIDC).
8+
#
9+
# Auth: PyPI Trusted Publishing (OIDC) — secret/token GEREKMEZ. PyPI'da publisher
10+
# tanımlı: Repository bcankara/BibexPy · Workflow release.yml.
11+
# (Yedek yöntem: twine + PYPI_API_TOKEN secret; bu workflow OIDC kullanır.)
12+
13+
on:
14+
push:
15+
tags:
16+
- "v*"
17+
workflow_dispatch: {} # manuel tetikleme
18+
19+
jobs:
20+
build-and-publish:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
id-token: write # PyPI Trusted Publishing (OIDC) — token gerekmez
24+
contents: read
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node (frontend build)
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: "20"
33+
cache: "npm"
34+
cache-dependency-path: apps/web/package-lock.json
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: "3.12"
40+
41+
- name: Install frontend deps
42+
working-directory: apps/web
43+
run: npm ci
44+
45+
- name: Build wheel (static export + assemble + build)
46+
run: bash scripts/build_wheel.sh
47+
48+
- name: Verify wheel contents
49+
run: |
50+
WHL=$(ls python_pkg/dist/*.whl)
51+
echo "Wheel: $WHL"
52+
python -m zipfile -l "$WHL" | grep -E "_server/main.py|_web/index.html|bibex_core/scp2xlsx.py" \
53+
|| { echo "HATA: wheel eksik içerik"; exit 1; }
54+
55+
- name: Upload artifacts
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: bibexpy-dist
59+
path: python_pkg/dist/*
60+
61+
# PyPI Trusted Publishing (OIDC) — PyPI'da publisher tanımlı:
62+
# Repository: bcankara/BibexPy · Workflow: release.yml
63+
# Token/secret saklamaya gerek yok; kimlik GitHub OIDC ile doğrulanır.
64+
- name: Publish to PyPI (Trusted Publishing / OIDC)
65+
uses: pypa/gh-action-pypi-publish@release/v1
66+
with:
67+
packages-dir: python_pkg/dist

.gitignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*.egg-info/
5+
*.egg
6+
.venv/
7+
venv/
8+
env/
9+
.pytest_cache/
10+
.mypy_cache/
11+
.ruff_cache/
12+
13+
# Node
14+
node_modules/
15+
.next/
16+
.turbo/
17+
out/
18+
dist/
19+
*.log
20+
.pnpm-store/
21+
22+
# Env
23+
.env
24+
.env.local
25+
.env.*.local
26+
27+
# Storage (kullanıcı dosyaları)
28+
apps/api/storage/
29+
!apps/api/storage/.gitkeep
30+
31+
# IDE
32+
.vscode/
33+
.idea/
34+
*.swp
35+
.DS_Store
36+
37+
# Build
38+
build/
39+
*.tar.gz
40+
41+
# OS
42+
Thumbs.db
43+
desktop.ini
44+
45+
# Temp
46+
tmp/
47+
48+
# Dev/release scratch — geçici venv'ler, screenshot/seed scriptleri (repoya girmez)
49+
.shotsenv/
50+
.pkgtest*/
51+
home*.js
52+
shot.js
53+
seed.py
54+
55+
# Paper assets — manuscript ve figürler kod reposunda tutulmaz
56+
manuscript_*.docx
57+
manuscript_assets/
58+
59+
# V1 — kendi git repo'su olan ayri kod tabani; V2 reposunda izlenmez
60+
/BibexPy/

README.md

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
<p align="center">
2+
<a href="https://bibexpy.com">
3+
<img src="apps/web/public/images/bibexpy-logo-full.png" alt="BibexPy — V2.0.0 Helium — Bibliometrics Experience with Python" width="420">
4+
</a>
5+
</p>
6+
7+
<p align="center">
8+
<strong>Self-hosted, reproducible bibliometric data preparation for Web of Science &amp; Scopus.</strong>
9+
</p>
10+
11+
<p align="center">
12+
<a href="https://pypi.org/project/bibexpy/"><img src="https://img.shields.io/pypi/v/bibexpy?color=0c2847&label=PyPI" alt="PyPI"></a>
13+
<a href="https://pypi.org/project/bibexpy/"><img src="https://img.shields.io/pypi/pyversions/bibexpy?color=0c2847" alt="Python"></a>
14+
<a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPL--3.0-4f1964.svg" alt="License: GPL-3.0"></a>
15+
<a href="https://doi.org/10.1016/j.softx.2025.102098"><img src="https://img.shields.io/badge/DOI-10.1016%2Fj.softx.2025.102098-0f766e" alt="DOI"></a>
16+
</p>
17+
18+
<p align="center">
19+
🌐 <a href="https://bibexpy.com">bibexpy.com</a> ·
20+
📚 <a href="https://bibexpy.com/doc">Documentation</a> ·
21+
📄 <a href="https://doi.org/10.1016/j.softx.2025.102098">Paper (SoftwareX)</a> ·
22+
▶️ <a href="https://www.youtube.com/@BibexPy">YouTube</a>
23+
</p>
24+
25+
---
26+
27+
**BibexPy v2.0.0 “Helium”** — the successor to v1.1.0 “Hydrogen” — turns the original
28+
command-line BibexPy into a **local web platform**, shipped as a single pip-installable
29+
package. It merges, filters, harmonizes, enriches and exports Web of Science + Scopus
30+
records with full provenance, and **never sends your licensed exports off your machine**.
31+
32+
<p align="center">
33+
<img src=".github/assets/bibexpy-home.png" alt="BibexPy v2 home screen" width="780">
34+
</p>
35+
36+
## Install
37+
38+
```bash
39+
pip install bibexpy
40+
bibexpy # launches the local web UI (browser opens automatically)
41+
```
42+
43+
Requires only **Python 3.10+** — no Node.js/npm needed (the Next.js UI ships precompiled
44+
inside the wheel). Works on Windows, macOS and Linux.
45+
46+
```bash
47+
bibexpy --port 8080 # custom port
48+
bibexpy --no-browser # server only
49+
bibexpy --storage ./data # custom storage folder
50+
bibexpy --version # → BibexPy 2.0.0 (Helium)
51+
```
52+
53+
Projects/data live under `~/.bibexpy/storage`; settings and API keys under `~/.bibexpy/.env`
54+
(managed from the in-app Settings page).
55+
56+
## What's new in v2
57+
58+
- **One-click Smart Merge** — multi-stage probabilistic record linkage: exact DOI/identifier
59+
matching + Jaro–Winkler title similarity, confidence scoring, and an optional
60+
borderline-review queue. The result includes a copy-ready methodology paragraph.
61+
- **ORCID-first author disambiguation** — ORCID identifiers as deterministic evidence, with a
62+
constrained field-similarity fallback only when coverage is incomplete.
63+
- **Address harmonization** — organization roll-up to a canonical parent institution +
64+
country standardization.
65+
- **Multi-source enrichment** — fetch-once-fill-all across CrossRef, OpenAlex, Scopus,
66+
DataCite, Unpaywall, Europe PMC and Semantic Scholar; reverse-DOI recovery; identity
67+
fields (ORCID/ROR). Verifiable sources only — no ML-inferred metadata.
68+
- **Reproducible filtering** — multi-facet inclusion/exclusion criteria, saved as reusable
69+
presets.
70+
- **Quality dashboard** — a bibliometrically weighted health score + an exportable General
71+
Overview table (CSV / XLSX / PNG).
72+
- **Provenance** — append-only audit log, pre-operation snapshots, isolated analyses, and an
73+
auto-generated methodology narrative for your paper's data-preparation section.
74+
- **Structured export** — WoS plain text, VOSviewer TSV, BibTeX, RIS, CSV, TSV, XLSX
75+
(interoperable with VOSviewer & Biblioshiny).
76+
77+
## Workflow
78+
79+
A guided five-step pipeline:
80+
81+
**Data & Merge → Records & Filtering → Harmonization → Export → Report**
82+
83+
Raw Scopus (`.csv`) and Web of Science (`.txt`) exports are uploaded and merged in a single
84+
click (file preparation runs implicitly), and each merge is stored as an isolated,
85+
reproducible analysis.
86+
87+
## Repository layout
88+
89+
```
90+
apps/
91+
web/ # Next.js 14 frontend (static-exported into the wheel)
92+
api/ # FastAPI backend (documented HTTP API under /api)
93+
packages/
94+
bibex_core/ # core bibliometric library (converters, merge, C1 utils, …)
95+
python_pkg/ # PyPI packaging — builds the single pip wheel
96+
scripts/ # build_wheel.sh / build_wheel.ps1
97+
.github/workflows/ # release.yml — tag → wheel → PyPI (Trusted Publishing)
98+
```
99+
100+
The published wheel bundles the **prebuilt** frontend (`_web`) + backend (`_server`) +
101+
vendored core, so end users need no Node.js. Those build-time copies are git-ignored — the
102+
source of truth is `apps/` and `packages/`, and the wheel is regenerated by CI.
103+
104+
## Development
105+
106+
```bash
107+
# Backend (port 8001)
108+
cd apps/api
109+
pip install -r requirements.txt
110+
pip install -e ../../packages/bibex_core
111+
uvicorn main:app --reload --port 8001
112+
113+
# Frontend (port 3000) — separate terminal
114+
cd apps/web
115+
npm install
116+
npm run dev
117+
```
118+
119+
Then open <http://localhost:3000>. Run tests with `cd apps/api && python -m pytest -q`.
120+
121+
## Build the wheel (maintainers)
122+
123+
```bash
124+
bash scripts/build_wheel.sh # macOS / Linux
125+
pwsh scripts/build_wheel.ps1 # Windows
126+
```
127+
128+
`python_pkg/dist/bibexpy-2.0.0-py3-none-any.whl` — a pure-python `py3-none-any` wheel that
129+
installs on Windows / macOS / Linux with no compiler.
130+
131+
## Release
132+
133+
Tagging a version triggers GitHub Actions, which builds the wheel (with Node) and publishes
134+
it to PyPI via **Trusted Publishing (OIDC)** — no API tokens stored:
135+
136+
```bash
137+
git tag v2.0.0 && git push origin v2.0.0
138+
```
139+
140+
## Links
141+
142+
[Website](https://bibexpy.com) ·
143+
[Docs](https://bibexpy.com/doc) ·
144+
[YouTube](https://www.youtube.com/@BibexPy) ·
145+
[X / Twitter](https://twitter.com/BibexPy) ·
146+
[Instagram](https://www.instagram.com/bibexpy/) ·
147+
[Paper (SoftwareX)](https://doi.org/10.1016/j.softx.2025.102098)
148+
149+
## License
150+
151+
[GPL-3.0-or-later](https://www.gnu.org/licenses/gpl-3.0).
152+
153+
## Citation
154+
155+
If you use BibexPy in your research, please cite:
156+
157+
> Kara, B. C., Şahin, A., & Dirsehan, T. (2025). BibexPy: Harmonizing the bibliometric
158+
> symphony of Scopus and Web of Science. *SoftwareX*, 30, 102098.
159+
> <https://doi.org/10.1016/j.softx.2025.102098>
160+
161+
```bibtex
162+
@article{bibexpy2025,
163+
title = {BibexPy: Harmonizing the bibliometric symphony of {Scopus} and {Web of Science}},
164+
author = {Kara, Burak Can and {\c{S}}ahin, Alperen and Dirsehan, Ta{\c{s}}k{\i}n},
165+
journal = {SoftwareX},
166+
volume = {30},
167+
pages = {102098},
168+
year = {2025},
169+
doi = {10.1016/j.softx.2025.102098}
170+
}
171+
```

apps/api/.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# --- Sunucu ---
2+
API_HOST=127.0.0.1
3+
API_PORT=8001
4+
API_CORS_ORIGINS=http://localhost:3000
5+
6+
# --- Depolama ---
7+
STORAGE_DIR=./storage
8+
9+
# --- Bibliometrik API anahtarları (opsiyonel — enrichment için) ---
10+
SCOPUS_API_KEY=
11+
SEMANTIC_SCHOLAR_API_KEY=
12+
UNPAYWALL_EMAIL=
13+
CROSSREF_EMAIL=
14+
15+
# --- DeepSeek (Deneysel disambiguation) ---
16+
DEEPSEEK_API_KEY=
17+
DEEPSEEK_MODEL=deepseek-chat
18+
DEEPSEEK_BASE_URL=https://api.deepseek.com
19+
DISAMBIGUATION_ENABLED=true
20+
DISAMBIGUATION_BLOCKING_THRESHOLD=0.7
21+
DISAMBIGUATION_AUTO_APPROVE_THRESHOLD=0.95

apps/api/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# System deps for pandas/scikit
6+
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
build-essential \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Önce bibex_core (editable install)
11+
COPY packages/bibex_core /opt/bibex_core
12+
RUN pip install --no-cache-dir -e /opt/bibex_core
13+
14+
# API
15+
COPY apps/api/requirements.txt /tmp/requirements.txt
16+
# requirements.txt'deki -e ../../packages/... satırı bizim için zaten yapıldı; geri kalanı kur
17+
RUN grep -v "^-e " /tmp/requirements.txt > /tmp/req.txt && \
18+
pip install --no-cache-dir -r /tmp/req.txt
19+
20+
COPY apps/api /app
21+
22+
# NLTK data preheat
23+
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')" || true
24+
25+
EXPOSE 8001
26+
27+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]

0 commit comments

Comments
 (0)