papers-cli 2.3.1__tar.gz → 2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {papers-cli-2.3.1 → papers_cli-2.5}/.github/workflows/tests.yml +1 -1
- papers_cli-2.5/.gitignore +15 -0
- {papers-cli-2.3.1/papers_cli.egg-info → papers_cli-2.5}/PKG-INFO +79 -57
- papers-cli-2.3.1/PKG-INFO → papers_cli-2.5/README.md +70 -67
- papers_cli-2.5/papers/__main__.py +1248 -0
- papers_cli-2.5/papers/_version.py +16 -0
- papers_cli-2.5/papers/bib.py +804 -0
- papers_cli-2.5/papers/config.py +270 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers/duplicate.py +4 -4
- {papers-cli-2.3.1 → papers_cli-2.5}/papers/extract.py +5 -3
- {papers-cli-2.3.1 → papers_cli-2.5}/papers/filename.py +42 -18
- papers_cli-2.5/papers/utils.py +187 -0
- papers-cli-2.3.1/README.md → papers_cli-2.5/papers_cli.egg-info/PKG-INFO +89 -54
- {papers-cli-2.3.1 → papers_cli-2.5}/papers_cli.egg-info/SOURCES.txt +15 -3
- papers_cli-2.5/papers_cli.egg-info/entry_points.txt +2 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/pyproject.toml +33 -14
- {papers-cli-2.3.1 → papers_cli-2.5}/requirements.txt +1 -1
- papers_cli-2.5/tests/__init__.py +5 -0
- papers_cli-2.5/tests/common.py +290 -0
- papers_cli-2.5/tests/config.py +22 -0
- papers_cli-2.5/tests/test_add.py +467 -0
- papers_cli-2.5/tests/test_biblio.py +21 -0
- papers_cli-2.5/tests/test_duplicates.py +361 -0
- papers_cli-2.5/tests/test_encoding.py +41 -0
- papers_cli-2.5/tests/test_extract.py +25 -0
- papers_cli-2.5/tests/test_filecheck.py +48 -0
- papers_cli-2.5/tests/test_install.py +363 -0
- papers_cli-2.5/tests/test_list.py +168 -0
- papers_cli-2.5/tests/test_misc.py +0 -0
- papers_cli-2.5/tests/test_undo.py +438 -0
- papers-cli-2.3.1/.gitignore +0 -8
- papers-cli-2.3.1/MANIFEST.in +0 -3
- papers-cli-2.3.1/papers/_version.py +0 -4
- papers-cli-2.3.1/papers/bib.py +0 -1601
- papers-cli-2.3.1/papers/config.py +0 -370
- papers-cli-2.3.1/papers_cli.egg-info/entry_points.txt +0 -2
- papers-cli-2.3.1/tests/test_papers.py +0 -928
- papers-cli-2.3.1/versioneer.py +0 -1817
- {papers-cli-2.3.1 → papers_cli-2.5}/.gitattributes +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/LICENSE +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers/__init__.py +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers/encoding.py +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers/latexenc.py +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers_cli.egg-info/dependency_links.txt +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers_cli.egg-info/requires.txt +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/papers_cli.egg-info/top_level.txt +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/setup.cfg +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/setup.py +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/tests/download.py +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/tests/downloadedpapers/.gitignore +0 -0
- {papers-cli-2.3.1 → papers_cli-2.5}/tests/downloadedpapers/bg-8-515-2011.txt +0 -0
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: papers-cli
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.5
|
|
4
4
|
Summary: utilities to keep your PDF library organized
|
|
5
5
|
Author-email: Mahé Perrette <mahe.perrette@gmail.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Project-URL: homepage, https://github.com/perrette/papers
|
|
8
8
|
Keywords: bibtex,references,bibliography
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.9
|
|
11
11
|
Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
|
13
|
+
Requires-Dist: unidecode
|
|
14
|
+
Requires-Dist: crossrefapi
|
|
15
|
+
Requires-Dist: bibtexparser
|
|
16
|
+
Requires-Dist: scholarly
|
|
17
|
+
Requires-Dist: rapidfuzz
|
|
18
|
+
Requires-Dist: normality
|
|
13
19
|
|
|
14
20
|
[](https://github.com/perrette/papers/actions)
|
|
15
|
-
[]()
|
|
16
21
|
[]()
|
|
17
22
|
[]()
|
|
18
23
|
[]()
|
|
24
|
+
[]()
|
|
25
|
+
[]()
|
|
19
26
|
|
|
20
27
|
# papers
|
|
21
28
|
|
|
22
29
|
Command-line tool to manage bibliography (pdfs + bibtex)
|
|
23
30
|
|
|
24
|
-
|
|
31
|
+
Disclaimer: This tool requires further development and testing, and might never be fully production-ready (contributors welcome). \
|
|
32
|
+
That said, it is becoming useful :)
|
|
25
33
|
|
|
26
34
|
## Motivation
|
|
27
35
|
|
|
28
36
|
This project is an attempt to create a light-weight,
|
|
29
|
-
command-line bibliography
|
|
37
|
+
command-line bibliography management tool. Aims:
|
|
30
38
|
|
|
31
39
|
- maintain a PDF library (with appropriate naming)
|
|
32
40
|
- maintain one or several bibtex-compatible collections, linked to PDFs
|
|
@@ -35,13 +43,13 @@ command-line bibliography managenent tool. Aims:
|
|
|
35
43
|
|
|
36
44
|
## Dependencies
|
|
37
45
|
|
|
38
|
-
- python 3.
|
|
46
|
+
- python 3.9+
|
|
39
47
|
- [poppler-utils](https://en.wikipedia.org/wiki/Poppler_(software)) (only:`pdftotext`): convert PDF to text for parsing
|
|
40
|
-
- [bibtexparser
|
|
41
|
-
- [crossrefapi
|
|
42
|
-
- [scholarly
|
|
43
|
-
- [rapidfuzz
|
|
44
|
-
- [unidecode
|
|
48
|
+
- [bibtexparser](https://bibtexparser.readthedocs.io) : parse bibtex files
|
|
49
|
+
- [crossrefapi](https://github.com/fabiobatalha/crossrefapi) : make polite requests to crossref API
|
|
50
|
+
- [scholarly](https://github.com/OrganicIrradiation/scholarly) : interface for google scholar
|
|
51
|
+
- [rapidfuzz](https://github.com/rhasspy/rapidfuzz) : calculate score to sort crossref requests
|
|
52
|
+
- [unidecode](https://github.com/avian2/unidecode) : replace unicode with ascii equivalent
|
|
45
53
|
|
|
46
54
|
## Install
|
|
47
55
|
|
|
@@ -102,15 +110,42 @@ If you already know the DOI of a PDF, and don't want to gamble the fulltext sear
|
|
|
102
110
|
The `add` command above also works without any PDF (create a bibtex entry without file attachment).
|
|
103
111
|
|
|
104
112
|
papers add --doi 10.5194/esd-4-11-2013 --bibtex papers.bib
|
|
105
|
-
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Add entry without DOI from bibtex library + PDF
|
|
116
|
+
|
|
117
|
+
Some old files don't have a DOI. Best is to add the entry from its bibtex:
|
|
118
|
+
|
|
119
|
+
papers add entry.bib --attachment esd-4-11-2013.pdf
|
|
120
|
+
|
|
121
|
+
|
|
106
122
|
### List entries (and edit etc...)
|
|
107
123
|
|
|
108
|
-
|
|
124
|
+
Pretty listing (-1 or -l for one-liner listing, otherwise plain bibtex):
|
|
125
|
+
|
|
126
|
+
$> papers list -1
|
|
109
127
|
Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1)
|
|
110
128
|
|
|
111
|
-
|
|
129
|
+
Search with any number of keywords:
|
|
130
|
+
|
|
131
|
+
$> papers list perrette scaling approach sea level -1
|
|
132
|
+
... (short list)
|
|
133
|
+
$> papers list perrette scaling approach sea level --any -1
|
|
134
|
+
... (long list)
|
|
135
|
+
$> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level -1
|
|
136
|
+
... (precise list)
|
|
137
|
+
|
|
138
|
+
Add tags to view papers by topic:
|
|
139
|
+
|
|
140
|
+
$> papers list perrette2013 --add-tag sea-level projections -1
|
|
141
|
+
...
|
|
142
|
+
$> papers list --tag sea-level projections -1
|
|
143
|
+
Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1, sea-level | projections )
|
|
144
|
+
|
|
145
|
+
`papers list` is a powerful command, inspired from unix's `find` and `grep`.
|
|
146
|
+
|
|
112
147
|
It lets you search in your bibtex in a typical manner (including a number of special flags such as `--duplicates`, `--review-required`, `--broken-file`...),
|
|
113
|
-
then output the result in a number of formats (one-liner, raw bibtex, keys-only, selected fields) or let you perform actions on it (currently `--edit`, `--delete`).
|
|
148
|
+
then output the result in a number of formats (one-liner, raw bibtex, keys-only, selected fields) or let you perform actions on it (currently `--edit`, `--delete`, `--add-tag`, `--fetch`).
|
|
114
149
|
For instance, it is possible to manually merge the duplicates with:
|
|
115
150
|
|
|
116
151
|
$> papers list --duplicates --edit
|
|
@@ -157,7 +192,6 @@ The same template and modifiers system applies to the bibtex key generation by r
|
|
|
157
192
|
|
|
158
193
|
In the common case where the bibtex (`--bibtex`), files directory (`--filesdir`), and name and key formats (e.g. `--name-template`) do not change, it is convenient to
|
|
159
194
|
(install)[#install-make-bibtex-and-files-directory-persistent] `papers`.
|
|
160
|
-
Install comes with the option to git-track any change to the bibtex file (`--git`) options.
|
|
161
195
|
|
|
162
196
|
|
|
163
197
|
### install: make bibtex and files directory persistent
|
|
@@ -187,11 +221,10 @@ Sometimes it is desirable to have separate configurations. In that case a local
|
|
|
187
221
|
Bibtex file name [default to existing: papers.bib] [Enter/Yes/No]:
|
|
188
222
|
Files folder [default to new: papers] [Enter/Yes/No]: pdfs
|
|
189
223
|
papers configuration
|
|
190
|
-
* configuration file: .
|
|
224
|
+
* configuration file: papersconfig.json
|
|
191
225
|
* cache directory: /home/perrette/.cache/papers
|
|
192
226
|
* absolute paths: True
|
|
193
227
|
* git-tracked: False
|
|
194
|
-
* git-lfs tracked: False
|
|
195
228
|
* files directory: pdfs (90 files, 337.4 MB)
|
|
196
229
|
* bibtex: papers.bib (82 entries)
|
|
197
230
|
|
|
@@ -216,7 +249,7 @@ and remove the configuration file by hand (`rm ...`). Or use `papers uninstall`
|
|
|
216
249
|
|
|
217
250
|
papers uninstall
|
|
218
251
|
|
|
219
|
-
You may repeat `papers status -v` and cleaning until a
|
|
252
|
+
You may repeat `papers status -v` and cleaning until a satisfying state is reached, or remove all config files recursively up to (and including) global install:
|
|
220
253
|
|
|
221
254
|
papers uninstall --recursive
|
|
222
255
|
|
|
@@ -224,7 +257,7 @@ You may repeat `papers status -v` and cleaning until a satistfying state is reac
|
|
|
224
257
|
### Relative versus Absolute path
|
|
225
258
|
|
|
226
259
|
By default, the file paths in the bibtex are stored as absolute paths (starting with `/`), except for local installs.
|
|
227
|
-
It is possible to change this
|
|
260
|
+
It is possible to change this behaviour explicitly during install or in a case by case basis with `--relative-paths` or `--absolute-paths` options.
|
|
228
261
|
With or without install.
|
|
229
262
|
|
|
230
263
|
|
|
@@ -237,7 +270,7 @@ Simple cases are:
|
|
|
237
270
|
In any other cases, you risk breaking the file links.
|
|
238
271
|
|
|
239
272
|
Papers tries to be as little opinionated as possible about how files are organized, and so it relies on your own judgement and use case.
|
|
240
|
-
When loading a bibtex, it always
|
|
273
|
+
When loading a bibtex, it always interprete relative file links as being relative to the bibtex file.
|
|
241
274
|
When saving a bibtex, it will save file links accordingly to the default setting path (usually absolute, unless local install or unless you specify otherwise).
|
|
242
275
|
|
|
243
276
|
In any case, the following set of commands will always work provided the initial file links are valid (optional parameters in brackets):
|
|
@@ -278,25 +311,34 @@ That command is also convenient to check on what's actually tracked and what is
|
|
|
278
311
|
|
|
279
312
|
Install comes with the option to git-track any change to the bibtex file (`--git`) options.
|
|
280
313
|
|
|
281
|
-
$> papers install --bibtex papers.bib --filesdir files --git
|
|
314
|
+
$> papers install --bibtex papers.bib --filesdir files --git [ --git-lfs ]
|
|
282
315
|
|
|
283
316
|
From now on, every change to the library will result in an automatic git commit.
|
|
284
317
|
And `papers git ...` command will work just as `git ...` executed from the bibtex directory.
|
|
285
318
|
E.g. `papers git add origin *REMOTE URL*`; `papers git lfs track files`; `papers git add files`; `papers git push`
|
|
286
|
-
Note this is an experimental feature at this stage, with potential for improvement.
|
|
287
319
|
|
|
288
|
-
|
|
320
|
+
If `--git-lfs` is passed, the files will be backed-up along with the bibtex.
|
|
321
|
+
Under the hood, bibtex and files (if applicable) are copied (hard-linked) to a back-up directory.
|
|
322
|
+
Details are described in [issue 51](https://github.com/perrette/papers/issues/51).
|
|
323
|
+
|
|
324
|
+
In local installs, backup occurs in `.papers/`. In global installs, defaults to `~/.local/.share/papers`.
|
|
325
|
+
Type `papers status -v` to find out.
|
|
326
|
+
|
|
327
|
+
For local install that are already git-tracked, the feature remains useful as it is the basis for `papers undo` and `papers redo`.
|
|
328
|
+
You might want to add `.papers` to your .gitignore to avoid messing up with your larger project.
|
|
329
|
+
|
|
330
|
+
This feature is experimental.
|
|
289
331
|
|
|
290
332
|
|
|
291
|
-
### undo
|
|
333
|
+
### undo / redo
|
|
292
334
|
|
|
293
335
|
Did a `papers add` and are unhappy with the result?
|
|
294
336
|
|
|
295
337
|
papers undo
|
|
296
338
|
|
|
297
339
|
will revert to the previous version. If repeated, it will jump back and forth between latest and before-latest.
|
|
298
|
-
|
|
299
|
-
|
|
340
|
+
Unless papers is installed with --git option, in which case `papers undo` and `papers redo` will have essentially infinite memory
|
|
341
|
+
(doing undos and making a new commit risk loosing history, unless you keep track of the commit).
|
|
300
342
|
|
|
301
343
|
|
|
302
344
|
Consult inline help for more detailed documentation!
|
|
@@ -315,10 +357,10 @@ Current features
|
|
|
315
357
|
- some support for attachment
|
|
316
358
|
- merging (`papers check --duplicates ...`)
|
|
317
359
|
- fix entries (`papers check --format-name --encoding unicode --fix-doi --fix-key ...`)
|
|
318
|
-
- undo command (`papers undo`)
|
|
319
360
|
- configuration file with default bibtex and files directory (`papers install --bibtex BIB --filesdir DIR ...`)
|
|
320
|
-
- integration with git
|
|
321
|
-
-
|
|
361
|
+
- integration with git
|
|
362
|
+
- undo/redo command (`papers undo / redo`)
|
|
363
|
+
- display / search / list entries : format as bibtex or key or whatever (`papers list ... [--key-only, -l]`)
|
|
322
364
|
- list + edit or remove entry by key or else (`papers list ... [--edit, --delete]`)
|
|
323
365
|
- fix broken PDF links (`papers filecheck ...`):
|
|
324
366
|
- remove duplicate file names (always) or file copies (`--hash-check`)
|
|
@@ -328,25 +370,12 @@ Current features
|
|
|
328
370
|
- latex characters, e.g. `{\_}` or `{\'{e}}` replaced with unicode
|
|
329
371
|
|
|
330
372
|
|
|
331
|
-
Feature ideas (TODO: organize as issues for discussion)
|
|
332
|
-
-------------
|
|
333
|
-
- `papers encode`: text encoding in bibtex entries (latex, unicode, ascii)
|
|
334
|
-
- additional checks on entries:
|
|
335
|
-
- duplicate-authors and more like [here](https://github.com/tdegeus/bibparse)
|
|
336
|
-
- support collections (distinct bibtex entries, same files directory)
|
|
337
|
-
- or maybe more like ´papers update-from OTHER.bib´ to update changes based on DOI / key
|
|
338
|
-
- could also use git branches / merge
|
|
339
|
-
- associate bibtex to existing pdf collection (to move library location)
|
|
340
|
-
- fetch PDFs for existing entries? Bindings with [sopaper](https://github.com/ppwwyyxx/SoPaper)
|
|
341
|
-
- lazy loading of modules (optimization)
|
|
342
|
-
|
|
343
|
-
|
|
344
373
|
Tests
|
|
345
374
|
-----
|
|
346
|
-
Test coverage
|
|
375
|
+
Test coverage is improving (now 80%)
|
|
347
376
|
|
|
348
377
|
Currently covers:
|
|
349
|
-
- `papers extract`
|
|
378
|
+
- `papers extract` (test on a handful of PDFs)
|
|
350
379
|
- parse pdf DOI
|
|
351
380
|
- fetch bibtex on crossref based on DOI
|
|
352
381
|
- fetch bibtex on crossref based fulltext search
|
|
@@ -355,21 +384,14 @@ Currently covers:
|
|
|
355
384
|
- add entry and manage conflict
|
|
356
385
|
- add pdf file, bibtex, directory
|
|
357
386
|
- add one pdf file with attachment (beta, API will change)
|
|
358
|
-
- `papers check --duplicates`
|
|
359
387
|
- conflict resolution
|
|
360
|
-
- `papers install`
|
|
388
|
+
- `papers install`
|
|
361
389
|
- internals:
|
|
362
390
|
- duplicate test with levels `EXACT`, `GOOD`, `FAIR` (the default), `PARTIAL`
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
Todo (more bug prone until then !):
|
|
366
|
-
- `papers check` (fix DOI etc.)
|
|
367
|
-
- `papers filecheck` (especially rename files, including those with attachment)
|
|
368
391
|
- `papers list`
|
|
369
|
-
- `papers
|
|
370
|
-
- `papers
|
|
371
|
-
- `papers
|
|
372
|
-
- `papers git`
|
|
392
|
+
- `papers undo / redo` (partial)
|
|
393
|
+
- `papers filecheck --rename` (superficial)
|
|
394
|
+
- `papers check --duplicate` (fix DOI etc.) (superficial)
|
|
373
395
|
|
|
374
396
|
|
|
375
397
|
Why not JabRef, Zotero or Mendeley (or...) ?
|
|
@@ -1,32 +1,21 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: papers-cli
|
|
3
|
-
Version: 2.3.1
|
|
4
|
-
Summary: utilities to keep your PDF library organized
|
|
5
|
-
Author-email: Mahé Perrette <mahe.perrette@gmail.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: homepage, https://github.com/perrette/papers
|
|
8
|
-
Keywords: bibtex,references,bibliography
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Requires-Python: >=3.7
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
|
|
14
1
|
[](https://github.com/perrette/papers/actions)
|
|
15
|
-
[]()
|
|
16
2
|
[]()
|
|
17
3
|
[]()
|
|
18
4
|
[]()
|
|
5
|
+
[]()
|
|
6
|
+
[]()
|
|
19
7
|
|
|
20
8
|
# papers
|
|
21
9
|
|
|
22
10
|
Command-line tool to manage bibliography (pdfs + bibtex)
|
|
23
11
|
|
|
24
|
-
|
|
12
|
+
Disclaimer: This tool requires further development and testing, and might never be fully production-ready (contributors welcome). \
|
|
13
|
+
That said, it is becoming useful :)
|
|
25
14
|
|
|
26
15
|
## Motivation
|
|
27
16
|
|
|
28
17
|
This project is an attempt to create a light-weight,
|
|
29
|
-
command-line bibliography
|
|
18
|
+
command-line bibliography management tool. Aims:
|
|
30
19
|
|
|
31
20
|
- maintain a PDF library (with appropriate naming)
|
|
32
21
|
- maintain one or several bibtex-compatible collections, linked to PDFs
|
|
@@ -35,13 +24,13 @@ command-line bibliography managenent tool. Aims:
|
|
|
35
24
|
|
|
36
25
|
## Dependencies
|
|
37
26
|
|
|
38
|
-
- python 3.
|
|
27
|
+
- python 3.9+
|
|
39
28
|
- [poppler-utils](https://en.wikipedia.org/wiki/Poppler_(software)) (only:`pdftotext`): convert PDF to text for parsing
|
|
40
|
-
- [bibtexparser
|
|
41
|
-
- [crossrefapi
|
|
42
|
-
- [scholarly
|
|
43
|
-
- [rapidfuzz
|
|
44
|
-
- [unidecode
|
|
29
|
+
- [bibtexparser](https://bibtexparser.readthedocs.io) : parse bibtex files
|
|
30
|
+
- [crossrefapi](https://github.com/fabiobatalha/crossrefapi) : make polite requests to crossref API
|
|
31
|
+
- [scholarly](https://github.com/OrganicIrradiation/scholarly) : interface for google scholar
|
|
32
|
+
- [rapidfuzz](https://github.com/rhasspy/rapidfuzz) : calculate score to sort crossref requests
|
|
33
|
+
- [unidecode](https://github.com/avian2/unidecode) : replace unicode with ascii equivalent
|
|
45
34
|
|
|
46
35
|
## Install
|
|
47
36
|
|
|
@@ -102,15 +91,42 @@ If you already know the DOI of a PDF, and don't want to gamble the fulltext sear
|
|
|
102
91
|
The `add` command above also works without any PDF (create a bibtex entry without file attachment).
|
|
103
92
|
|
|
104
93
|
papers add --doi 10.5194/esd-4-11-2013 --bibtex papers.bib
|
|
105
|
-
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### Add entry without DOI from bibtex library + PDF
|
|
97
|
+
|
|
98
|
+
Some old files don't have a DOI. Best is to add the entry from its bibtex:
|
|
99
|
+
|
|
100
|
+
papers add entry.bib --attachment esd-4-11-2013.pdf
|
|
101
|
+
|
|
102
|
+
|
|
106
103
|
### List entries (and edit etc...)
|
|
107
104
|
|
|
108
|
-
|
|
105
|
+
Pretty listing (-1 or -l for one-liner listing, otherwise plain bibtex):
|
|
106
|
+
|
|
107
|
+
$> papers list -1
|
|
109
108
|
Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1)
|
|
110
109
|
|
|
111
|
-
|
|
110
|
+
Search with any number of keywords:
|
|
111
|
+
|
|
112
|
+
$> papers list perrette scaling approach sea level -1
|
|
113
|
+
... (short list)
|
|
114
|
+
$> papers list perrette scaling approach sea level --any -1
|
|
115
|
+
... (long list)
|
|
116
|
+
$> papers list --key perrette2013 --author perrette --year 2013 --title scaling approach sea level -1
|
|
117
|
+
... (precise list)
|
|
118
|
+
|
|
119
|
+
Add tags to view papers by topic:
|
|
120
|
+
|
|
121
|
+
$> papers list perrette2013 --add-tag sea-level projections -1
|
|
122
|
+
...
|
|
123
|
+
$> papers list --tag sea-level projections -1
|
|
124
|
+
Perrette2013: A scaling approach to project regional sea level rise and it... (doi:10.5194/esd-4-11-2013, file:1, sea-level | projections )
|
|
125
|
+
|
|
126
|
+
`papers list` is a powerful command, inspired from unix's `find` and `grep`.
|
|
127
|
+
|
|
112
128
|
It lets you search in your bibtex in a typical manner (including a number of special flags such as `--duplicates`, `--review-required`, `--broken-file`...),
|
|
113
|
-
then output the result in a number of formats (one-liner, raw bibtex, keys-only, selected fields) or let you perform actions on it (currently `--edit`, `--delete`).
|
|
129
|
+
then output the result in a number of formats (one-liner, raw bibtex, keys-only, selected fields) or let you perform actions on it (currently `--edit`, `--delete`, `--add-tag`, `--fetch`).
|
|
114
130
|
For instance, it is possible to manually merge the duplicates with:
|
|
115
131
|
|
|
116
132
|
$> papers list --duplicates --edit
|
|
@@ -157,7 +173,6 @@ The same template and modifiers system applies to the bibtex key generation by r
|
|
|
157
173
|
|
|
158
174
|
In the common case where the bibtex (`--bibtex`), files directory (`--filesdir`), and name and key formats (e.g. `--name-template`) do not change, it is convenient to
|
|
159
175
|
(install)[#install-make-bibtex-and-files-directory-persistent] `papers`.
|
|
160
|
-
Install comes with the option to git-track any change to the bibtex file (`--git`) options.
|
|
161
176
|
|
|
162
177
|
|
|
163
178
|
### install: make bibtex and files directory persistent
|
|
@@ -187,11 +202,10 @@ Sometimes it is desirable to have separate configurations. In that case a local
|
|
|
187
202
|
Bibtex file name [default to existing: papers.bib] [Enter/Yes/No]:
|
|
188
203
|
Files folder [default to new: papers] [Enter/Yes/No]: pdfs
|
|
189
204
|
papers configuration
|
|
190
|
-
* configuration file: .
|
|
205
|
+
* configuration file: papersconfig.json
|
|
191
206
|
* cache directory: /home/perrette/.cache/papers
|
|
192
207
|
* absolute paths: True
|
|
193
208
|
* git-tracked: False
|
|
194
|
-
* git-lfs tracked: False
|
|
195
209
|
* files directory: pdfs (90 files, 337.4 MB)
|
|
196
210
|
* bibtex: papers.bib (82 entries)
|
|
197
211
|
|
|
@@ -216,7 +230,7 @@ and remove the configuration file by hand (`rm ...`). Or use `papers uninstall`
|
|
|
216
230
|
|
|
217
231
|
papers uninstall
|
|
218
232
|
|
|
219
|
-
You may repeat `papers status -v` and cleaning until a
|
|
233
|
+
You may repeat `papers status -v` and cleaning until a satisfying state is reached, or remove all config files recursively up to (and including) global install:
|
|
220
234
|
|
|
221
235
|
papers uninstall --recursive
|
|
222
236
|
|
|
@@ -224,7 +238,7 @@ You may repeat `papers status -v` and cleaning until a satistfying state is reac
|
|
|
224
238
|
### Relative versus Absolute path
|
|
225
239
|
|
|
226
240
|
By default, the file paths in the bibtex are stored as absolute paths (starting with `/`), except for local installs.
|
|
227
|
-
It is possible to change this
|
|
241
|
+
It is possible to change this behaviour explicitly during install or in a case by case basis with `--relative-paths` or `--absolute-paths` options.
|
|
228
242
|
With or without install.
|
|
229
243
|
|
|
230
244
|
|
|
@@ -237,7 +251,7 @@ Simple cases are:
|
|
|
237
251
|
In any other cases, you risk breaking the file links.
|
|
238
252
|
|
|
239
253
|
Papers tries to be as little opinionated as possible about how files are organized, and so it relies on your own judgement and use case.
|
|
240
|
-
When loading a bibtex, it always
|
|
254
|
+
When loading a bibtex, it always interprete relative file links as being relative to the bibtex file.
|
|
241
255
|
When saving a bibtex, it will save file links accordingly to the default setting path (usually absolute, unless local install or unless you specify otherwise).
|
|
242
256
|
|
|
243
257
|
In any case, the following set of commands will always work provided the initial file links are valid (optional parameters in brackets):
|
|
@@ -278,25 +292,34 @@ That command is also convenient to check on what's actually tracked and what is
|
|
|
278
292
|
|
|
279
293
|
Install comes with the option to git-track any change to the bibtex file (`--git`) options.
|
|
280
294
|
|
|
281
|
-
$> papers install --bibtex papers.bib --filesdir files --git
|
|
295
|
+
$> papers install --bibtex papers.bib --filesdir files --git [ --git-lfs ]
|
|
282
296
|
|
|
283
297
|
From now on, every change to the library will result in an automatic git commit.
|
|
284
298
|
And `papers git ...` command will work just as `git ...` executed from the bibtex directory.
|
|
285
299
|
E.g. `papers git add origin *REMOTE URL*`; `papers git lfs track files`; `papers git add files`; `papers git push`
|
|
286
|
-
Note this is an experimental feature at this stage, with potential for improvement.
|
|
287
300
|
|
|
288
|
-
|
|
301
|
+
If `--git-lfs` is passed, the files will be backed-up along with the bibtex.
|
|
302
|
+
Under the hood, bibtex and files (if applicable) are copied (hard-linked) to a back-up directory.
|
|
303
|
+
Details are described in [issue 51](https://github.com/perrette/papers/issues/51).
|
|
304
|
+
|
|
305
|
+
In local installs, backup occurs in `.papers/`. In global installs, defaults to `~/.local/.share/papers`.
|
|
306
|
+
Type `papers status -v` to find out.
|
|
307
|
+
|
|
308
|
+
For local install that are already git-tracked, the feature remains useful as it is the basis for `papers undo` and `papers redo`.
|
|
309
|
+
You might want to add `.papers` to your .gitignore to avoid messing up with your larger project.
|
|
310
|
+
|
|
311
|
+
This feature is experimental.
|
|
289
312
|
|
|
290
313
|
|
|
291
|
-
### undo
|
|
314
|
+
### undo / redo
|
|
292
315
|
|
|
293
316
|
Did a `papers add` and are unhappy with the result?
|
|
294
317
|
|
|
295
318
|
papers undo
|
|
296
319
|
|
|
297
320
|
will revert to the previous version. If repeated, it will jump back and forth between latest and before-latest.
|
|
298
|
-
|
|
299
|
-
|
|
321
|
+
Unless papers is installed with --git option, in which case `papers undo` and `papers redo` will have essentially infinite memory
|
|
322
|
+
(doing undos and making a new commit risk loosing history, unless you keep track of the commit).
|
|
300
323
|
|
|
301
324
|
|
|
302
325
|
Consult inline help for more detailed documentation!
|
|
@@ -315,10 +338,10 @@ Current features
|
|
|
315
338
|
- some support for attachment
|
|
316
339
|
- merging (`papers check --duplicates ...`)
|
|
317
340
|
- fix entries (`papers check --format-name --encoding unicode --fix-doi --fix-key ...`)
|
|
318
|
-
- undo command (`papers undo`)
|
|
319
341
|
- configuration file with default bibtex and files directory (`papers install --bibtex BIB --filesdir DIR ...`)
|
|
320
|
-
- integration with git
|
|
321
|
-
-
|
|
342
|
+
- integration with git
|
|
343
|
+
- undo/redo command (`papers undo / redo`)
|
|
344
|
+
- display / search / list entries : format as bibtex or key or whatever (`papers list ... [--key-only, -l]`)
|
|
322
345
|
- list + edit or remove entry by key or else (`papers list ... [--edit, --delete]`)
|
|
323
346
|
- fix broken PDF links (`papers filecheck ...`):
|
|
324
347
|
- remove duplicate file names (always) or file copies (`--hash-check`)
|
|
@@ -328,25 +351,12 @@ Current features
|
|
|
328
351
|
- latex characters, e.g. `{\_}` or `{\'{e}}` replaced with unicode
|
|
329
352
|
|
|
330
353
|
|
|
331
|
-
Feature ideas (TODO: organize as issues for discussion)
|
|
332
|
-
-------------
|
|
333
|
-
- `papers encode`: text encoding in bibtex entries (latex, unicode, ascii)
|
|
334
|
-
- additional checks on entries:
|
|
335
|
-
- duplicate-authors and more like [here](https://github.com/tdegeus/bibparse)
|
|
336
|
-
- support collections (distinct bibtex entries, same files directory)
|
|
337
|
-
- or maybe more like ´papers update-from OTHER.bib´ to update changes based on DOI / key
|
|
338
|
-
- could also use git branches / merge
|
|
339
|
-
- associate bibtex to existing pdf collection (to move library location)
|
|
340
|
-
- fetch PDFs for existing entries? Bindings with [sopaper](https://github.com/ppwwyyxx/SoPaper)
|
|
341
|
-
- lazy loading of modules (optimization)
|
|
342
|
-
|
|
343
|
-
|
|
344
354
|
Tests
|
|
345
355
|
-----
|
|
346
|
-
Test coverage
|
|
356
|
+
Test coverage is improving (now 80%)
|
|
347
357
|
|
|
348
358
|
Currently covers:
|
|
349
|
-
- `papers extract`
|
|
359
|
+
- `papers extract` (test on a handful of PDFs)
|
|
350
360
|
- parse pdf DOI
|
|
351
361
|
- fetch bibtex on crossref based on DOI
|
|
352
362
|
- fetch bibtex on crossref based fulltext search
|
|
@@ -355,21 +365,14 @@ Currently covers:
|
|
|
355
365
|
- add entry and manage conflict
|
|
356
366
|
- add pdf file, bibtex, directory
|
|
357
367
|
- add one pdf file with attachment (beta, API will change)
|
|
358
|
-
- `papers check --duplicates`
|
|
359
368
|
- conflict resolution
|
|
360
|
-
- `papers install`
|
|
369
|
+
- `papers install`
|
|
361
370
|
- internals:
|
|
362
371
|
- duplicate test with levels `EXACT`, `GOOD`, `FAIR` (the default), `PARTIAL`
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
Todo (more bug prone until then !):
|
|
366
|
-
- `papers check` (fix DOI etc.)
|
|
367
|
-
- `papers filecheck` (especially rename files, including those with attachment)
|
|
368
372
|
- `papers list`
|
|
369
|
-
- `papers
|
|
370
|
-
- `papers
|
|
371
|
-
- `papers
|
|
372
|
-
- `papers git`
|
|
373
|
+
- `papers undo / redo` (partial)
|
|
374
|
+
- `papers filecheck --rename` (superficial)
|
|
375
|
+
- `papers check --duplicate` (fix DOI etc.) (superficial)
|
|
373
376
|
|
|
374
377
|
|
|
375
378
|
Why not JabRef, Zotero or Mendeley (or...) ?
|