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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file pyiso4-0.1.6.tar.gz.

File metadata

  • Download URL: pyiso4-0.1.6.tar.gz
  • Upload date:
  • Size: 430.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pyiso4-0.1.6.tar.gz
Algorithm Hash digest
SHA256 014947983b9302398bd4de0760eb243e54e32ca2bcfff5f1b5eadc25acbbbd03
MD5 420106c2efa4988f7c28eafc0e817864
BLAKE2b-256 c521af4fc6f90fab08bd646915a612515efd6cb14f8225cb34e72c48c4e2fc48

See more details on using hashes here.

File details

Details for the file pyiso4-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: pyiso4-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 429.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pyiso4-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2a4331a7ecb88d91da7fb7fba95062029875cce827d1c0d7299702756cca1b99
MD5 652d79c1e0a80118ae13a88f1315a893
BLAKE2b-256 6de3e9037eb59eb496b289c0b1cb73c95b88c096d39f42a0d8d833be7097d1c5

See more details on using hashes here.

Supported by

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