Coverage for src/local_deep_research/journal_quality/__init__.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-03 23:15 +0000

1"""Journal-quality scoring system. 

2 

3This package owns the academic reference data used by the journal 

4reputation filter and the journal-quality dashboard. It contains: 

5 

6- `data_sources/`: registry of upstream sources (OpenAlex, DOAJ, JabRef, 

7 Stop Predatory Journals, OpenAlex Institutions). Each source declares 

8 its metadata and implements `fetch()`. The registry is the single 

9 declarative source of truth for the bulk download flow. 

10- `downloader.py`: orchestrates the bulk download into the user data 

11 directory and triggers the SQLite reference DB rebuild on completion. 

12- `db.py`: read-only SQLAlchemy accessor over the compiled 

13 `journal_quality.db`, plus the `build_db()` function that compiles it 

14 from the freshly-downloaded gzipped JSON snapshots. 

15- `models.py`: SQLAlchemy declarative models for the compiled DB. 

16- `scoring.py`: pure-function quality scoring helpers shared by the 

17 build phase and the runtime filter. 

18 

19The runtime DB is opened with SQLite URI flags `mode=ro&immutable=1` 

20and the file is `chmod 0o444` after every build. The only writer is 

21`build_db()` itself. 

22"""