adsfolio.gui.library
Qt-free data definitions for the PDF library table.
- class adsfolio.gui.library.Column(key, header, width, getter, sortable=True)[source]
Bases:
objectDefinition of one table column.
- Parameters:
- getter: collections.abc.Callable[[dict[str, Any]], str]
- class adsfolio.gui.library.FileQuery(view=LibraryView.ALL, search='', search_exact=False, search_wildcards=False, search_fields=(), order_by='first_seen_at', descending=True, secondary_order_by=None, tertiary_order_by=None)[source]
Bases:
objectCurrent view, search, and sort settings for a library table.
- Parameters:
- to_filters()[source]
Translate this query into
PdfRegistryfilter arguments.- Returns:
Keyword arguments accepted by
PdfRegistry.query_files.- Return type:
- view: adsfolio.gui.library.LibraryView = 'all'
- class adsfolio.gui.library.LibraryView(*values)[source]
-
A virtual view over records in one PDF library.
- ALL = 'all'
- ARXIV_ONLY = 'arxiv_only'
- DUPLICATES = 'duplicates'
- IDENTIFIED_WITHOUT_ADS = 'identified_without_ads'
- RESOLVED = 'resolved'
- UNRESOLVED = 'unresolved'
- class adsfolio.gui.library.ResolutionState(*values)
-
Describe the current identification evidence for a PDF.
- ADS_LINKED = 'ads_linked'
- CHANGED = 'changed'
- IDENTIFIED_EXTERNAL = 'identified_external'
- LOCAL_METADATA = 'local_metadata'
- UNRESOLVED = 'unresolved'
- adsfolio.gui.library.arxiv_id(record)
Return the arXiv identifier of a file record, or an empty string.
Checks the
arxiv,arxiv_id,identifieranddoifields, then the bibcode, then the file path. Any value that contains a DOI is used only if it is an arXiv DOI (10.48550/arXiv.<id>); other DOIs are skipped wherever they appear. New (2401.12345v2) and old-style (astro-ph/0601001) identifiers are recognized, as are legacy bibcodes such as2024arXiv240112345B.The file path is scanned for identifier-like text only, so a file name that looks like an arXiv identifier is reported as one.
- Parameters:
record (collections.abc.Mapping[str, Any]) – File record with optional top-level fields and a
metadatamapping.- Returns:
Identifier as found, including any version suffix.
- Return type:
- adsfolio.gui.library.arxiv_url(identifier)[source]
Return the arXiv abstract URL for a normalized identifier.
- adsfolio.gui.library.build_columns(styles=())[source]
Construct the active table column definitions including custom citation columns.
- Parameters:
styles (Sequence[CitationStyle], optional) – Custom citation styles to insert as runtime columns, by default ().
- Returns:
Immutable column sequence with generated citation columns inserted directly after Bibcode.
- Return type:
- adsfolio.gui.library.format_count(record, key)[source]
Return a saved count as text, or an empty string when it is unknown.
Zero is shown as “0”. The same value drives numeric sorting in
PdfRegistry.query_files().
- adsfolio.gui.library.format_first_seen(record, timestamp_format)[source]
Format a location’s ISO first-seen timestamp.
- adsfolio.gui.library.format_mtime(record, timestamp_format)[source]
Format a record timestamp using ISO 8601 or a
strftimepattern.
- adsfolio.gui.library.resolution_state(record)
Classify current evidence without changing metadata or mutation permissions.
A changed file takes priority over saved ADS links and external evidence. Usable metadata without identity evidence remains distinct from identification.
- Parameters:
record (collections.abc.Mapping[str, Any])
- Return type:
- adsfolio.gui.library.verification_stale(record)
Return whether saved metadata refers to an earlier PDF revision.
- Parameters:
record (collections.abc.Mapping[str, Any])
- Return type: