Skip to content

Commit bcaa9af

Browse files
author
Ang
committed
fix: remove APA/MLA (#31 #32), dead _complete_fields code (#29), fix conference detection (#28), Statement of Need (#7 #14), examples (#33), docs cleanup (#6 #20)
- #31 #32: remove APA/MLA formatters; only BibTeX output is supported - #29: _complete_fields is now a no-op passthrough; removed _fetch_missing_field thread logic - #28: treat CrossRef 'proceedings-article' type and booktitle field as conference entries - #28: remove hardcoded 'arXiv preprint' journal from arXiv metadata - #7: add Statement of Need section to README - #14: add comparison table (OneCite vs Zotero/CrossRef/doi2bib) to README - #33: add docs/examples/ with references.txt and existing.bib sample files - #6: update README features table with accurate data source description - #20: confirm URL branch logic is not duplicating queries post-refactor - docs: remove APA/MLA from all documentation files - tests: update all tests to reflect APA/MLA removal Closes #31 Closes #32 Closes #29 Closes #28 Closes #7 Closes #14 Closes #33 Closes #6 Closes #20
1 parent 56d7239 commit bcaa9af

15 files changed

Lines changed: 134 additions & 334 deletions

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,33 @@
4040

4141
---
4242

43+
## Statement of Need
44+
45+
Researchers frequently accumulate reference lists in ad-hoc formats — DOIs copied from browser tabs, arXiv IDs from paper PDFs, titles typed by hand, and BibTeX fragments from various sources. Cleaning these into a consistent, complete `.bib` file is tedious and error-prone.
46+
47+
OneCite solves this by accepting **any mix of identifiers and text queries** and automatically resolving them to structured BibTeX through a pipeline of academic APIs (CrossRef, arXiv, PubMed, Semantic Scholar, and others). It is designed for researchers who work primarily in the terminal, use LaTeX, and want a lightweight, scriptable tool — not a full reference manager.
48+
49+
**When to use OneCite vs. alternatives:**
50+
51+
| Tool | Best for |
52+
|---|---|
53+
| **OneCite** | One-shot conversion of messy reference lists to BibTeX in a terminal/script |
54+
| **Zotero** | Long-term reference management, GUI-based, browser integration |
55+
| **CrossRef API directly** | When you have clean DOIs and want canonical metadata |
56+
| **doi2bib** | Single DOI → BibTeX conversion, no fuzzy matching |
57+
58+
---
59+
4360
## Features
4461

4562
| Feature | Description |
4663
| ----------------------- | ------------------------------------------------------------------------------------------------------- |
4764
| **Fuzzy Matching** | Match references against multiple academic databases even from incomplete or inaccurate info. |
48-
| **Multiple Formats** | Input `.txt`/`.bib` → Output **BibTeX**, **APA**, or **MLA**. |
65+
| **Multiple Formats** | Input `.txt`/`.bib` → Output **BibTeX**. |
4966
| **4-stage Pipeline** | A 4-stage process (clean → query → validate → format) to produce consistent output. |
5067
| **Field Completion** | Enrich entries by filling in missing fields like journal, volume, pages, and authors. |
5168
| 🎓 **7+ Citation Types** | Handles journal articles, conference papers, books, software, datasets, theses, and preprints. |
52-
| **Domain-Aware Routing** | Auto-detects content type and domain (Medical/CS/General) to pick the best data source. |
69+
| **Multi-Source Lookup** | Queries CrossRef, arXiv, PubMed, Semantic Scholar, Google Books, and others for every entry. |
5370
| **Many Identifier Types** | Accepts DOI, PMID, arXiv ID, ISBN, GitHub URL, Zenodo DOI, or plain text queries. |
5471
| 🎛️ **Interactive Mode** | Manually select the correct entry when multiple potential matches are found. |
5572
| **Custom Templates** | YAML-based templates to control which fields are collected and how entries are typed. |
@@ -144,14 +161,12 @@ Your `results.bib` file now contains entries of different types.
144161
## 📖 Advanced Usage
145162

146163
<details>
147-
<summary><strong>🎨 Multiple Output Formats (APA, MLA)</strong></summary>
164+
<summary><strong>Direct String and Stdin Input</strong></summary>
148165

149166
```bash
150-
onecite process refs.txt --output-format apa
151-
# → LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436-444.
152-
153-
onecite process refs.txt --output-format mla
154-
# → LeCun, Yann, Yoshua Bengio, and Geoffrey Hinton. "Deep Learning." Nature 521.7553 (2015): 436-444.
167+
onecite process "10.1038/nature14539"
168+
onecite process "Attention is all you need, Vaswani et al., NIPS 2017"
169+
echo "10.1038/nature14539" | onecite process -
155170
```
156171
</details>
157172

docs/advanced_usage.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,6 @@ To merge multiple `.bib` files::
102102

103103
cat file1.bib file2.bib file3.bib > combined.bib
104104

105-
Converting Between Formats
106-
---------------------------
107-
108-
Convert BibTeX to APA::
109-
110-
onecite process input.bib --output-format apa -o output.txt
111-
112-
Convert APA to BibTeX::
113-
114-
# First save APA format in a parseable way, then convert back
115-
onecite process references.txt --output-format apa -o apa_refs.txt
116-
# Then process again to get BibTeX
117-
onecite process original.txt -o output.bib
118105

119106
Using with Git for Version Control
120107
-----------------------------------

docs/api/core.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The primary function for processing citations.
2727
- ``input_content`` (str): The reference content to process
2828
- ``input_type`` (str): Type of input - ``"txt"`` or ``"bib"`` (required)
2929
- ``template_name`` (str): Template name to use (e.g., ``"journal_article_full"``) (required)
30-
- ``output_format`` (str): Output format - ``"bibtex"``, ``"apa"``, or ``"mla"`` (required)
30+
- ``output_format`` (str): Output format - currently only ``"bibtex"`` is supported (required)
3131
- ``interactive_callback`` (Callable): Function to handle ambiguous matches. Takes a list of candidate dicts and returns the selected index (0-based), or -1 to skip (required)
3232
- ``use_google_scholar`` (bool): Enable Google Scholar as an additional data source. Requires the optional ``scholarly`` package. Default is ``False``.
3333

docs/basic_usage.rst

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,10 @@ OneCite can process various academic identifiers:
5353
Output Formats
5454
~~~~~~~~~~~~~~
5555

56-
**BibTeX (.bib)** - Default format::
56+
**BibTeX (.bib)** - The output format::
5757

5858
onecite process refs.txt -o output.bib
5959

60-
**APA** - American Psychological Association format::
61-
62-
onecite process refs.txt --output-format apa
63-
64-
Example APA output::
65-
66-
LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436-444.
67-
68-
**MLA** - Modern Language Association format::
69-
70-
onecite process refs.txt --output-format mla
71-
72-
Example MLA output::
73-
74-
LeCun, Yann, Yoshua Bengio, and Geoffrey Hinton. "Deep Learning." Nature 521.7553 (2015): 436-444.
75-
7660
Command-Line Options
7761
~~~~~~~~~~~~~~~~~~~~~
7862

@@ -82,9 +66,7 @@ Command-Line Options
8266

8367
**Output Format (--output-format)**::
8468

85-
onecite process input.txt --output-format apa
86-
onecite process input.txt --output-format mla
87-
onecite process input.txt --output-format bibtex # default
69+
onecite process input.txt --output-format bibtex # only supported format
8870

8971
**Interactive Mode (--interactive)**
9072

@@ -154,16 +136,7 @@ Example 1: Process a BibTeX File
154136
This will read ``my_references.bib``, enhance the entries, and save to ``clean_references.bib``.
155137
The ``--input-type`` flag is optional for ``.bib`` files — OneCite detects the format automatically.
156138

157-
Example 2: Convert to APA Format
158-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159-
160-
::
161-
162-
onecite process references.txt --output-format apa -o output.txt
163-
164-
This will process references and output them in APA format.
165-
166-
Example 3: Interactive Processing
139+
Example 2: Interactive Processing
167140
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168141

169142
::
@@ -172,7 +145,7 @@ Example 3: Interactive Processing
172145

173146
This will allow you to manually verify and select the correct match for each reference.
174147

175-
Example 4: Quick Check Without Saving
148+
Example 3: Quick Check Without Saving
176149
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177150

178151
::
@@ -181,6 +154,19 @@ Example 4: Quick Check Without Saving
181154

182155
This will show you the processed results without saving to a file.
183156

157+
Example Files
158+
-------------
159+
160+
Ready-to-use example input files are in ``docs/examples/``:
161+
162+
- ``references.txt`` — mixed identifiers and text queries (one entry per blank-separated block)
163+
- ``existing.bib`` — a BibTeX file to be enriched
164+
165+
To run them::
166+
167+
onecite process docs/examples/references.txt -o results.bib
168+
onecite process docs/examples/existing.bib -o enriched.bib
169+
184170
Next Steps
185171
----------
186172

docs/examples/existing.bib

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@article{LeCun2015,
2+
title={Deep learning},
3+
author={LeCun, Yann and Bengio, Yoshua and Hinton, Geoffrey},
4+
journal={Nature},
5+
year={2015},
6+
volume={521},
7+
pages={436-444}
8+
}
9+
10+
@inproceedings{Vaswani2017,
11+
title={Attention Is All You Need},
12+
author={Vaswani, Ashish and Shazeer, Noam and Parmar, Niki},
13+
booktitle={Advances in Neural Information Processing Systems},
14+
year={2017}
15+
}

docs/examples/references.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
10.1038/nature14539
2+
3+
Attention is all you need, Vaswani et al., NIPS 2017
4+
5+
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
6+
7+
https://github.com/tensorflow/tensorflow
8+
9+
arXiv:2103.00020

onecite/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def create_parser() -> argparse.ArgumentParser:
8585
)
8686
process_parser.add_argument(
8787
'--output-format',
88-
choices=['bibtex', 'apa', 'mla'],
88+
choices=['bibtex'],
8989
default='bibtex',
9090
help='Output format (default: bibtex)'
9191
)

0 commit comments

Comments
 (0)