Skip to main content

Provides APA7 style for Pybtex

Project description

APA7 Style for Pybtex

This is a fork of naeka's pybtex-apa-style, which targeted APA6.

This plugin provides APA7 style for Pybtex.

Pybtex provides Python support for interacting with bibTeX bibliography data. Style plugins provide support for formatting bibliographies, similar to the role that csl files play for LaTeX.

Installation

$ pip install pybtex pybtex-apa7-style

Usage

Pybtex uses Python's plugin system. To use APA7, load it as a plugin as shown in the example below.

from pybtex.plugin import find_plugin
from pybtex.database import parse_file
APA = find_plugin('pybtex.style.formatting', 'apa7')()
HTML = find_plugin('pybtex.backends', 'html')()

def bib_to_apa7_html(bibfile):
    bibliography = parse_file(bibfile, 'bibtex')
    formatted_bib = APA.format_bibliography(bibliography)
    return "<br>".join(entry.text.render(HTML) for entry in formatted_bib)

Contributing

This is a work in progres; APA style is not fully-specified and has endless edge cases. I would be delighted to receive examples of bibTeX entries which are not formatted correctly in APA.

If you clone this project's repository, you can add bibTeX exemplars in tests/examples and then run python tests/test_visual_results.py. Open tests/results.html to see the resulting APA-formatted HTML.

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

pybtex-apa7-style-0.1.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

pybtex_apa7_style-0.1.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file pybtex-apa7-style-0.1.3.tar.gz.

File metadata

  • Download URL: pybtex-apa7-style-0.1.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.13 Darwin/19.6.0

File hashes

Hashes for pybtex-apa7-style-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f383a05a99081bbc3b83f58c2d8ce4effb1f32149f7409b4f7bc52f55d74d3fe
MD5 7694019ad01e4790808506fbc4e43d47
BLAKE2b-256 9914ff157a3499e71af9f69f04da6891d86716539e087786cf40eeb0e481c0af

See more details on using hashes here.

File details

Details for the file pybtex_apa7_style-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pybtex_apa7_style-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0420a0baf957644c22bf4f7866e83a635e38cd72e3f29794bcf6c0a576709e06
MD5 37e5e3b8a693c8fc9c0d6c9f086281a3
BLAKE2b-256 2913b73e95d5e78db8d67ad7afe3192680a87a7b77e3f8f12eeb0988bed24c53

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