adsfolio.gui.cv_dialog

Build a CV publication list in any text format from your ADS records.

The same window also exports papers selected in the library table. That mode uses the metadata stored in the library and makes no ADS request.

class adsfolio.gui.cv_dialog.CVDialog(parent=None, *, settings_path=None, records=None, browser_command=None)[source]

Bases: PySide6.QtWidgets.QDialog

Edit CV settings, preview them, and write the publication list.

settings_changed fires after an edit, once the preview timer runs.

In the default mode, the settings live in cv.yaml in the ADSfolio configuration folder, the same file that adsfolio cv generate reads. Sample papers preview the format offline. My ADS publications and Save CV run adsfolio cv generate in the background.

With records, the window exports those papers instead. It renders them from their stored metadata with a custom template, makes no ADS request, and keeps its settings in cv-selection.yaml.

Parameters:
  • parent (QWidget, optional) – Parent window.

  • settings_path (Path, optional) – Settings file. Defaults to cv.yaml, or cv-selection.yaml with records, in the configuration folder.

  • records (sequence of mapping, optional) – Library table records to export.

  • browser_command (str, optional) – Configured browser for links in the rendered preview.

done(result)[source]

Save the settings and stop a running lookup when the window closes.

Parameters:

result (int)

Return type:

None

escape_preset_key()[source]

Return the preset that matches the current escape choice.

Return type:

str

property local_mode: bool[source]

Return whether the window exports selected library papers.

mapping()[source]

Return the settings as a cv.yaml mapping.

Sections that this window does not edit, such as markers and status, keep their loaded values.

Return type:

dict[str, Any]

render_list(records=None)[source]

Return the list text with the current settings.

Parameters:

records (Sequence[Mapping[str, Any]], optional) – Library table records to render. By default the current papers.

Raises:

ValueError – If the settings cannot render the list.

Return type:

str

save_settings()[source]

Write the current settings to the settings file.

Return type:

bool

set_records(records)[source]

Replace the library papers of a list export and render them again.

Parameters:

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

Return type:

None

settings_changed
staticMetaObject = PySide6.QtCore.QMetaObject("CVDialog" inherits "QDialog": Methods:   #41 type=Signal, signature=settings_changed() )
adsfolio.gui.cv_dialog.docs_from_records(records)[source]

Convert library table records into CV documents, keeping their order.

Parameters:

records (sequence of mapping) – Records from the library table. ADS-style fields are read from the record’s metadata mapping, then from the record itself.

Returns:

Documents with the fields that the CV renderers read.

Return type:

list of dict

adsfolio.gui.cv_dialog.sample_publications(me_target)[source]

Return fictional ADS records that include me_target as an author.

The bibcodes use the journal code DEMO, which is not an ADS journal, so no record is real.

Parameters:

me_target (str)

Return type:

list[dict[str, Any]]