papers-cli 2.12__tar.gz → 2.13__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.
Files changed (44) hide show
  1. {papers_cli-2.12 → papers_cli-2.13}/PKG-INFO +1 -1
  2. {papers_cli-2.12 → papers_cli-2.13}/papers/__main__.py +19 -6
  3. {papers_cli-2.12 → papers_cli-2.13}/papers/_version.py +2 -2
  4. {papers_cli-2.12 → papers_cli-2.13}/papers_cli.egg-info/PKG-INFO +1 -1
  5. {papers_cli-2.12 → papers_cli-2.13}/.gitattributes +0 -0
  6. {papers_cli-2.12 → papers_cli-2.13}/.github/workflows/pypi.yml +0 -0
  7. {papers_cli-2.12 → papers_cli-2.13}/.github/workflows/tests.yml +0 -0
  8. {papers_cli-2.12 → papers_cli-2.13}/.gitignore +0 -0
  9. {papers_cli-2.12 → papers_cli-2.13}/LICENSE +0 -0
  10. {papers_cli-2.12 → papers_cli-2.13}/README.md +0 -0
  11. {papers_cli-2.12 → papers_cli-2.13}/papers/__init__.py +0 -0
  12. {papers_cli-2.12 → papers_cli-2.13}/papers/bib.py +0 -0
  13. {papers_cli-2.12 → papers_cli-2.13}/papers/config.py +0 -0
  14. {papers_cli-2.12 → papers_cli-2.13}/papers/duplicate.py +0 -0
  15. {papers_cli-2.12 → papers_cli-2.13}/papers/encoding.py +0 -0
  16. {papers_cli-2.12 → papers_cli-2.13}/papers/extract.py +0 -0
  17. {papers_cli-2.12 → papers_cli-2.13}/papers/filename.py +0 -0
  18. {papers_cli-2.12 → papers_cli-2.13}/papers/latexenc.py +0 -0
  19. {papers_cli-2.12 → papers_cli-2.13}/papers/utils.py +0 -0
  20. {papers_cli-2.12 → papers_cli-2.13}/papers_cli.egg-info/SOURCES.txt +0 -0
  21. {papers_cli-2.12 → papers_cli-2.13}/papers_cli.egg-info/dependency_links.txt +0 -0
  22. {papers_cli-2.12 → papers_cli-2.13}/papers_cli.egg-info/entry_points.txt +0 -0
  23. {papers_cli-2.12 → papers_cli-2.13}/papers_cli.egg-info/requires.txt +0 -0
  24. {papers_cli-2.12 → papers_cli-2.13}/papers_cli.egg-info/top_level.txt +0 -0
  25. {papers_cli-2.12 → papers_cli-2.13}/pyproject.toml +0 -0
  26. {papers_cli-2.12 → papers_cli-2.13}/requirements.txt +0 -0
  27. {papers_cli-2.12 → papers_cli-2.13}/setup.cfg +0 -0
  28. {papers_cli-2.12 → papers_cli-2.13}/setup.py +0 -0
  29. {papers_cli-2.12 → papers_cli-2.13}/tests/__init__.py +0 -0
  30. {papers_cli-2.12 → papers_cli-2.13}/tests/common.py +0 -0
  31. {papers_cli-2.12 → papers_cli-2.13}/tests/config.py +0 -0
  32. {papers_cli-2.12 → papers_cli-2.13}/tests/download.py +0 -0
  33. {papers_cli-2.12 → papers_cli-2.13}/tests/downloadedpapers/.gitignore +0 -0
  34. {papers_cli-2.12 → papers_cli-2.13}/tests/downloadedpapers/bg-8-515-2011.txt +0 -0
  35. {papers_cli-2.12 → papers_cli-2.13}/tests/test_add.py +0 -0
  36. {papers_cli-2.12 → papers_cli-2.13}/tests/test_biblio.py +0 -0
  37. {papers_cli-2.12 → papers_cli-2.13}/tests/test_duplicates.py +0 -0
  38. {papers_cli-2.12 → papers_cli-2.13}/tests/test_encoding.py +0 -0
  39. {papers_cli-2.12 → papers_cli-2.13}/tests/test_extract.py +0 -0
  40. {papers_cli-2.12 → papers_cli-2.13}/tests/test_filecheck.py +0 -0
  41. {papers_cli-2.12 → papers_cli-2.13}/tests/test_install.py +0 -0
  42. {papers_cli-2.12 → papers_cli-2.13}/tests/test_list.py +0 -0
  43. {papers_cli-2.12 → papers_cli-2.13}/tests/test_misc.py +0 -0
  44. {papers_cli-2.12 → papers_cli-2.13}/tests/test_undo.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: papers-cli
3
- Version: 2.12
3
+ Version: 2.13
4
4
  Summary: utilities to keep your PDF library organized
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT
@@ -15,7 +15,7 @@ import time
15
15
  import papers
16
16
  from papers import logger
17
17
  from papers.extract import extract_pdf_doi, isvaliddoi, extract_pdf_metadata
18
- from papers.extract import fetch_bibtex_by_doi
18
+ from papers.extract import fetch_bibtex_by_doi, fetch_bibtex_by_fulltext_crossref, fetch_bibtex_by_fulltext_scholar
19
19
  from papers.encoding import parse_file, format_file, family_names, format_entries, standard_name, format_entry, parse_keywords, format_key
20
20
  from papers.config import bcolors, Config, search_config, CONFIG_FILE, CONFIG_FILE_LOCAL, DATA_DIR, CONFIG_FILE_LEGACY, BACKUP_DIR
21
21
  from papers.duplicate import list_duplicates, list_uniques, edit_entries
@@ -569,7 +569,7 @@ def addcmd(parser, o, config):
569
569
  logger.error("No entry added: use --doi, --metadata, --key, --attachment, --title, --author, --journal, --year to add a new entry")
570
570
  raise PapersExit()
571
571
 
572
- metadata.setdefault('ID', biblio.generate_key(metadata))
572
+ metadata.setdefault('ID', biblio.keyformat(metadata))
573
573
  metadata.setdefault('ENTRYTYPE', 'article')
574
574
  if o.edit:
575
575
  metadata = edit_entries(metadata)
@@ -717,7 +717,20 @@ def doicmd(parser, o):
717
717
  print(extract_pdf_doi(o.pdf, image=o.image))
718
718
 
719
719
  def fetchcmd(parser, o):
720
- print(fetch_bibtex_by_doi(o.doi))
720
+ # either one or several DOIs
721
+ if all(isvaliddoi(field) for field in o.doi_or_text):
722
+ if o.scholar:
723
+ parser.error("Fetching from DOI does not support Google Scholar option")
724
+ for doi in o.doi_or_text:
725
+ print(fetch_bibtex_by_doi(doi))
726
+ return
727
+
728
+ # or one full text search
729
+ field = " ".join(o.doi_or_text)
730
+ if o.scholar:
731
+ print(fetch_bibtex_by_fulltext_scholar(field))
732
+ else:
733
+ print(fetch_bibtex_by_fulltext_crossref(field))
721
734
 
722
735
  def extractcmd(parser, o):
723
736
  print(extract_pdf_metadata(o.pdf, search_doi=not o.fulltext, search_fulltext=True, scholar=o.scholar, minwords=o.word_count, max_query_words=o.word_count, image=o.image))
@@ -1180,9 +1193,9 @@ def get_parser(config=None):
1180
1193
 
1181
1194
  # fetch
1182
1195
  # =====
1183
- fetchp = subparsers.add_parser('fetch', description='fetch bibtex from DOI')
1184
- fetchp.add_argument('doi')
1185
-
1196
+ fetchp = subparsers.add_parser('fetch', description='fetch bibtex from DOI or full-text')
1197
+ fetchp.add_argument('doi_or_text', nargs='+', help='DOI or full text.')
1198
+ fetchp.add_argument('--scholar', action='store_true', help='use google scholar instead of default crossref for fulltext search')
1186
1199
 
1187
1200
  # extract
1188
1201
  # ========
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '2.12'
16
- __version_tuple__ = version_tuple = (2, 12)
15
+ __version__ = version = '2.13'
16
+ __version_tuple__ = version_tuple = (2, 13)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: papers-cli
3
- Version: 2.12
3
+ Version: 2.13
4
4
  Summary: utilities to keep your PDF library organized
5
5
  Author-email: Mahé Perrette <mahe.perrette@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes