Skip to main content

Abbreviate a scientific journal title following the ISO-4 rules

Project description

pyiso4

An attempt to implement the ISO 4 standard for journal titles abbreviations in Python, as described in Section 7.1 of the ISSN Manual. Inspired by abbrevIso by @marcinwrochna.

Install and use

pip install --upgrade git+https://github.com/pierre-24/pyiso4.git

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 2017) and this list of stopwords. You can change that using --ltwa and --stopwords to provide your own files (with the same syntax).

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.

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,
  • 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 (handle the common œ and æ)

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)

Contributions

Contributions, either with issues or pull requests are welcomed.

If you can to contribute, this is the usual deal: start by forking, then clone your fork

git clone (...)
cd pyiso4

Then setup... And you are good to go :)

python -m venv venv # a virtualenv is always a good idea
source venv/bin/activate
make install  # install what's needed for dev

Don't forget to work on a separate branch, and to run the linting and tests:

make lint  # flake8
make test  # unit tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyiso4-0.1.6.tar.gz (430.5 kB view hashes)

Uploaded Source

Built Distribution

pyiso4-0.1.6-py3-none-any.whl (429.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page