Skip to content

Implementation of the ISO 4 standard for journal titles abbreviations in Python.

License

Notifications You must be signed in to change notification settings

pierre-24/pyiso4

Repository files navigation

pyiso4

An attempt to implement the ISO 4 standard for journal titles abbreviations within a simple application written in Python, as described in Section 7.1 of the ISSN Manual. Inspired by the NPM package abbrevIso.

Install and use

From PyPI:

pip install pysiso4

Usage:

$ iso4abbreviate "Journal of the American Chemical Society"
J. Am. Chem. Soc.

You can abbreviate multiple titles at the same time:

$ iso4abbreviate "Journal of Chemical Physics" "Journal of Physical Chemistry A"
J. Chem. Phys.
J. Phys. Chem. A

By default, the program abbreviate using this list of abbreviation (slightly modified version of LTWA 2021) and this list of stopwords. You can change that using --ltwa and --stopwords to provide your own files instead (with the same syntax as theirs).

As for rule 7.1.11, namely that abbreviations of generic words such as part, etc. are omitted unless they are required, the program removes them by default. To change this behavior, use --keep-part.

Python API

from pyiso4.ltwa import Abbreviate

# create an abbreviator (using the default LTWA)
abbreviator = Abbreviate.create()

# abbreviate something
abbreviation = abbreviator('Journal of the American Chemical Society', remove_part=True)

Known issues

A list of failed tests is found here. It currently fails:

  • to fulfil rule 7.1.7 of the manual: keep prepositions in expressions (like in vivo) and place/personal name intact (it is difficult to know in advance),
  • to fulfil rules 7.1.2, 7.1.3 and 7.1.8 of the same manual (but this is of lesser importance),
  • on compound words (such as microengineering), except if explicitly found in the LTWA,
  • on some ligatures (but it handles the most common ones, such as œ and æ)

Contributions

Contributions, either by filling issues or via pull requests are welcomed. More information here.