Metadata-Version: 2.1
Name: pybtex-apa7-style
Version: 0.1.1
Summary: Provides APA7 style for Pybtex
Home-page: https://github.com/cproctor/pybtex-apa7-style
License: MIT
Author: Chris Proctor
Author-email: github.com@accounts.chrisproctor.net
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Text Processing :: Markup
Classifier: Topic :: Utilities
Requires-Dist: pybtex (>=0.24.0,<0.25.0)
Project-URL: Repository, https://github.com/cproctor/pybtex-apa7-style
Description-Content-Type: text/markdown

# APA7 Style for Pybtex

*This is a fork of [naeka's pybtex-apa-style](https://github.com/naeka/pybtex-apa-style)*.

[Pybtex](https://pybtex.org/) provides Python support for interacting with bibtex-formatted
bibliography information. Style plugins are required to format a bibliography in a given 
style, similar to the role that `csl` files play for LaTeX.

This plugin provides APA7 style.

## Installation

```
$ pip install pybtex pybtex-apa7-style
```

## Usage

Pybtex uses [Python's plugin system](https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/).
To use APA7, load it as a plugin.

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

