Skip to main content

This is a project to get bibtex from CrossRef and Google Scholar

Project description

get-bibtex

A Python tool for fetching citations from multiple sources.

PyPI version Python Version License: MIT

中文文档

Features

  • Multiple data sources (CrossRef, DBLP, Google Scholar)
  • Smart workflow and fallback mechanism
  • Batch processing
  • Detailed error handling and logging

Quick Start

Installation

pip install get-bibtex

Basic Usage

from apiModels import CrossRefBibTeX

# Using CrossRef
fetcher = CrossRefBibTeX(email="your.email@example.com")
bibtex = fetcher.get_bibtex("10.3390/s22197244")  # FedMSA paper
print(bibtex)

Using Workflow

from apiModels import WorkflowBuilder, CrossRefBibTeX, DBLPBibTeX

# Create workflow
workflow = WorkflowBuilder()
workflow.add_fetcher(CrossRefBibTeX(email="your.email@example.com"))
workflow.add_fetcher(DBLPBibTeX())

# Batch processing
queries = [
    "ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks",
    "CBAM: Convolutional Block Attention Module"
]
results = workflow.get_multiple_bibtex(queries)

Using Google Scholar

Getting SerpAPI Key

  1. Visit SerpAPI and sign up
  2. Get API key from Dashboard
  3. Initialize Google Scholar fetcher with API key
from apiModels import GoogleScholarBibTeX

fetcher = GoogleScholarBibTeX(api_key="your-serpapi-key")
bibtex = fetcher.get_bibtex("Attention Is All You Need")
print(bibtex)

Notes

  • Free plan limited to 100 searches per month
  • Use environment variables for API key
  • Prefer CrossRef and DBLP when possible

Examples

Fetching Attention Mechanism Papers

from apiModels import CrossRefBibTeX

fetcher = CrossRefBibTeX(email="your.email@example.com")

# Get ECA-Net paper citation
bibtex = fetcher.get_bibtex("10.1109/cvpr42600.2020.01155")
print(bibtex)

File Processing

from apiModels import WorkflowBuilder

workflow = WorkflowBuilder()
workflow.add_fetcher(CrossRefBibTeX(email="your.email@example.com"))
workflow.add_fetcher(DBLPBibTeX())

# Read queries from file and save results
workflow.process_file("papers.txt", "references.bib")

Documentation

For detailed documentation, see blog_cn.md

Contributing

Pull requests and issues are welcome!

License

MIT

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

get_bibtex-2.0.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

get_bibtex-2.0.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file get_bibtex-2.0.0.tar.gz.

File metadata

  • Download URL: get_bibtex-2.0.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11

File hashes

Hashes for get_bibtex-2.0.0.tar.gz
Algorithm Hash digest
SHA256 f40bb8faf3eeab4825164f8d96c89daa1988c29ed2624ec1d3ea9ef95eb7b46e
MD5 7eaea7639e7ea13f00f6584625d7acfd
BLAKE2b-256 253209ec57957c203e0f0cf3bcfb4d55c3ce1c4e19f92a6fe4c2d89da0502fcc

See more details on using hashes here.

File details

Details for the file get_bibtex-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: get_bibtex-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11

File hashes

Hashes for get_bibtex-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 633dac4e01bdeddb1bd7141fb897717889aa6bce1129e3d6785751b13231a619
MD5 28f784f052b816758e53d7f516b81c46
BLAKE2b-256 b06acecee45b23ee1c5d03b577d57110a2f872ae4b602419c3097eaadbb8c843

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