A pybtex plugin for working with RIS files.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pybtexris-0.1.1.tar.gz
.
File metadata
- Download URL: pybtexris-0.1.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41005c97f51a91298ab9cd8548e9788aca10a0543e418d7a57688d75824a1d3d |
|
MD5 | 481c9ede28f9bc00164ad7e6d4fe23e7 |
|
BLAKE2b-256 | aeae5c6ec11567ebc6c66d46c4b5c2d6ab6cdb121c58aed6397cea9b551f2661 |
File details
Details for the file pybtexris-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pybtexris-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.10 Linux/5.13.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6e7d98d37d558ad897b8ec6966aad4affc0b289824817d8e8f571b9f8168d72 |
|
MD5 | 26770973d1fe1d49ecc11cf931283c95 |
|
BLAKE2b-256 | 1ee84a1cdee850dd53dcf3b5eb6de375c09cfc349c5cf22a3d033453de5f850f |