Skip to content

Latest commit

 

History

History
489 lines (348 loc) · 17 KB

File metadata and controls

489 lines (348 loc) · 17 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Added

  • Added format_err ("Format Error") and parse_err ("Parse Error") as dedicated error types on BibLookup, with corresponding @property getters, to distinguish local processing failures from remote lookup failures.
  • Added set subcommand to the CLI (bib-lookup set KEY VALUE) for setting individual configuration values; VALUE of none/null resets the key to None (falling back to built-in logic).
  • Added gbmedium configuration option for the GB/T 7714-2015 style: True forces [J/OL] (online), False forces [J] (print), None (default) auto-detects based on the presence of doi/url fields.
  • Added STYLE_PARAMETERS registry in _const.py documenting per-style configuration parameters, used for validation in --config and set.

Changed

  • --config now warns (instead of silently discards) when unknown keys are encountered; the keys are still written to the config file.
  • str2bool now passes None through unchanged so that config values reset to None work correctly for boolean fields.
  • Style-specific settings are now collected in a _style_kwargs dictionary inside BibLookup (populated by _init_style_kwargs) rather than as individual attributes, making it easy to add new per-style parameters.

Deprecated

Removed

Fixed

  • Fixed text format and bibtex exception handlers silently returning Not Found when local parsing or style rendering fails. They now return Parse Error and Format Error (<style>): <details> respectively.
  • Fixed --format text --style gbt (and IEEE / Chicago) returning Not Found for DOIs whose @article entry has no journal field — common for preprints from bioRxiv, medRxiv, etc. The style templates now use optional_field("journal") instead of the mandatory field("journal").
  • Fixed _remove_comments incorrectly stripping escaped percent signs (\%) and content following them when called with keep_comments=False. The function now uses a character-level state machine that correctly distinguishes escaped % (preceded by an odd number of backslashes) from comment-start %, and preserves content inside \verb|...| and \begin{verbatim}...\end{verbatim} environments.
  • Fixed --format text --style gbt (and other pybtex-backed styles) returning Not Found for DOIs whose BibTeX contains unquoted full month names (e.g. month=June). The raw BibTeX is now normalised through _to_bib_item before handing it to pybtex's strict parser.
  • Extended month normalisation in BibItem.__normalize_fields to handle full English month names (e.g. july, june) and non-standard abbreviations (e.g. sept) returned by some DOI/PubMed resolvers, in addition to the existing standard 3-letter BibTeX abbreviations. Unused calendar and strptime imports removed.

Security

0.1.4 - 2026-03-21

Added

  • Added three new citation styles: APA 7th Edition, IEEE, and Chicago 17th Edition.
  • Added support for pybtex built-in styles (unsrt, alpha, plain, unsrtalpha).
  • Added ignore_fields support for text format output with custom/pybtex styles.

Changed

  • The maximum number of authors displayed before truncation for GB/T 7714-2015 citation style can be configured via max_names (default: 3).
  • GB/T 7714-2015 style now uses uppercase for author names and initials per the standard.
  • GB/T 7714-2015 style now uses [J/OL] medium tag for online articles with DOI or URL.
  • IEEE style now uses its own default max_names=6 instead of inheriting the global default (3).

Fixed

  • Fixed CitationMixin._init_db() raising "file is not a database" in parallel test environments (e.g. pytest-xdist): corrupt leftover db files are now detected and recreated, schema creation is idempotent, and WAL journal mode is enabled for safer concurrent access.

0.1.3 - 2026-03-04

Added

  • Add --remove-comments flag to the CLI simplify_bib command to control whether to keep comments when gathering .tex files.
  • Added a new NiceGUI-based web interface (nicegui_app.py) featuring a modern glassmorphism design while retaining all original functionalities. The original Streamlit app remains available.
  • Added native Python support for GB/T 7714-2015 citation style (style="gbt7714"), enabling Chinese standard citation formatting without LaTeX dependencies.

Changed

  • Changed the backend storage of CitationMixin cache from CSV to SQLite for better performance and concurrency support. The existing CSV cache will be automatically migrated to SQLite upon first use.
  • Refactored the CLI entry point bib_lookup/cli.py to break down the monolithic main function into modular helper functions for better maintainability.

Fixed

  • Fixed an issue in the CLI where --output-file and --overwrite flags were ignored when using the simplify_bib command.
  • Fixed lookup failures for ChinaDOI/CNKI DOIs (e.g., 10.13748/...) by switching request method to GET and adding a browser-header fallback mechanism to retrieve the resolution URL.

0.1.2 - 2026-01-13

Changed

  • Add argument keep_comments to function gather_tex_source_files_in_one in utils module to control whether to keep comments in the output.
  • Enhance the gather_tex_source_files_in_one function: it now ignores input{} commands that are inside verbatim-like environments such as verb, verb*, begin{verbatim}, etc.
  • Enhance the static method simplify_bib_file of BibLookup class: it now automatically detects the bib files used in a LaTeX source file, and now supports multiple bib files used in one LaTeX source file.

Fixed

  • Fix handling of macros and non-entry types when loading bib files in method read_bib_file and when simplifying bib files in static method simplify_bib_file of BibLookup class. (See PR #11)

0.1.1 - 2025-08-28

Fixed

  • Fix bugs in the utility function utils.gather_tex_source_files_in_one: Removed problematic regex pattern that caused over-matching of content preceding input{} commands. Implemented robust comment exclusion using interval intersection detection to prevent processing of commented input{} commands. Added utility functions overlaps() and is_intersect() to accurately determine if matched commands fall within comment boundaries.

0.1.0 - 2025-08-18

Added

  • Add overwrite optional argument to function gather_tex_source_files_in_one in utils module.
  • Add utility function capitalize_title in utils module, and add it as an option for the streamlit app.

Changed

  • Add doi field to arXiv lookup results.
  • Enhance the text format lookup results.

Fixed

  • Fix layout bugs of the streamlit app.
  • Fix bugs in the function utils.gather_tex_source_files_in_one when input{some_filepath} and commented % input{some_filepath} coexist.
  • Update the base URL for the PubMed ID lookup service, and change post method to get method to fetch the lookup content.
  • Fix bugs in the function utils.gather_tex_source_files_in_one when the filepath in input{filepath} contains commands like currfiledir or currfileabsdir, or contains characters other than alphanumeric characters and / (e.g. Chinese characters).

0.0.29 - 2024-08-15

Added

  • Add support of simplify bib functions for CLI.

Changed

  • Improve layout the streamlit app.
  • Use bs4 to parse html to text.

Fixed

  • Fix errors for parsing complicated bib items.
  • Fix potential errors parsing the trailing month.

0.0.28 - 2024-02-28

Fixed

  • Fix empty lookup result bug #5.
  • Fix error parsing bib files in method _to_bib_item of BibLookup class.

0.0.27 - 2023-12-10

Fixed

  • Fix bugs in method _to_bib_item of BibLookup class that break its idempotency.

0.0.26 - 2023-11-16

Added

  • Add streamlit app.
  • Add cache_limit config as an init parameter for BibLookup class.

Changed

  • Reformat code with pre-commit.
  • Update docs conf.py.

Removed

  • Remove unused bash scripts.

0.0.25 - 2023-08-16

Fixed

  • Fix errors in method _to_bib_item of BibLookup class when parsing the url field.

0.0.24 - 2023-08-06

Added

  • Add support of config file for bib-lookup

0.0.23 [YANKED]

This release was yanked.

0.0.22 - 2023-01-30

Changed

  • Use requests.Session for looking-up the bib items.

0.0.21 - 2023-01-08

Changed

  • Improve the __eq__ method of BibItem class.
  • Update CLI so that recently added functions can be used with CLI.

0.0.20 - 2022-12-03

Changed

  • Improve the __eq__ method of BibItem class.

0.0.19 - 2022-10-09

Added

  • Add CitationMixin class.

0.0.18 - 2022-09-23

Added

  • Add support for formats other than bibtex for DOI

0.0.17 - 2022-07-29

Fixed

  • Fix bugs in function gather_tex_source_files_in_one.
  • Update the method read_bib_file of BibLookup class, so that no field is ignored when reading a bib file

0.0.16 - 2022-07-19

Added

  • Add two optional arguments timeout and ignore_errors for BibLookup class.

Fixed

  • Fix bugs in cases where there are line breaks inside a field.

0.0.15 [YANKED]

This release was yanked.

0.0.14 - 2022-06-14

Fixed

  • Fix errors in the __call__ method of BibLookup class when passing a sequence of identifiers with some specific parameters assigned values.

0.0.13 - 2022-06-01

Added

  • Add demo notebook.
  • Add a default bib_lookuper.

0.0.12 - 2022-05-10

Added

  • Add support for arxiv2doi in CLI.
  • Add helper function gather_tex_source_files_in_one in utils module.

Changed

  • Improve handling of network-related errors.

0.0.11 - 2022-04-22

Added

  • Add helper method clear_cache for BibLookup class.

Changed

  • Update the citation_pattern in the static method simplify_bib_file of BibLookup class.

0.0.10 - 2022-04-18

Added

  • Add static method simplify_bib_file for BibLookup class.

Changed

  • Improve bib file parsing.
  • Enhanced the layout of the string format of the cached lookup results.

0.0.9 - 2022-04-12

Added

  • Add options for converting from arxiv to doi.

Fixed

  • Fix bugs in __eq__ method of BibItem class.
  • Correct handling of not found doi items.
  • Correct handling of underscores in bib title.

0.0.8 - 2022-04-10

Added

  • Add zenodo config file.

0.0.7 - 2022-04-10

Changed

  • Enhance printing in jupyter notebooks.

0.0.6 - 2022-04-10

Added

  • Add utils module which contains several utility functions.

0.0.5 - 2022-04-07

Added

  • Add method check_bib_file for BibLookup class.

Changed

  • Enhance save method for BibLookup class.

0.0.4 - 2022-04-06

Added

  • Add CLI support for bib-lookup.

0.0.3 - 2022-04-06

Added

  • Add class BibItem.
  • Add custom (enhanced) __repr__ method for the BibLookup class.

0.0.2 - 2022-03-31

Added

  • Add IO functions for saving the lookup results.

0.0.1 - 2022-03-31

Added

  • Add class BibLookup.