adsfolio.gui.export_dialog

One window that exports library papers as BibTeX, citation text, or a list.

class adsfolio.gui.export_dialog.AdsBibtexFetch(bibcodes, parent=None)[source]

Bases: PySide6.QtCore.QThread

Fetch ADS’s own BibTeX for papers in a worker thread.

The thread only talks to ADS. The window saves the result in the catalog, because a catalog connection belongs to the thread that opened it.

Parameters:
  • bibcodes (Sequence[str])

  • parent (Any)

fetched
progressed
run()[source]
Return type:

None

staticMetaObject = PySide6.QtCore.QMetaObject("AdsBibtexFetch" inherits "QThread": Methods:   #12 type=Signal, signature=progressed(int,int), parameters=int, int   #13 type=Signal, signature=fetched(PyObject,PyObject), parameters=PyObject, PyObject )
class adsfolio.gui.export_dialog.ExportPapersDialog(parent, scopes, catalog, citation_styles, *, initial_scope='selected', initial_format='bibtex', browser_command=None, show_unidentified=None, exclude_fields=('abstract', 'adsnote'))[source]

Bases: PySide6.QtWidgets.QDialog

Choose papers, a format, and its settings, then copy or save the text.

Parameters:
  • parent (QWidget or None) – Parent widget.

  • scopes (Sequence[ExportScope]) – Paper choices. The first scope whose key equals initial_scope starts selected.

  • catalog (object) – Central PdfCatalog that holds the papers.

  • citation_styles (Sequence[CitationStyle]) – Custom citation styles for the citation text format.

  • initial_scope (str, optional) – Key of the scope to select first.

  • initial_format (str, optional) – Format key to select first.

  • browser_command (str or None, optional) – Browser command for links in the list preview.

  • show_unidentified (Callable[[], None] or None, optional) – Show the PDFs that need identification in the main window.

  • exclude_fields (Sequence[str], optional) – BibTeX fields to leave out at first, by default the abstract and the ADS note.

done(result)[source]

Keep the list settings when the window closes.

Parameters:

result (int)

Return type:

None

property excluded_fields: list[str][source]

Return the field names to leave out, in lowercase.

property format_key: str[source]

Return the selected format key.

key_policy()[source]

Return the chosen key styles.

Raises:

ValueError – If the key template is not valid.

Return type:

adsfolio.citekeys.KeyPolicy

render(papers, *, preview=False)[source]

Return the exported text for papers in the current format.

Raises:
Parameters:
Return type:

str

staticMetaObject = PySide6.QtCore.QMetaObject("ExportPapersDialog" inherits "QDialog": )
class adsfolio.gui.export_dialog.ExportScope(key, label, records)[source]

Bases: object

One choice of papers for the export.

key is a stable name, for example "selected" or "all". label is the text of the choice, without the count. records holds library table records in export order.

Parameters:
key: str
label: str
records: collections.abc.Sequence[collections.abc.Mapping[str, Any]]
class adsfolio.gui.export_dialog.PaperSummary(papers, ads_papers, other_papers, skipped, shared_pdfs)[source]

Bases: object

Papers that an export writes, and PDFs that it skips.

papers holds one record for each distinct catalog paper, in export order. ads_papers counts papers with an ADS bibcode, and other_papers counts the rest, for example papers from Crossref or DataCite. skipped holds PDFs without paper details, which do not export. shared_pdfs counts PDFs whose paper an earlier PDF already supplies.

Parameters:
ads_papers: int
property document_ids: list[int][source]

Return the catalog document IDs of the papers.

other_papers: int
papers: tuple[collections.abc.Mapping[str, Any], ...]
shared_pdfs: int
skipped: tuple[collections.abc.Mapping[str, Any], ...]
class adsfolio.gui.export_dialog.SkippedPdfsDialog(parent, records, show_unidentified)[source]

Bases: PySide6.QtWidgets.QDialog

List the PDFs that an export skips because they have no paper details.

Parameters:
  • parent (QWidget | None)

  • records (Sequence[Mapping[str, Any]])

  • show_unidentified (Callable[[], None] | None)

staticMetaObject = PySide6.QtCore.QMetaObject("SkippedPdfsDialog" inherits "QDialog": )
adsfolio.gui.export_dialog.summarize_papers(records)[source]

Split table records into exported papers and skipped PDFs.

A record exports when it has a catalog paper (a document ID). Several PDFs of one paper export once, through the first of them.

Parameters:

records (collections.abc.Sequence[collections.abc.Mapping[str, Any]])

Return type:

adsfolio.gui.export_dialog.PaperSummary