keeferrourke / pyapa

A Python module for checking APA style. Not a papaya.
https://pypi.python.org/pypi/pyapa/
ISC License
2 stars 1 forks source link
apa apacheck pyapa python python3 regex style-checker writing

pyapa

A Python module for checking APA style in writing.

This module provides an abstraction class, mostly composed of regular expressions. This project does not aim to cover the entire APA style guide, but it does attempt to cover several common errors with style.

To make errors easier to visually locate, 5 characters of context are sometimes given, depending on the detected error.

Installation

Clone this repository and run::

make install

or install from Pypi::

pip3 install pyapa

Information

Pypi: https://pypi.python.org/pypi/pyapa/

Github: https://github.com/keeferrourke/pyapa

Contact: https://krourke.org/contact

License: ISC License

pyapa.ApaCheck object class

This class documents regular expressions to match style errors.

The pyapa.ApaCheck.match() method generates an array of ApaMatch objects and stores them in the ApaCheck.Matches list for easy access.

pyapa.ApaMatch object class

This class contains the following members:

There are also two helper functions to make printing these objects easy:

Example usage

From the interpreter:

from pyapa import pyapa a = pyapa.ApaCheck() text = u'Papaya are delicious fruit, it was concluded (Author, et al. 2017).' a.match(text) [<pyapa.pyapa.ApaMatch object at 0x000000000000>] len(a.Matches) 1 a.Matches[0].print() Match from 46 to 65 for: Target: Author, et al. 2017 Feedback: Do not put a comma before 'et al.' Suggestion: Author et al. 2017

Calling the module itself:

::

python3 -m pyapa -i input.txt
python3 -m pyapa -h
Usage:
pyapa [-h] [--version] [-o OUTPUT_FILE] -i INPUT_FILE