Personal notes on creating and using coBib
Installation using pip
.
pip install cobib
I installed using pipx
as I wanted it to be available globally.
pipx install cobib
Initialized with git
integration enabled.
cobib init --git
I could not find the config.py
at ~/.config/cobib/
so I downloaded example.py
from coBib documentaion page and copied it to the above location.
To enable git
in the config.py
set config.database.git
to True
.
# coBib can integrate with `git` in order to automatically track the history of your database.
# However, by default, this option is disabled. If you want to enable it, simply change the
# following setting to `True` and initialize your database with `cobib init --git`.
# Warning: Before enabling this setting you must ensure that you have set up git properly by setting
# your name and email address.
config.database.git = True
I wanted to change the coBib
download location and database location too. In the config.py
file change the path in config.database.file
.
# DATABASE
# These settings affect the database in general.
# You can specify the path to the database YAML file. You can use a `~` to represent your `$HOME`
# directory.
config.database.file = "~/cobib/database.yaml"
To change the download location, change the config.utils.file_downloader.default_location
. path to the desired location.
# UTILS
# You can specify the default download location for associated files.
config.utils.file_downloader.default_location = "~/cobib"
Then create the folder and the file:
mkdir ~/cobib
cd cobib
touch database.yaml
The directory tree:
cobib
├── database.yaml
├── lazarte_2015.pdf
├── lazarte_2015.yaml
├── sabatini_2005.bib
└── sabatini_2005.pdf
The database.yaml
was an empty file.
I wanted to add an entry to the database.yaml
file and associate a file to it. So, since I am a geotechnical engineer, I downloaded two reference manuals.
- Soil Nail Wall - Reference Manual by Lazarte et al. 2015.
I did not have a bibtex file, a
.bib
file for the soil wall reference manual so I created acoBib
.yaml
file and saved it aslazarte_2015.yaml
. The associated.pdf
was namedlazarte_2015.pdf
.
The contents of the lazarte_2015.yaml
file:
---
lazarte_2015:
ENTRYTYPE: techreport
author: C. A. Lazarte and H. Robinson and J. E. G{\'o}mez and A. Baxter and A. Cadden and R. Berg
title: Soil Nail Walls - Reference Manual
number: FHWA-NHI-14-007 GEC No. 7
keywords:
- FHWA
- NHI
- GEC
year: 2015
...
The ---
and the ...
are maybe entry start and end indicators, the .yaml
file was formatted such in the test
folder.
To add this item and the associated .pdf
file to database.yaml
.
cobib add --yaml lazarte_2015.yaml -f lazarte_2015.pdf
The contents of the database.yaml
after the above command:
---
lazarte_2015:
ENTRYTYPE: techreport
author: C. A. Lazarte and H. Robinson and J. E. G{\'o}mez and A. Baxter and A. Cadden
and R. Berg
file:
- ~/cobib/lazarte_2015.pdf
keywords:
- FHWA
- NHI
- GEC
number: FHWA-NHI-14-007 GEC No. 7
title: Soil Nail Walls - Reference Manual
year: 2015
...
Here we can see it added the file
field and changed the order of the fields.
- Micropile Design and Construction - Reference Manual by Sabatini et al. 2005.
I had a
bibtex
file for this one. It was generated byZotero Better Bibtex
plugin.
@techreport{sabatinietal2005,
title = {Micropile Design and Construction Reference Manual},
author = {Sabatini, P. J. and Tanyu, B. and Armour, T. and Groneck, P. and Keeley, J.},
year = {2005},
number = {FHWA NHI-05-039, NHI Course No. 132078},
langid = {english},
keywords = {FHWA, NHI},
file = {sabatini_2005.pdf}
}
To add an entry for sabatini_2005
in the database.yaml
and associated .pdf
file to that entry:
cobib add -b sabatini_2005.bib` -f sabatini_2015.pdf
The contents of database.yaml
:
---
lazarte_2015:
ENTRYTYPE: techreport
author: C. A. Lazarte and H. Robinson and J. E. G{\'o}mez and A. Baxter and A. Cadden
and R. Berg
file:
- ~/cobib/lazarte_2015.pdf
keywords:
- FHWA
- NHI
- GEC 7
number: FHWA-NHI-14-007 GEC No. 7
title: Soil Nail Walls - Reference Manual
year: 2015
...
---
sabatini_2005:
ENTRYTYPE: techreport
author: Sabatini, P. J. and Tanyu, B. and Armour, T. and Groneck, P. and Keeley,
J.
file:
- ~/cobib/sabatini_2005.pdf
keywords:
- FHWA
- NHI
number: FHWA NHI-05-039, NHI Course No. 132078
title: Micropile Design and Construction Reference Manual
year: 2005
...