Skip to content

v0.2.1

Choose a tag to compare

@goerz goerz released this 14 Jul 17:27
v0.2.1
  • Added: Library.import_bibtex and a corresponding import CLI command (reading from a file, --stdin, or --url), importing the entries of a BibTeX snippet -- anything from a single publisher-provided entry to a complete .bib file -- after thorough sanitization: journals are stored as @string macro references (resolved against the library's macros and the new journal_macros configuration table, or newly created from the journal's lowercased initials, honoring the initials.journal exceptions; literal arXiv:... pseudo-journals stay literal and derive eprint/archiveprefix), proper nouns in sentence-case titles and all configured protected_words are brace-protected, DOIs are normalized to their bare lowercase form, article page ranges collapse to the first page, non-essential article fields (month, publisher, numpages, issn, a url shadowed by the DOI, ...) are dropped, and citation keys are regenerated (keep_keys/--keep-keys to opt out) from the configured auto_key format or built-in defaults (e.g. GoerzPRA2014, or Goerz2205.15044 for arXiv preprints). An entry whose DOI or eprint is already in the library is rejected; any validation problem rejects the whole import (reporting all problems at once) and leaves the library untouched. [[#14]]
  • Added: Library.add and a corresponding add CLI command, fetching bibliographic data by DOI, arXiv identifier, URL, or free-text search -- from Crossref (with DOI content negotiation as the fallback for work types with no BibTeX equivalent) or the arXiv API (respecting its rate limits) -- and adding it as a new entry via the same sanitization as import_bibtex. The CLI command accepts --dry-run (print the entry instead of saving) and --fix-uppercase (repair all-uppercase publisher metadata, also available on import). This subsumes the functionality of the getbibtex script. New dependencies: habanero, arxiv, and httpx. [[#14]]
  • Added: a journal_macros table in bibdeskparser.toml, mapping @string macro names to the journal name(s) they stand for (a list value declares publisher-spelling aliases of the same journal), and a protected_words list of words that import always brace-protects inside titles; exposed as Library.config.journal_macros and Library.config.protected_words. [[#14]]
  • Added: CLI commands for working with the fields of a single entry: fields KEY lists the defined field names, get_field KEY FIELDNAME prints one field value, set_field KEY FIELDNAME VALUE sets a field (with --literal/--macro to force the value to be stored as literal text or as a bare @string macro reference), and delete_field KEY FIELDNAME removes a field. These correspond to the dict interface of Entry (iteration, indexing, assignment, and del). [[#13]]
  • Added: an author KEY and an editor KEY CLI command, printing an entry's authors/editors as structured names (last-name-first; with --json, as objects with first/von/last/jr name parts), corresponding to the Entry.author and Entry.editor properties. [[#13]]
  • Added: a set_type KEY TYPE CLI command, changing an entry's type (corresponding to assigning Entry.entry_type). [[#13]]
  • Added: the groups and keywords CLI commands accept an optional entry KEY, listing the groups/keywords of that single entry (corresponding to the Entry.groups and Entry.keywords properties) instead of the library-wide mapping. [[#13]]
  • Added: filter options on the keys CLI command: --type TYPE keeps only entries of the given type(s), and --has FIELD/--missing FIELD/--empty FIELD keep only entries where FIELD is defined with a non-empty value, not defined at all, or defined but empty, respectively (all repeatable). [[#13]]
  • Fixed: assigning a MacroString (e.g. via set_field --macro) now normalizes the macro name to BibDesk's canonical lowercase form, matching how @string definitions are stored; previously a non-canonical name such as PRA was stored verbatim and then read back as a literal ValueString instead of a MacroString. [[#13]]
  • Fixed: the CLI's top-level --help now shows a complete, un-truncated one-line summary for every subcommand (previously long summaries were cut off with ...). [[#11]]
  • Fixed: Library.render (and the render CLI command) now expands @string macros in the rendered citation, so a field like journal = pra shows its defined value (e.g. Phys. Rev. A) rather than the bare macro name. [[#12]]
  • Changed: bump the PyPI Development Status classifier from 2 - Pre-Alpha to 3 - Alpha.