Update doc
This commit is contained in:
parent
c3c40ef0fc
commit
6714d56ea5
13
README.md
13
README.md
@ -62,8 +62,9 @@ sudo pip install arxiv2bib requesocks bibtexparser pyPDF2 isbntools
|
|||||||
```
|
```
|
||||||
(replace pip by pip2 if your distribution ships python3 by default)
|
(replace pip by pip2 if your distribution ships python3 by default)
|
||||||
* Install `pdftotext` (provided by Xpdf) and `djvulibre` _via_ your package manager or the way you want
|
* Install `pdftotext` (provided by Xpdf) and `djvulibre` _via_ your package manager or the way you want
|
||||||
* Run the script to initialize the conf in `~/.config/bmc.json`.
|
* Run the script to initialize the conf in `~/.config/bmc/bmc.json`.
|
||||||
* Customize the configuration by editing `~/.config/bmc.json` according to your needs. A documentation of the available options can be found in file `config.py`.
|
* Customize the configuration by editing `~/.config/bmc/bmc.json` according to your needs. A documentation of the available options can be found in file `config.py`.
|
||||||
|
* _Power users :_ Add your custom masks in `~/.config/bmc/masks.py`.
|
||||||
|
|
||||||
*Note:* To update the script, just run `git pull` in the script dir.
|
*Note:* To update the script, just run `git pull` in the script dir.
|
||||||
|
|
||||||
@ -73,15 +74,15 @@ sudo pip install arxiv2bib requesocks bibtexparser pyPDF2 isbntools
|
|||||||
|
|
||||||
Run `./bmc.py import PATH_TO_FILE [article|book]`. `[article|book]` is an optional argument (article or book) to search only for DOI or ISBN and thus, speed up the import.
|
Run `./bmc.py import PATH_TO_FILE [article|book]`. `[article|book]` is an optional argument (article or book) to search only for DOI or ISBN and thus, speed up the import.
|
||||||
|
|
||||||
It will get automatically the bibtex entry corresponding to the document, and you will be prompted for confirmation. It will then copy the file to your papers dir, renaming it according to the specified mask in `~/.config/bmc.json`.
|
It will get automatically the bibtex entry corresponding to the document, and you will be prompted for confirmation. It will then copy the file to your papers dir, renaming it according to the specified mask in `~/.config/bmc/bmc.json`.
|
||||||
|
|
||||||
### To download a PDF / Djvu file
|
### To download a PDF / Djvu file
|
||||||
|
|
||||||
Run `./bmc.py download URL_TO_PDF [article|book]`, where `[article|book]` (article or book) is again a parameter to specify to search only for DOI or ISBN only, and thus speed up the import. The `URL_TO_PDF` parameter should be a direct link to the PDF file (meaning it should be the link to the pdf page, which may have an authentication portal and not the page with abstract on many publishers websites).
|
Run `./bmc.py download URL_TO_PDF [article|book]`, where `[article|book]` (article or book) is again a parameter to specify to search only for DOI or ISBN only, and thus speed up the import. The `URL_TO_PDF` parameter should be a direct link to the PDF file (meaning it should be the link to the pdf page, which may have an authentication portal and not the page with abstract on many publishers websites).
|
||||||
|
|
||||||
The script will try to download the file with the proxies specified in `~/.config/bmc.json` until it manages to get the file, or runs out of available proxies.
|
The script will try to download the file with the proxies specified in `~/.config/bmc/bmc.json` until it manages to get the file, or runs out of available proxies.
|
||||||
|
|
||||||
It will get automatically the bibtex entry corresponding to the document, and you will be prompted for confirmation. It will then put the file in your papers dir, renaming it according to the specified mask in `~/.config/bmc.json`.
|
It will get automatically the bibtex entry corresponding to the document, and you will be prompted for confirmation. It will then put the file in your papers dir, renaming it according to the specified mask in `~/.config/bmc/bmc.json`.
|
||||||
|
|
||||||
### Delete an entry
|
### Delete an entry
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ When you import a long article without any DOI or ISBN, the script will process
|
|||||||
|
|
||||||
### Data storage
|
### Data storage
|
||||||
|
|
||||||
All your documents will be stored in the papers dir specified in `~/.config/bmc.json`. All the bibtex entries will be added to the `index.bib` file. You should **not** add entries to this file (but you can edit existing entries without any problem), as this will break synchronization between documents in papers dir and the index. If you do so, you can resync the index file with `./bmc.py resync`.
|
All your documents will be stored in the papers dir specified in `~/.config/bmc/bmc.json`. All the bibtex entries will be added to the `index.bib` file. You should **not** add entries to this file (but you can edit existing entries without any problem), as this will break synchronization between documents in papers dir and the index. If you do so, you can resync the index file with `./bmc.py resync`.
|
||||||
|
|
||||||
The resync option will check that all bibtex entries have a corresponding file and all file have a corresponding bibtex entry. It will prompt you what to do for unmatched entries.
|
The resync option will check that all bibtex entries have a corresponding file and all file have a corresponding bibtex entry. It will prompt you what to do for unmatched entries.
|
||||||
|
|
||||||
|
@ -6,12 +6,10 @@ import json
|
|||||||
import sys
|
import sys
|
||||||
import tools
|
import tools
|
||||||
|
|
||||||
# List of available options :
|
# List of available options (in ~/.config/bmc/bmc.json file):
|
||||||
# * folder : folder in which papers are stored
|
# * folder : folder in which papers are stored
|
||||||
# * proxies : list of proxies to use, e.g. ['', "socks5://localhost:4711"]
|
# * proxies : list of proxies to use, e.g. ['', "socks5://localhost:4711"]
|
||||||
# * format_articles, format_books : masks to rename files
|
# * format_articles, format_books : masks to rename files
|
||||||
# * format_custom : list of lambda functions to apply to rename files.
|
|
||||||
# E.g. : format_custom = [lambda x: x.replace('test', 'some_expr')]
|
|
||||||
# * ignore_fields : list of fields to ignore when returning bibtex
|
# * ignore_fields : list of fields to ignore when returning bibtex
|
||||||
|
|
||||||
# Available masks to rename files are
|
# Available masks to rename files are
|
||||||
@ -23,6 +21,10 @@ import tools
|
|||||||
# %a = authors
|
# %a = authors
|
||||||
# %v = arXiv version (e.g. '-v1') or nothing if not an arXiv paper
|
# %v = arXiv version (e.g. '-v1') or nothing if not an arXiv paper
|
||||||
|
|
||||||
|
# You can add your custom masks to rename files by adding functions in
|
||||||
|
# ~/.config/masks.py.
|
||||||
|
# E.g. : def f(x): x.replace('test', 'some_expr')
|
||||||
|
|
||||||
|
|
||||||
def make_sure_path_exists(path):
|
def make_sure_path_exists(path):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user