Skip to main content

Universal citation management and academic reference toolkit

Project description

OneCite Logo

OneCite

The Universal Citation & Academic Reference Toolkit

Total Downloads PyPI Version Python Version License Project Status

Effortlessly convert messy, unstructured references into perfectly formatted, standardized citations.

OneCite is a powerful command-line tool and Python library designed to automate the tedious process of citation management. Feed it anything—DOIs, paper titles,arXiv IDs, or even a mix—and get clean, accurate bibliographic entries in return.

🚀 OneCite for Web is coming.

Dropping soon at hezhiang.com/onecite.

✨ Features🚀 Quick Start📖 Advanced Usage🤖 AI Integration⚙️ Configuration🤝 Contributing


✨ Features

  • 🔍 Smart Recognition: Fuzzy matching against multiple academic databases to find references from incomplete or inaccurate information
  • 📚 Universal Format Support: Input .txt/.bib → Output BibTeX, APA, or MLA
  • 🎯 High-Accuracy Pipeline: 4-stage processing (clean → query → validate → format) ensures quality output
  • 🤖 Auto-Completion: Automatically fills missing data (journal, volume, pages, ISBN, authors)
  • 🎓 7+ Citation Types: Journal articles, conference papers, books, software, datasets, theses, preprints
  • 🧠 Intelligent Routing: Auto-detects content type and domain (medical/CS/general) for optimal data retrieval
  • 📄 Universal Identifiers: DOI, PMID, arXiv ID, ISBN, GitHub URL, Zenodo DOI, or plain text
  • 🎛️ Interactive Mode: Manual selection when multiple matches found
  • ⚙️ Customizable Templates: YAML-based template system for complete output control

🌐 Data Sources

CrossRef Semantic OpenAlex PubMed dblp arXiv DataCite Zenodo Google

🚀 Quick Start

Get up and running with OneCite in under a minute.

Installation

# Recommended: Install from PyPI
pip install onecite

# Or, install from source for the latest version
git clone https://github.com/HzaCode/OneCite.git
cd OneCite
pip install -e .

Basic Usage

  1. Create an input file (references.txt) with mixed citation types:

    10.1038/nature14539
    
    Attention is all you need, Vaswani et al., NIPS 2017
    
    Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
    
    https://github.com/tensorflow/tensorflow
    
    10.5281/zenodo.3233118
    
    arXiv:2103.00020
    
    Smith, J. (2020). Neural Architecture Search. PhD Thesis. Stanford University.
    
  2. Run the command:

    onecite process references.txt -o results.bib --quiet
    
  3. Get perfectly formatted output (results.bib) with 7 different types:

📄 View Complete Output (results.bib)
@article{LeCun2015Deep,
  doi = "10.1038/nature14539",
  title = "Deep learning",
  author = "LeCun, Yann and Bengio, Yoshua and Hinton, Geoffrey",
  journal = "Nature",
  year = 2015,
  volume = 521,
  number = 7553,
  pages = "436-444",
  publisher = "Springer Science and Business Media LLC",
  url = "https://doi.org/10.1038/nature14539",
  type = "journal-article",
}

@inproceedings{Vaswani2017Attention,
  arxiv = "1706.03762",
  title = "Attention Is All You Need",
  author = "Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones, Llion and Gomez, Aidan N. and Kaiser, Lukasz and Polosukhin, Illia",
  year = 2017,
  journal = "arXiv preprint",
  url = "https://arxiv.org/abs/1706.03762",
}

@book{Goodfellow2016Deep,
  title = "Deep Learning",
  author = "Ian Goodfellow and Yoshua Bengio and Aaron Courville",
  publisher = "MIT Press",
  year = 2016,
  isbn = "9780262337373",
  url = "https://play.google.com/store/books/details?id=omivDQAAQBAJ&source=gbs_api",
  pages = "801",
}

@software{tensorflow2015tensorflow,
  title = "tensorflow",
  author = "tensorflow",
  publisher = "GitHub",
  year = 2015,
  version = "2.20.0",
  url = "https://github.com/tensorflow/tensorflow",
}

@misc{Brett2019nipynibabel,
  title = "nipy/nibabel: 2.4.1",
  author = "Brett, Matthew and Markiewicz, Christopher J. and Hanke, Michael and Côté, Marc-Alexandre and Cipollini, Ben and McCarthy, Paul and Cheng, Christopher P. and Halchenko, Yaroslav O. and Cottaar, Michiel and Ghosh, Satrajit and Larson, Eric and Wassermann, Demian and Gerhard, Stephan and Lee, Gregory R. and Kastman, Erik and Rokem, Ariel and Madison, Cindee and Morency, Félix C. and Moloney, Brendan and Burns, Christopher and Millman, Jarrod and Gramfort, Alexandre and Leppäkangas, Jaakko and Markello, Ross and van den Bosch, Jasper J.F. and Vincent, Robert D. and Subramaniam, Krish and Raamana, Pradeep Reddy and Nichols, B. Nolan and Baker, Eric M. and Goncalves, Mathias and Hayashi, Soichi and Pinsard, Basile and Haselgrove, Christian and Hymers, Mark and Koudoro, Serge and Oosterhof, Nikolaas N. and Amirbekian, Bago and Nimmo-Smith, Ian and Nguyen, Ly and Reddigari, Samir and St-Jean, Samuel and Garyfallidis, Eleftherios and Varoquaux, Gael and Kaczmarzyk, Jakub and Legarreta, Jon Haitz and Hahn, Kevin S. and Hinds, Oliver P. and Fauber, Bennet and Poline, Jean-Baptiste and Stutters, Jon and Jordan, Kesshi and Cieslak, Matthew and Moreno, Miguel Estevan and Haenel, Valentin and Schwartz, Yannick and Thirion, Bertrand and Papadopoulos Orfanos, Dimitri and Pérez-García, Fernando and Solovey, Igor and Gonzalez, Ivan and Lecher, Justin and Leinweber, Katrin and Raktivan, Konstantinos and Fischer, Peter and Gervais, Philippe and Gadde, Syam and Ballinger, Thomas and Roos, Thomas and Reddam, Venkateswara Reddy and freec84",
  year = 2019,
  howpublished = "Zenodo",
  url = "https://zenodo.org/record/3233118",
  version = "2.4.1",
  doi = "10.5281/zenodo.3233118",
}

@article{Radford2021Learning,
  arxiv = "2103.00020",
  title = "Learning Transferable Visual Models From Natural Language Supervision",
  author = "Radford, Alec and Kim, Jong Wook and Hallacy, Chris and Ramesh, Aditya and Goh, Gabriel and Agarwal, Sandhini and Sastry, Girish and Askell, Amanda and Mishkin, Pamela and Clark, Jack and Krueger, Gretchen and Sutskever, Ilya",
  year = 2021,
  journal = "arXiv preprint",
  url = "https://arxiv.org/abs/2103.00020",
}

@phdthesis{Smith2020Neural,
  title = "Neural Architecture Search",
  author = "Smith, J.",
  school = "Stanford University",
  year = 2020,
  type = "phdthesis",
}

📖 Advanced Usage

🎨 Multiple Output Formats (APA, MLA)
# Generate APA formatted citations
onecite process refs.txt --output-format apa
# → LeCun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. Nature, 521(7553), 436-444.
# → Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. In Advances in Neural Information Processing Systems.

# Generate MLA formatted citations
onecite process refs.txt --output-format mla
# → LeCun, Yann, Yoshua Bengio, and Geoffrey Hinton. "Deep Learning." Nature 521.7553 (2015): 436-444.
# → Vaswani, Ashish, et al. "Attention Is All You Need." Advances in Neural Information Processing Systems. 2017.
🤖 Interactive Disambiguation

For ambiguous entries, use the --interactive flag to ensure accuracy.

Command:

onecite process ambiguous.txt --interactive

Example Interaction:

1. Deep learning
   Authors: LeCun, Yann; Bengio, Yoshua; Hinton, Geoffrey
   Journal: Nature
   Year: 2015
   Match Score: 92.5
   DOI: 10.1038/nature14539

2. Deep belief networks
   Authors: Hinton, Geoffrey E.
   Journal: Scholarpedia
   Year: 2009
   Match Score: 78.3
   DOI: 10.4249/scholarpedia.5947

Please select (1-2, 0=skip): 1
✅ Selected: Deep learning
🐍 Use as a Python Library

Integrate OneCite's processing power directly into your Python scripts.

from onecite import process_references

# Define a callback for non-interactive selection (e.g., always choose the best match)
def auto_select_callback(candidates):
    return 0

result = process_references(
    input_content="Deep learning review\nLeCun, Bengio, Hinton\nNature 2015",
    input_type="txt",
    output_format="bibtex",
    interactive_callback=auto_select_callback
)

print(result['output_content'])
📑 Supported Input Examples
# DOI
10.1038/nature14539

# Conference Papers
Attention is all you need, Vaswani et al., NIPS 2017

# arXiv
1706.03762
https://arxiv.org/abs/1706.03762

# Books
Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press.
Russell, S., & Norvig, P. (2021). Artificial Intelligence. ISBN: 978-0-13-604259-4.

# Software
https://github.com/tensorflow/tensorflow

# Datasets
10.5281/zenodo.3233118

# Thesis
Smith, J. (2020). Deep Learning for Computer Vision. PhD Thesis. MIT.

# PubMed
PMID: 27225100

🤖 AI Assistant Integration (MCP)

OneCite provides complete Model Context Protocol (MCP) support, enabling AI assistants to directly use OneCite's functionality for literature search, processing, and formatting.

🚀 Setup & Configuration

Installation & Testing

# Install OneCite
pip install onecite

# Test MCP server
onecite-mcp

Configure AI Assistant

Add to settings.json in MCP-supported editors:

{
  "mcpServers": {
    "onecite": {
      "command": "onecite-mcp",
      "args": [],
      "env": {}
    }
  }
}

Restart your editor to enable OneCite integration.

Available Functions

  • cite - Generate single citations (DOI, titles, arXiv IDs → APA/MLA/BibTeX)
  • batch_cite - Process multiple references at once
  • search - Search academic literature by keywords

Usage Examples

After configuration, tell your AI assistant:

  • "Generate an APA citation for DOI: 10.1038/nature14539"
  • "Batch process these references in BibTeX format"
  • "Search for papers on machine learning"

⚙️ Configuration

📋 Command Line Options
Option Description Default
--input-type Input format (txt, bib) txt
--output-format Output format (bibtex, apa, mla) bibtex
--template Specify a custom template YAML to use journal_article_full
--interactive Enable interactive mode for disambiguation False
--quiet Suppress verbose logging False
--output, -o Path to the output file stdout
🎨 Custom Templates

Define custom output formats using a simple YAML template.

Example my_template.yaml:

name: my_template
entry_type: "@article"
fields:
  - name: author
    required: true
  - name: title  
    required: true
  - name: journal
    required: true
  - name: year
    required: true
  - name: doi
    required: false
    source_priority: [crossref_api]

Usage:

onecite process refs.txt --template my_template.yaml

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for development guidelines and instructions on how to submit pull requests.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


OneCite: The all-in-one toolkit for every academic reference.

⭐ Star on GitHub🚀 Try the Web App📖 Read the Docs🐛 Report an Issue💬 Start a Discussion

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onecite-0.0.10.tar.gz (43.9 kB view details)

Uploaded Source

File details

Details for the file onecite-0.0.10.tar.gz.

File metadata

  • Download URL: onecite-0.0.10.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for onecite-0.0.10.tar.gz
Algorithm Hash digest
SHA256 080bcf1d0911deb19bee5b77f4ddb1e62b00c16fb6f446b29af4a4fe0b52cd13
MD5 d23a3f3bcc23afc46e10d3bcac7694c8
BLAKE2b-256 877b7f9f91c2f7a00212a1c7018fff98f060891b1c4ec47b44f12786db38ab9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page