bibtex-updater 0.1.0__tar.gz

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 (42) hide show
  1. bibtex_updater-0.1.0/.gitignore +40 -0
  2. bibtex_updater-0.1.0/LICENSE +21 -0
  3. bibtex_updater-0.1.0/PKG-INFO +263 -0
  4. bibtex_updater-0.1.0/README.md +211 -0
  5. bibtex_updater-0.1.0/docs/BIBTEX_UPDATER.md +254 -0
  6. bibtex_updater-0.1.0/docs/FILTER_BIBLIOGRAPHY.md +151 -0
  7. bibtex_updater-0.1.0/docs/REFERENCE_FACT_CHECKER.md +215 -0
  8. bibtex_updater-0.1.0/docs/ZOTERO_UPDATER.md +263 -0
  9. bibtex_updater-0.1.0/examples/README.md +42 -0
  10. bibtex_updater-0.1.0/examples/latexmkrc +88 -0
  11. bibtex_updater-0.1.0/examples/workflows/filter-bibliography.yml +63 -0
  12. bibtex_updater-0.1.0/examples/workflows/update-and-filter-bibliography.yml +75 -0
  13. bibtex_updater-0.1.0/examples/workflows/update-bibliography.yml +28 -0
  14. bibtex_updater-0.1.0/examples/workflows/validate-references.yml +100 -0
  15. bibtex_updater-0.1.0/pyproject.toml +157 -0
  16. bibtex_updater-0.1.0/src/bibtex_updater/__init__.py +123 -0
  17. bibtex_updater-0.1.0/src/bibtex_updater/_version.py +34 -0
  18. bibtex_updater-0.1.0/src/bibtex_updater/cli/__init__.py +1 -0
  19. bibtex_updater-0.1.0/src/bibtex_updater/cli/fact_checker_cli.py +18 -0
  20. bibtex_updater-0.1.0/src/bibtex_updater/cli/filter_cli.py +18 -0
  21. bibtex_updater-0.1.0/src/bibtex_updater/cli/updater_cli.py +18 -0
  22. bibtex_updater-0.1.0/src/bibtex_updater/cli/zotero_cli.py +18 -0
  23. bibtex_updater-0.1.0/src/bibtex_updater/fact_checker.py +1718 -0
  24. bibtex_updater-0.1.0/src/bibtex_updater/filter.py +610 -0
  25. bibtex_updater-0.1.0/src/bibtex_updater/updater.py +2248 -0
  26. bibtex_updater-0.1.0/src/bibtex_updater/utils.py +491 -0
  27. bibtex_updater-0.1.0/src/bibtex_updater/zotero.py +480 -0
  28. bibtex_updater-0.1.0/tests/__init__.py +1 -0
  29. bibtex_updater-0.1.0/tests/conftest.py +334 -0
  30. bibtex_updater-0.1.0/tests/fixtures/main.tex +42 -0
  31. bibtex_updater-0.1.0/tests/fixtures/sample.bib +141 -0
  32. bibtex_updater-0.1.0/tests/fixtures/subdir/appendix.tex +22 -0
  33. bibtex_updater-0.1.0/tests/test_bib_utils.py +335 -0
  34. bibtex_updater-0.1.0/tests/test_detector.py +205 -0
  35. bibtex_updater-0.1.0/tests/test_fact_checker.py +794 -0
  36. bibtex_updater-0.1.0/tests/test_field_checker.py +421 -0
  37. bibtex_updater-0.1.0/tests/test_filter_bibliography.py +646 -0
  38. bibtex_updater-0.1.0/tests/test_integration.py +332 -0
  39. bibtex_updater-0.1.0/tests/test_scholarly.py +521 -0
  40. bibtex_updater-0.1.0/tests/test_updater.py +376 -0
  41. bibtex_updater-0.1.0/tests/test_utils.py +317 -0
  42. bibtex_updater-0.1.0/tests/test_zotero_updater.py +554 -0
@@ -0,0 +1,40 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Virtual environments
7
+ .venv/
8
+ venv/
9
+ ENV/
10
+
11
+ # IDE
12
+ .idea/
13
+ .vscode/
14
+ *.swp
15
+ *.swo
16
+
17
+ # Testing
18
+ .pytest_cache/
19
+ .coverage
20
+ htmlcov/
21
+ .tox/
22
+
23
+ # Cache files
24
+ .cache.replace_preprints.json
25
+ *.cache
26
+
27
+ # Build
28
+ dist/
29
+ build/
30
+ *.egg-info/
31
+ src/*.egg-info/
32
+
33
+ # Version file (auto-generated by hatch-vcs)
34
+ src/bibtex_updater/_version.py
35
+
36
+ # OS
37
+ .DS_Store
38
+ Thumbs.db
39
+ CLAUDE.md
40
+ .claude/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Patrik Reizinger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.4
2
+ Name: bibtex-updater
3
+ Version: 0.1.0
4
+ Summary: Replace preprint BibTeX entries with published versions and validate bibliography references
5
+ Project-URL: Homepage, https://github.com/rpatrik96/bibtexupdater
6
+ Project-URL: Documentation, https://github.com/rpatrik96/bibtexupdater#readme
7
+ Project-URL: Repository, https://github.com/rpatrik96/bibtexupdater.git
8
+ Project-URL: Issues, https://github.com/rpatrik96/bibtexupdater/issues
9
+ Project-URL: Changelog, https://github.com/rpatrik96/bibtexupdater/blob/main/CHANGELOG.md
10
+ Author: Patrik Reizinger
11
+ License: MIT
12
+ License-File: LICENSE
13
+ Keywords: academic,arxiv,bibliography,bibtex,citation,crossref,latex,preprint,research
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering
26
+ Classifier: Topic :: Text Processing :: Markup :: LaTeX
27
+ Classifier: Typing :: Typed
28
+ Requires-Python: >=3.9
29
+ Requires-Dist: bibtexparser>=1.4.0
30
+ Requires-Dist: crossref-commons>=0.0.7
31
+ Requires-Dist: httpx>=0.24.0
32
+ Requires-Dist: rapidfuzz>=3.0.0
33
+ Requires-Dist: requests>=2.28.0
34
+ Provides-Extra: all
35
+ Requires-Dist: pyzotero>=1.5.0; extra == 'all'
36
+ Requires-Dist: scholarly>=1.7.0; extra == 'all'
37
+ Provides-Extra: dev
38
+ Requires-Dist: black>=24.0.0; extra == 'dev'
39
+ Requires-Dist: build>=1.0.0; extra == 'dev'
40
+ Requires-Dist: mypy>=1.13.0; extra == 'dev'
41
+ Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
42
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
43
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
44
+ Requires-Dist: ruff>=0.7.0; extra == 'dev'
45
+ Requires-Dist: twine>=5.0.0; extra == 'dev'
46
+ Requires-Dist: types-requests>=2.31.0; extra == 'dev'
47
+ Provides-Extra: scholarly
48
+ Requires-Dist: scholarly>=1.7.0; extra == 'scholarly'
49
+ Provides-Extra: zotero
50
+ Requires-Dist: pyzotero>=1.5.0; extra == 'zotero'
51
+ Description-Content-Type: text/markdown
52
+
53
+ # BibTeX Updater
54
+
55
+ Tools for managing BibTeX bibliographies: automatically update preprints to published versions, validate references against external databases, and filter to only cited references.
56
+
57
+ ## Installation
58
+
59
+ ### From PyPI (Recommended)
60
+
61
+ ```bash
62
+ pip install bibtex-updater
63
+
64
+ # With Google Scholar support
65
+ pip install bibtex-updater[scholarly]
66
+
67
+ # With Zotero support
68
+ pip install bibtex-updater[zotero]
69
+
70
+ # All optional dependencies
71
+ pip install bibtex-updater[all]
72
+ ```
73
+
74
+ ### From Source
75
+
76
+ ```bash
77
+ git clone https://github.com/rpatrik96/bibtexupdater.git
78
+ cd bibtexupdater
79
+ pip install -e ".[dev]"
80
+ ```
81
+
82
+ ## CLI Commands
83
+
84
+ | Command | Description |
85
+ |---------|-------------|
86
+ | `bibtex-update` | Replace preprints with published versions |
87
+ | `bibtex-check` | Validate references exist with correct metadata |
88
+ | `bibtex-filter` | Filter to only cited entries |
89
+ | `bibtex-zotero` | Update preprints in Zotero library |
90
+
91
+ ## Quick Start
92
+
93
+ ### Update Preprints
94
+
95
+ ```bash
96
+ # Update preprints to published versions
97
+ bibtex-update references.bib -o updated.bib
98
+
99
+ # Preview changes (dry run)
100
+ bibtex-update references.bib --dry-run --verbose
101
+ ```
102
+
103
+ ### Validate References (Fact-Check)
104
+
105
+ ```bash
106
+ # Check if references exist and have correct metadata
107
+ bibtex-check references.bib --report report.json
108
+
109
+ # Strict mode: exit with error if hallucinated/not-found entries
110
+ bibtex-check references.bib --strict
111
+ ```
112
+
113
+ ### Filter Bibliography
114
+
115
+ ```bash
116
+ # Filter to only cited entries
117
+ bibtex-filter paper.tex -b references.bib -o filtered.bib
118
+
119
+ # Multiple tex files
120
+ bibtex-filter *.tex -b references.bib -o filtered.bib
121
+ ```
122
+
123
+ ### Update Zotero Library
124
+
125
+ ```bash
126
+ # Set credentials (get from zotero.org/settings/keys)
127
+ export ZOTERO_LIBRARY_ID="your_user_id"
128
+ export ZOTERO_API_KEY="your_api_key"
129
+
130
+ # Preview changes
131
+ bibtex-zotero --dry-run
132
+
133
+ # Apply updates
134
+ bibtex-zotero
135
+ ```
136
+
137
+ ## Standalone Scripts
138
+
139
+ For environments without pip (e.g., Overleaf), `filter_bibliography.py` can be used directly as it has no dependencies:
140
+
141
+ ```bash
142
+ # Copy the script and run directly
143
+ python filter_bibliography.py paper.tex -b references.bib -o filtered.bib
144
+ ```
145
+
146
+ ## Documentation
147
+
148
+ | Document | Description |
149
+ |----------|-------------|
150
+ | [docs/BIBTEX_UPDATER.md](docs/BIBTEX_UPDATER.md) | Full BibTeX updater documentation |
151
+ | [docs/REFERENCE_FACT_CHECKER.md](docs/REFERENCE_FACT_CHECKER.md) | Full reference fact-checker documentation |
152
+ | [docs/ZOTERO_UPDATER.md](docs/ZOTERO_UPDATER.md) | Full Zotero updater documentation |
153
+ | [docs/FILTER_BIBLIOGRAPHY.md](docs/FILTER_BIBLIOGRAPHY.md) | Full filter documentation |
154
+ | [examples/](examples/) | Example workflows and configuration files |
155
+
156
+ ## Overleaf Integration
157
+
158
+ Both tools integrate with Overleaf via GitHub Actions or latexmkrc.
159
+
160
+ ### GitHub Actions (Recommended)
161
+
162
+ 1. Enable GitHub sync in Overleaf (Menu -> Sync -> GitHub)
163
+ 2. Copy a workflow from [examples/workflows/](examples/workflows/) to `.github/workflows/`
164
+ 3. Changes synced from Overleaf automatically trigger updates
165
+
166
+ ### latexmkrc (Direct Overleaf)
167
+
168
+ For `filter_bibliography.py` only (no dependencies required):
169
+
170
+ 1. Upload `filter_bibliography.py` to your Overleaf project
171
+ 2. Create `.latexmkrc` based on [examples/latexmkrc](examples/latexmkrc)
172
+ 3. Recompile - filtered bibliography appears in your file list
173
+
174
+ ## Features
175
+
176
+ ### BibTeX Updater (`bibtex-update`)
177
+
178
+ - **Multi-source resolution**: arXiv, Crossref, DBLP, Semantic Scholar, Google Scholar
179
+ - **High accuracy**: Title and author fuzzy matching with confidence thresholds
180
+ - **Batch processing**: Multiple files with concurrent workers
181
+ - **Deduplication**: Merge duplicates by DOI or normalized title+authors
182
+ - **Caching**: On-disk cache to avoid repeated API calls
183
+
184
+ ### Zotero Updater (`bibtex-zotero`)
185
+
186
+ - **Direct Zotero integration**: Fetches and updates items via Zotero API
187
+ - **Same resolution pipeline**: Uses the same multi-source resolution
188
+ - **Preserves metadata**: Keeps notes, tags, and attachments intact
189
+ - **Idempotent**: Already-published papers are automatically skipped
190
+ - **Dry-run mode**: Preview changes before applying
191
+
192
+ ### Reference Fact-Checker (`bibtex-check`)
193
+
194
+ - **Multi-source validation**: Crossref, DBLP, Semantic Scholar
195
+ - **Detailed mismatch detection**: Title, author, year, venue comparisons
196
+ - **Hallucination detection**: Identifies likely fabricated references
197
+ - **Structured reports**: JSON and JSONL output formats
198
+ - **CI/CD integration**: Strict mode with exit codes for automation
199
+
200
+ ### Filter Bibliography (`bibtex-filter`)
201
+
202
+ - **Zero dependencies**: Uses only Python standard library
203
+ - **Works on Overleaf**: No pip install needed
204
+ - **Multiple bib files**: Merge and filter from multiple sources
205
+ - **Citation detection**: Supports natbib, biblatex, and standard LaTeX citations
206
+
207
+ ## Python API
208
+
209
+ ```python
210
+ from bibtex_updater import Detector, Resolver, Updater, HttpClient, RateLimiter, DiskCache
211
+
212
+ # Create HTTP client with rate limiting and caching
213
+ rate_limiter = RateLimiter(req_per_min=30)
214
+ cache = DiskCache(".cache.json")
215
+ http_client = HttpClient(
216
+ timeout=30.0,
217
+ user_agent="bibtex-updater/0.1.0",
218
+ rate_limiter=rate_limiter,
219
+ cache=cache
220
+ )
221
+
222
+ # Detect preprints
223
+ detector = Detector()
224
+ detection = detector.detect(entry)
225
+
226
+ if detection.is_preprint:
227
+ # Resolve to published version
228
+ resolver = Resolver(http_client)
229
+ candidate = resolver.resolve(detection)
230
+
231
+ if candidate and candidate.confidence >= 0.9:
232
+ # Update the entry
233
+ updater = Updater()
234
+ updated_entry = updater.update_entry(entry, candidate.record, detection)
235
+ ```
236
+
237
+ ## Development
238
+
239
+ ```bash
240
+ # Clone and install in development mode
241
+ git clone https://github.com/rpatrik96/bibtexupdater.git
242
+ cd bibtexupdater
243
+ pip install -e ".[dev,all]"
244
+
245
+ # Run tests
246
+ pytest tests/ -v
247
+
248
+ # Run tests with coverage
249
+ pytest tests/ -v --cov=bibtex_updater --cov-report=term-missing
250
+
251
+ # Code quality
252
+ pre-commit run --all-files
253
+
254
+ # Build package
255
+ python -m build
256
+
257
+ # Check package
258
+ twine check dist/*
259
+ ```
260
+
261
+ ## License
262
+
263
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,211 @@
1
+ # BibTeX Updater
2
+
3
+ Tools for managing BibTeX bibliographies: automatically update preprints to published versions, validate references against external databases, and filter to only cited references.
4
+
5
+ ## Installation
6
+
7
+ ### From PyPI (Recommended)
8
+
9
+ ```bash
10
+ pip install bibtex-updater
11
+
12
+ # With Google Scholar support
13
+ pip install bibtex-updater[scholarly]
14
+
15
+ # With Zotero support
16
+ pip install bibtex-updater[zotero]
17
+
18
+ # All optional dependencies
19
+ pip install bibtex-updater[all]
20
+ ```
21
+
22
+ ### From Source
23
+
24
+ ```bash
25
+ git clone https://github.com/rpatrik96/bibtexupdater.git
26
+ cd bibtexupdater
27
+ pip install -e ".[dev]"
28
+ ```
29
+
30
+ ## CLI Commands
31
+
32
+ | Command | Description |
33
+ |---------|-------------|
34
+ | `bibtex-update` | Replace preprints with published versions |
35
+ | `bibtex-check` | Validate references exist with correct metadata |
36
+ | `bibtex-filter` | Filter to only cited entries |
37
+ | `bibtex-zotero` | Update preprints in Zotero library |
38
+
39
+ ## Quick Start
40
+
41
+ ### Update Preprints
42
+
43
+ ```bash
44
+ # Update preprints to published versions
45
+ bibtex-update references.bib -o updated.bib
46
+
47
+ # Preview changes (dry run)
48
+ bibtex-update references.bib --dry-run --verbose
49
+ ```
50
+
51
+ ### Validate References (Fact-Check)
52
+
53
+ ```bash
54
+ # Check if references exist and have correct metadata
55
+ bibtex-check references.bib --report report.json
56
+
57
+ # Strict mode: exit with error if hallucinated/not-found entries
58
+ bibtex-check references.bib --strict
59
+ ```
60
+
61
+ ### Filter Bibliography
62
+
63
+ ```bash
64
+ # Filter to only cited entries
65
+ bibtex-filter paper.tex -b references.bib -o filtered.bib
66
+
67
+ # Multiple tex files
68
+ bibtex-filter *.tex -b references.bib -o filtered.bib
69
+ ```
70
+
71
+ ### Update Zotero Library
72
+
73
+ ```bash
74
+ # Set credentials (get from zotero.org/settings/keys)
75
+ export ZOTERO_LIBRARY_ID="your_user_id"
76
+ export ZOTERO_API_KEY="your_api_key"
77
+
78
+ # Preview changes
79
+ bibtex-zotero --dry-run
80
+
81
+ # Apply updates
82
+ bibtex-zotero
83
+ ```
84
+
85
+ ## Standalone Scripts
86
+
87
+ For environments without pip (e.g., Overleaf), `filter_bibliography.py` can be used directly as it has no dependencies:
88
+
89
+ ```bash
90
+ # Copy the script and run directly
91
+ python filter_bibliography.py paper.tex -b references.bib -o filtered.bib
92
+ ```
93
+
94
+ ## Documentation
95
+
96
+ | Document | Description |
97
+ |----------|-------------|
98
+ | [docs/BIBTEX_UPDATER.md](docs/BIBTEX_UPDATER.md) | Full BibTeX updater documentation |
99
+ | [docs/REFERENCE_FACT_CHECKER.md](docs/REFERENCE_FACT_CHECKER.md) | Full reference fact-checker documentation |
100
+ | [docs/ZOTERO_UPDATER.md](docs/ZOTERO_UPDATER.md) | Full Zotero updater documentation |
101
+ | [docs/FILTER_BIBLIOGRAPHY.md](docs/FILTER_BIBLIOGRAPHY.md) | Full filter documentation |
102
+ | [examples/](examples/) | Example workflows and configuration files |
103
+
104
+ ## Overleaf Integration
105
+
106
+ Both tools integrate with Overleaf via GitHub Actions or latexmkrc.
107
+
108
+ ### GitHub Actions (Recommended)
109
+
110
+ 1. Enable GitHub sync in Overleaf (Menu -> Sync -> GitHub)
111
+ 2. Copy a workflow from [examples/workflows/](examples/workflows/) to `.github/workflows/`
112
+ 3. Changes synced from Overleaf automatically trigger updates
113
+
114
+ ### latexmkrc (Direct Overleaf)
115
+
116
+ For `filter_bibliography.py` only (no dependencies required):
117
+
118
+ 1. Upload `filter_bibliography.py` to your Overleaf project
119
+ 2. Create `.latexmkrc` based on [examples/latexmkrc](examples/latexmkrc)
120
+ 3. Recompile - filtered bibliography appears in your file list
121
+
122
+ ## Features
123
+
124
+ ### BibTeX Updater (`bibtex-update`)
125
+
126
+ - **Multi-source resolution**: arXiv, Crossref, DBLP, Semantic Scholar, Google Scholar
127
+ - **High accuracy**: Title and author fuzzy matching with confidence thresholds
128
+ - **Batch processing**: Multiple files with concurrent workers
129
+ - **Deduplication**: Merge duplicates by DOI or normalized title+authors
130
+ - **Caching**: On-disk cache to avoid repeated API calls
131
+
132
+ ### Zotero Updater (`bibtex-zotero`)
133
+
134
+ - **Direct Zotero integration**: Fetches and updates items via Zotero API
135
+ - **Same resolution pipeline**: Uses the same multi-source resolution
136
+ - **Preserves metadata**: Keeps notes, tags, and attachments intact
137
+ - **Idempotent**: Already-published papers are automatically skipped
138
+ - **Dry-run mode**: Preview changes before applying
139
+
140
+ ### Reference Fact-Checker (`bibtex-check`)
141
+
142
+ - **Multi-source validation**: Crossref, DBLP, Semantic Scholar
143
+ - **Detailed mismatch detection**: Title, author, year, venue comparisons
144
+ - **Hallucination detection**: Identifies likely fabricated references
145
+ - **Structured reports**: JSON and JSONL output formats
146
+ - **CI/CD integration**: Strict mode with exit codes for automation
147
+
148
+ ### Filter Bibliography (`bibtex-filter`)
149
+
150
+ - **Zero dependencies**: Uses only Python standard library
151
+ - **Works on Overleaf**: No pip install needed
152
+ - **Multiple bib files**: Merge and filter from multiple sources
153
+ - **Citation detection**: Supports natbib, biblatex, and standard LaTeX citations
154
+
155
+ ## Python API
156
+
157
+ ```python
158
+ from bibtex_updater import Detector, Resolver, Updater, HttpClient, RateLimiter, DiskCache
159
+
160
+ # Create HTTP client with rate limiting and caching
161
+ rate_limiter = RateLimiter(req_per_min=30)
162
+ cache = DiskCache(".cache.json")
163
+ http_client = HttpClient(
164
+ timeout=30.0,
165
+ user_agent="bibtex-updater/0.1.0",
166
+ rate_limiter=rate_limiter,
167
+ cache=cache
168
+ )
169
+
170
+ # Detect preprints
171
+ detector = Detector()
172
+ detection = detector.detect(entry)
173
+
174
+ if detection.is_preprint:
175
+ # Resolve to published version
176
+ resolver = Resolver(http_client)
177
+ candidate = resolver.resolve(detection)
178
+
179
+ if candidate and candidate.confidence >= 0.9:
180
+ # Update the entry
181
+ updater = Updater()
182
+ updated_entry = updater.update_entry(entry, candidate.record, detection)
183
+ ```
184
+
185
+ ## Development
186
+
187
+ ```bash
188
+ # Clone and install in development mode
189
+ git clone https://github.com/rpatrik96/bibtexupdater.git
190
+ cd bibtexupdater
191
+ pip install -e ".[dev,all]"
192
+
193
+ # Run tests
194
+ pytest tests/ -v
195
+
196
+ # Run tests with coverage
197
+ pytest tests/ -v --cov=bibtex_updater --cov-report=term-missing
198
+
199
+ # Code quality
200
+ pre-commit run --all-files
201
+
202
+ # Build package
203
+ python -m build
204
+
205
+ # Check package
206
+ twine check dist/*
207
+ ```
208
+
209
+ ## License
210
+
211
+ MIT License - see [LICENSE](LICENSE) for details.