A pybtex plugin for NBIB/Medline/PubMed files
Project description
A pybtex plugin for NBIB/Medline/PubMed files. For information on the file format, see the documentation at the National Library of Medicine.
Installation
Install pybtexnbib from PyPI using pip:
pip install pybtexnbib
Command-line usage
To convert an NBIB file to another format, use the pybtex-convert command. For example:
pybtex-convert bibliography.nbib bibliography.bib
The extension of the output file must be supported by pybtex or an associated plugin.
To format an NBIB file into a human-readable bibliography, use the pybtex-format command. For example:
pybtex-format bibliography.nbib bibliography.txt
For more information, see the documentation for pybtex.
Programmatic usage
NBIB 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.nbib",
style="plain",
output_backend="plaintext",
bib_format="nbib",
)
Multiple NBIB files can be formatted in a similar way:
from pybtex import format_from_files
bibliography_string = format_from_files(
["path/to/file1.nbib", "path/to/file2.nbib"],
style="plain",
output_backend="plaintext",
bib_format="nbib",
)
By giving "suffix" as the argument to bib_format, NBIB files can be combined with bibliography files of other formats (such as BibTeX or RIS):
from pybtex import format_from_files
bibliography_string = format_from_files(
["path/to/file1.nbib", "path/to/file2.bib", "path/to/file3.ris"],
style="plain",
output_backend="plaintext",
bib_format="suffix",
)
The RIS parser comes from pybtexris. Parsers for the files for other formats need to be registered on the pybtex.database.input.suffixes entry point as discussed pybtex plugin documentation.
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 pybtexnbib-0.1.1.tar.gz
.
File metadata
- Download URL: pybtexnbib-0.1.1.tar.gz
- Upload date:
- Size: 8.7 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 | 4be06064a78c2a06c7d0885ac362e7dab98d31fb4e1a63d780e45196f686b035 |
|
MD5 | 222113dbc98a9b13a1e6ab08dc7de337 |
|
BLAKE2b-256 | 6f72b97a458afb53f3395914340d7df8f94abfa49eca2ba9b8938666f6d363c9 |
File details
Details for the file pybtexnbib-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pybtexnbib-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 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 | 51852684e40411383b084468db4b9d92634ced8bad0be1e9de4148c38a7fad71 |
|
MD5 | 0527b0106a396cdf7c5d574e6091cca5 |
|
BLAKE2b-256 | 5b800de67ea0f6c4eedfc0c462834b64330438885f09bb2893bc1c92da4d2464 |