bibquick

Python-based citation export assistant from BibTeX database

https://github.com/ryo-fkushima/bibquick

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: scholar.google, pubmed.ncbi, ncbi.nlm.nih.gov
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.0%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Python-based citation export assistant from BibTeX database

Basic Info
  • Host: GitHub
  • Owner: Ryo-fkushima
  • License: mit
  • Language: TeX
  • Default Branch: main
  • Homepage:
  • Size: 538 KB
Statistics
  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 10
Created over 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

BibQuick: Citation export assistant (v1.1.4)

If you are struggling to prepare reference lists, try *BibQuick*!

BibQuick is a python-based citation export assistant. From a BibTeX file that includes bibliographic information, this program exports references with any citation style.

BibQuickは、BibTeXファイルから引用文献リストをテキストで出力するPythonツールです。普段文献管理ソフトを使用しない方々向けに、英語論文執筆時の引用文献リスト出力のみに特化して開発しました。

How to use

  1. Install python3 (>3.8 is recommended) to your computer and install the bibtexparser module.

  2. Make a new directory and put BibQuick.py and BibQuickParams.ini there.

  3. Prepare a BibTeX file of the bibliographic information (e.g., example_F24.bib) and put it anywhere accessible.

Once you have prepared the BibTeX database file, there are two options next: interactive mode and batch convert mode:

i. Interactive mode

  1. Edit CurrentParameters in BibQuickParams.ini as follows:
  • BibtexLocation should be a path to the BibTeX database file. Enter the full path here.
  • InteractiveExport is the option for exporting results. Set yes to get your results as a .txt file, or no to see results only in the console.
  • BatchConvert is the option to switch the interactive mode and batch convert mode. Here, set no.
  • AlphabeticalSorting is the option for alphabetical sorting of the output when you set BatchConvert=yes. Here, this value is irrelevant.
  • Other parameters determine the citation style. Copy any template in BibQuickParams.ini and paste it inside the CurrentParameters section.

For example: [CurrentParameters] BibtexLocation=/Users/fukushimaryou/BibQuick/demo/example_F24.bib InteractiveExport=no ; BatchConvert=no AlphabeticalSorting=yes ; CitationStyle=A,s,Y,ps,T,ps,J,cs,V,N,cs,P,cs,DL,p AddLetters= AuthorStyle=ScsI,cs,ps,p,aps ManyAuthors=yes ManyAuthorsOption=20,19,1 EtAlExpression=@ . . . @ YearPar=yes NoPar=yes PlainConvert=yes Template=APA

  1. Move into the directory via your console and run BibQuick.py, and follow the instructions appearing in the console. You can search papers by typing their contracted names (e.g., fukushima+2024) or their BibTeX IDs (e.g., @fukushima2024simulation; @ must be placed before the ID). If you set InteractiveExport=yes, you will finally get [Session No].txt in the directory.

ii. Batch convert from a .txt file

  1. Prepare a .txt file that includes the input list (e.g., batch_example.txt, batch_example2.txt) and put it anywhere accessible.

  2. Edit CurrentParameters in BibQuickParams.ini as follows:

  • BibtexLocation: same as above
  • InteractiveExport is irrelevant here.
  • Set BatchConvert as yes.
  • Set AlphabeticalSorting as yes or no according to your preference.
  • Other parameters: same as above

For example: [CurrentParameters] BibtexLocation=/Users/fukushimaryou/BibQuick/demo/example_F24.bib InteractiveExport=no ; BatchConvert=yes AlphabeticalSorting=yes ; CitationStyle=A,s,Y,ps,T,ps,J,cs,V,N,cs,P,cs,DL,p AddLetters= AuthorStyle=ScsI,cs,ps,p,aps ManyAuthors=yes ManyAuthorsOption=20,19,1 EtAlExpression=@ . . . @ YearPar=yes NoPar=yes PlainConvert=yes Template=APA

  1. Move into the directory via your console and run BibQuick.py. You will be asked the path to the input list. You can finally get [Session No].txt in the directory.

Tips for preparing the BibTeX database file

  • One option to get the BibTeX data is using the function of Google Scholar. You can copy the BibTeX information on the browser, and add it into your local .bib file. However, if you require DOIs, you'll have to access the journal website and add doi manually. Note: when you add a new field on each article, don't forget to put commas between different fields!

  • Another option is using some web service to get BibTeX from DOI (e.g., doi2bib).

  • From the BibTeX database, only bibliographic data of journals with author, year (as number), and journal fields will be successfully read. Other incomplete data will not be imported.

  • You can search papers by their BibTeX IDs. If you use PubMed to search papers, you can add PMID as a BibTeX ID when preparing the BibTeX database file. This enables to find papers by @PMID.

For example: @article{37707320, title = {Nanoscopic Elucidation of Spontaneous Self-Assembly of Severe Acute Respiratory Syndrome Coronavirus 2 (SARS-CoV-2) Open Reading Frame 6 (ORF6) Protein}, volume = {14}, ISSN = {1948-7185}, url = {http://dx.doi.org/10.1021/acs.jpclett.3c01440}, DOI = {10.1021/acs.jpclett.3c01440}, number = {38}, journal = {The Journal of Physical Chemistry Letters}, publisher = {American Chemical Society (ACS)}, author = {Nishide, Goro and Lim, Keesiang and Tamura, Maiki and Kobayashi, Akiko and Zhao, Qingci and Hazawa, Masaharu and Ando, Toshio and Nishida, Noritaka and Wong, Richard W.}, year = {2023}, month = sep, pages = {8385–8396} }

Tips for preparing the input list for batch convert

  • In the batch convert mode, this program will search any strings of [surname][year] (1 author), [surname1]&[surname2][year] (2 authors), and [surname]+[year] (>3 authors) from the input list. Any space in the search word should be removed beforehand.
  • In addition, any string starting from @ will be also read and used to search papers by their BibTeX IDs.

Note

  • This version doesn't support generating journal abbreviations, changing capitalization in the paper's title, or handling specific characters (e.g., Asian characters).
  • As for the citation style setting, please refer to CitationStyleManual.md.

Requirement

Required module: bibtexparser (tested with v1.4.1)

The script was tested on: Python 3.11.6/3.8.18 (macOS Ventura, MacBook Air 2020 with Intel CPU), and Python 3.9.13 (Windows 11, Minisforum EliteMini X500 with AMD Ryzen CPU).

Author

Ryo Fukushima (rpifukushima@gmail.com)

Updates

Jan 02, 2025 (v1.1.4): Bug fixed. Surnames with apostrophes are now correctly read in the batch convert mode.

Nov 25, 2024 (v1.1.3): Bug fixed for the AlphabeticalSorting option and special characters were additionaly implemented.

Nov 07, 2024 (v1.1.2): Bug fixed for Windows OS and special characters were additionaly implemented.

Sep 17, 2024 (v1.1.1): Bug fixed. Surnames with a hyphen are now correctly read in the batch convert mode.

Sep 12, 2024 (v1.1.0): ID Search function was implemented. New blocks (M, ID) were added.

Sep 07, 2024 (v1.0.1): A few special characters were additionally implemented.

Sep 05, 2024: v1.0.0 was released.

Owner

  • Login: Ryo-fkushima
  • Kind: user

Citation (CitationStyleManual.md)

# **Citation style manual (for BibQuick v1.1.x)**

## Graphical abstract
<img width = "800" src = "./graphicalabstract.png">

## 1. Overall structure
The overall structure of citation is designated mainly by the `CitationStyle` parameter. 

Individual blocks (abbreviated by uppercase letters) of the bibliographic information and some signs (abbreviated by lowercase letters) should be placed in order as a comma-delimited style. **Don't insert any space between the items!**

if you need, you can add any letters by using the `AddLetters` parameter. Type strings as a comma-delimited style, and type the non-negative integer (e.g., 0, 1, 2, ...) in `CitationStyle` to set the locations of the individual items.

### Block
* A: author
* Y: year
* T: title
* J: journal
* V: volume
* N: number
* P: pages
* U: url
* D: doi (raw data)
* DD: doi (after doi:)
* DL: doi (full link)
* M: month
* ID: BibTeX ID

### Sign
* s: space ( )
* p: period (.)
* c: comma (,)
* cl: colon (:)
* sc: semicolon (;)
* ps: period + space (. )
* cs: comma + space (, )
* cls: colon + space (: )
* scs: semicolon + space (; )
* q: single quotation (')
* dq: double quotation (")
* ap: ampersand (&)
* bsap: backslash + ampersand (\\&) (for LaTeX)
* a: and (and)
* aps: ampersand + space (& )
* bsaps: backslash + ampersand + space (\\& ) (for LaTeX)
* as: and + space (and )
* n: none ()

## 2. Further setting

1. Author block

   Author names' expression is controlled by the parameters of `AuthorStyle`, `ManyAuthors`, `ManyAuthorsOption`, and `EtAlExpression`.

   * `AuthorStyle` is composed of 5 items (comma-delimited; *X1*,*x2*,*x3*,*x4*,*x5*). *X1* should be either of {S, SsF, ScsF, SsI, ScsI, FsS, FcsS, IsS, IcsS} to set a person's name expression. The uppercase letters (S, F, I) respectively mean surname, firstname, and initialized firstname. For the meaning of the lowercase letters, please refer to the sign list above. *x2* is a parameter to set the delimiter between authors. *x3* is the delimiter between multiple initial letters, and *x4* is the sign placed at the last of the initialized firstname of each person. *x5* is the sign before the last author's name. *x2*-*x5* should be chosen from the sign list above. 
  
   * If `ManyAuthors=yes`, the following settings for many authors will be applied.
   * `ManyAuthorsOption` is composed of 3 non-negative integers (comma-delimited; *n1*,*n2*,*n3*). If the total number of the authors is more than *n1*, only the first *n2* authors' names will be displayed. *n3* should be 1 or 0, and if *n3* = 1, the last author's name will also appear.
   * `EtAlExpression` is a string appearing just before the last author (if *n3* = 1) or in the end of the author block (if *n3* = 0). (If *x5* in `AuthorStyle` has any value, the designated sign by *x5* will be neglected.) **Enclosing the string with @ is recommended so that any space in it can be correctly reflected.**

1. Year and number blocks
   
   `YearPar` and `NoPar` should be `yes` if you need parentheses for the year and number blocks, respectively (e.g., (2024)).
   

## 3. Other parameters

If `PlainConvert=yes`, all the letters will be converted from TeX-specific expression into the plain text.

`Template` is just a name tag for the citation style template. This appears in the console at the beginning of each session.


## Note

- There are two options for the doi block (DD, DL) to unambiguously fix the doi style. The DL option automatically convert http://dx.doi.org/ into https://doi.org/.
- From **BibQuickParams.ini**, only parameter values in the `[CurrentParameters]` section will be imported. You can save your original template in **BibQuickParams.ini** by setting another section name.


## Author

Ryo Fukushima (rpifukushima@gmail.com)


GitHub Events

Total
  • Release event: 3
  • Push event: 4
  • Pull request event: 6
  • Create event: 3
Last Year
  • Release event: 3
  • Push event: 4
  • Pull request event: 6
  • Create event: 3