Skip to main content

A pybtex plugin for working with RIS files.

Project description

pipline badge coverage badge black badge git3moji badge

A pybtex plugin for working with RIS files.

Installation

Install pybtexris from PyPI using pip:

pip install pybtexris

Command-line usage

To convert an RIS file to another format, use the pybtex-convert command. For example:

pybtex-convert bibliography.ris bibliography.bib

The extension of the output file must be supported by pybtex or an associated plugin.

To format an RIS file into a human-readable bibliography, use the pybtex-format command. For example:

pybtex-format bibliography.ris bibliography.txt

For more information, see the documentation for pybtex.

Programmatic usage

RIS files can be formatted into a human-readable bibliography as a string as follows:

from pybtex import format_from_file
bibliography_string = format_from_file(
    "path/to/file.ris",
    style="plain",
    output_backend="plaintext",
    bib_format="ris",
)

Multiple RIS files can be formatted in a similar way:

from pybtex import format_from_files
bibliography_string = format_from_files(
    ["path/to/file1.ris", "path/to/file2.ris"],
    style="plain",
    output_backend="plaintext",
    bib_format="ris",
)

So that RIS files can be combined with bibliography files of other formats (such as BibTeX), pybtexris also adds SuffixParser to the list of plugins which pybtex can use. The user just needs to give suffix as the argument to bib_format.

from pybtex import format_from_files
result = format_from_files(
    ["path/to/file1.ris", "path/to/file2.bib"],
    style="plain",
    output_backend="plaintext",
    bib_format="suffix",
)

The parsers for the files for other formats need to be registered on the pybtex.database.input.suffixes entry point as discussed pybtex plugin documentation. To combine with NBIB citation files, please use the pybtexnbib plugin.

For more information on programmatic use of pybtex, see the documentation of the Python API of pybtex.

Credit

Robert Turnbull (Melbourne Data Analytics Platform, University of Melbourne)

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

pybtexris-0.1.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

pybtexris-0.1.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pybtexris-0.1.2.tar.gz.

File metadata

  • Download URL: pybtexris-0.1.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-1031-azure

File hashes

Hashes for pybtexris-0.1.2.tar.gz
Algorithm Hash digest
SHA256 84ce8d59e2934d8c5416fe2cc6d57c2fbf3d8ab0c330dcb2103b687491158ebd
MD5 ffc1ea6f267fcbb2d3d52bf5b16c0889
BLAKE2b-256 af1638ae79532189b391996b90c1a45a1eee7b983ef1efffc136e6394803a2c7

See more details on using hashes here.

File details

Details for the file pybtexris-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pybtexris-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-1031-azure

File hashes

Hashes for pybtexris-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b0a5f3b9af3502f858bfed95bbffc776ce377159a13beb61b0b696c6739ed14
MD5 8cb0766e8468e37c3d5962b64843eced
BLAKE2b-256 3c971ce4705981204c4863be5a7aa55a56f62e34bae7004b25cb1bb3aaa4c3ab

See more details on using hashes here.

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