CLI to insert number of citations into BibTeX entries, using OpenCitations
Project description
bibcites
Command-line utility which reads a BibTeX file, finds entries with a DOI, looks up the corresponding number of citations using OpenCitations, saves this number to the addendum
field of each entry, and writes results to a new BibTex file.
Installation
python -m pip install bibcites
should do the trick
Usage
Usage: bibcites [OPTIONS] BIBFILE
Reads a BibTeX file (BIBFILE), finds entries with a DOI, looks up the
corresponding number of citations using OpenCitations
(https://opencitations.net), saves this number to the 'addendum' field of
each entry, and writes results to a new BibTex file.
Optionally, using option -s, print out a list of entries with DOI sorted by
number of citations.
Options:
-o TEXT output BibTex file
-f TEXT format of text to save to 'addendum' field
-s print list sorted by cites
-v enable verbose output
-t TEXT only process entries of this type (may be used several times to
process several types)
-n INTEGER size limit for OpenCitations queries
--help Show this message and exit.
bibcites myfile.bib
will read the contents of myfile.bib
, look up all entries with a DOI
field in OpenCitations, append “[X citations]” to the addendum
field of each entry, and save the result to myfile_withcites.bib
- To get verbose output, use
-v
option. - To set a custom file name for the output BibTeX file, use the
-o <customfilename>
option. - To set a custom format to the
addendum
field, use the-f
option, e.g.,-f 'Cited {:s} times'
. Use the{:s}
specifier because the citation count is a string. - To print out a list of processed entries, sorted by decreasing number of citations, use the
-s
option. - To process only entries of certain types, use the
-t
option one or more times, e.g.,-t article -t book
. - To limit the size of OpenCitations queries, use
-n
option (default is-n 50
).
Contact
All questions and suggestions are welcome and should be directed at Mathieu Daëron.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bibcites-1.2.0.tar.gz
.
File metadata
- Download URL: bibcites-1.2.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69f87a6524334f40e9b32fae8a8ec7f74361c68721b35b1dcd0f712ab73e308e |
|
MD5 | 3d5608c710defcd55b134790b617f223 |
|
BLAKE2b-256 | 32ceee8d736718eb31b42ba5e9660a65397725a33f956782cf4a6b4231a52d56 |
File details
Details for the file bibcites-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: bibcites-1.2.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23f9c3dc4df733062bd8a908d03dcae8075f17b5ed1599a1e10e8ad6ce69f3a |
|
MD5 | ce48b456fe495a57241cc9a6f70c5858 |
|
BLAKE2b-256 | a82aa376dbaa874b122cd6ea48f22095fb21fe66b83718fa19f182e0a3536137 |