View on GitHub

pycite

Python Citations Generator

pycite: Python Citations Generator

DOI PyPI version fury.io Project Status Codecov Test-Package PyPI license Documentation Status Total Downloads Monthly Downloads Weekly Downloads Maintenance GitHub last commit GitHub issues GitHub issues-closed

pycite is a simple to use python citations generator.

Supported Reference Styles

Supported Paper Sources

Supported file formats

pycite generates citations given a file of the following types:

Installation

The simplest way to install the latest release is as follows:

pip install pycite

To install the development version:

Open the Terminal/CMD/Git bash/shell and enter


pip install git+https://github.com/Nelson-Gon/pycite.git

# or for the less stable dev version
pip install git+https://github.com/Nelson-Gon/pycite.git@dev

Otherwise:

# clone the repo
git clone git@github.com:Nelson-Gon/pycite.git
cd pycite
pip install .  

Usage

Script Mode

To use at the command line, please use:

python -m pycite -i testfiles/testlinks.txt -o testfiles/citations.txt

To get help:

python -m pycite --help
#usage: __main__.py [-h] -i INPUT_FILE -o OUTPUT_FILE
#
#optional arguments:
#  -h, --help            show this help message and exit
#  -i INPUT_FILE, --input-file INPUT_FILE
#                        Path to an input file
#  -o OUTPUT_FILE, --output-file OUTPUT_FILE
#                        Path to an output file

Programming Mode

First, one needs to create an object of class PyCite

from pycite.pycite import PyCite
# Need an input-output file pair 
my_citations = PyCite(input_file="testfiles/testlinks.txt", output_file="testfiles/citations.txt")

To generate citations, one simply calls the cite method.

# This will write citations in the provided output file 
my_citations.cite()

The above creates citations as required (only the first line shown here). See citations.txt for the full file.

Pohorille A, Wilson MA, & Shannon G (2017)  Flexible Proteins at the Origin of Life Life (Basel), 7(2),  23.  [Accessed 16/Sep/2021]

Note

pycite is free software that the author hopes could be of use to someone else and enable them to perform reproducible science.

If you have any concerns, especially regarding the papers used to test that the software works, please contact the author. In the event that you notice that any of the papers used in the tests has been retracted, please immediately inform the author to remove that paper.

Thank you very much and keep building,

For Science!

To report any issues, suggestions or improvement, please do so at issues.

“Before software can be reusable it first has to be usable.” – Ralph Johnson