Skip to main content

reference_handler

Travis Build Status AppVeyor Build status codecov Documentation Status

A python package for scientific software citation.

Motivation & goal

An appropriate recognition of the value of the scientific software on an equal footing with scholarly manuscripts and datasets is dependent upon the realization and promotion of community guidelines and best practices for software citation. Such practices can improve reproducibility and validation of the scientific discoveries, encourage software reuse and boost collaborative efforts.

Package overview

The reference handler is comprised of two core parts:

1. Central SQLite3 database which contains two tables: (i) the citation table which hosts all essential data pertinent to each unique citation, such as the raw citation text and its ID number, and (ii) the context table which contains information about the context in which a given citation was used. For instance, the function where the citation was used or the number of times the citation was "mentioned" by any function of your Python package. Since each citation can have many contexts, a one-to-many relationship exist between the citation and the context tables, respectively.

2. Functions to ease the interaction with central database. Examples are a function to cite a desired reference or a function to dump the contents of the database into a .bib file for subsequent compilation using BibTeX.

Audience

    1. Method and scientific software developers.
    1. Computational molecular science practitioners

Main features

  • Automatic and seamless runtime citation to all adopted software modules in the executed program
  • Managing citations within complex workflows and interoperable environments conveniently with simple syntax and APIs
  • Providing context and number of counts for all modules used in the executed application
  • Prioritization of all cited modules at different levels
  • Recommended citation style according to the community guidelines and best practices
  • Exporting references as databases and formatted documents in BibTeX and RIS

Installation

  • Step 1: Clone this repository on a host machine:
$ git clone git@github.com:MolSSI/reference_handler.git
  • Step 2: Change the current directory to reference_handler's root directory:
$ cd <path-to-reference-handler-root-directory>/reference_handler
  • Step 3: Create a Conda environment with python 3.9 and pip:
$ conda create -n <env-name> python=3.9 pip

replace the <env-name> with the desired name of your environment.

  • Step 4: Activate your conda environment:
$ conda activate <env-name>
  • Step 5: Run the following command to install bibtexparser 1.2.0 using pip within your conda environment
$ pip install bibtexparser==1.2.0 
  • Step 6: Finally, run the following command to install reference_handler in your conda environment
$ make install 
  • Step 7 (optional): Make sure all tests run without errors
$ pytest -v

Minimal example

import reference_handler

lj_citation = """
@article{lj1924,
author = {J. E. Jones  and Sydney Chapman },
title = {On the determination of molecular fields. \&\#x2014;II. From the equation of state of a gas},
journal = {Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character},
volume = {106},
number = {738},
pages = {463-477},
year = {1924},
doi = {10.1098/rspa.1924.0082},
}
"""

def lennard_jones(sigma, epsilon, rij):
    rf.cite(raw=lj_citation, alias='lj_citation', module='lennard_jones',
        level=1, note='The first version of the Lennard-Jones potential')
    sig_by_r6 = (sigma / rij ** 6)
    sig_by_r12 = (sig_by_r6 ** 2)
    return 4.0 * epsilon * (sig_by_r12 - sig_by_r6)

rf = reference_handler.Reference_Handler('database.db')

sigma = 3.54
epsilon = 98.0
rij = 20.0

lj_energy = lennard_jones(sigma, epsilon, rij)

rf.dump(outfile='bibliography.bib')

Documentation

The documentation is under development. Please check back later.

References

Copyright (c) 2019-2022, MolSSI

Acknowledgements

Project based on the Computational Molecular Science Python Cookiecutter version 1.0.

Metadata

Release files for reference-handler 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reference-handler 0.9.3
File Size Uploaded
reference_handler-0.9.3.tar.gz 44.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for reference-handler 0.9.3
File Interpreter ABI Platform
reference_handler-0.9.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 73.1 kB

Release files / reference_handler-0.9.3.tar.gz

Download URL reference_handler-0.9.3.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a2cff3c5bf28f99f8988133e04e7c629b77ee500f8f1b16ce1200201f5e54605
BLAKE2b-256 checksum
How to use checksums
05e564aeb3cbb91930e2b1e0a133892f4d39f1c881692574e58270d9a102ef8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / reference_handler-0.9.3-py2.py3-none-any.whl

Download URL reference_handler-0.9.3-py2.py3-none-any.whl
Size 28.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
66897c6999a4b19e1058469bc78a68e9f7923809b8be75d5ed36a3c1b4191128
BLAKE2b-256 checksum
How to use checksums
9f6d6819dbe683ae3b8cd97a8e8acc85d798717fb315ff4515234e9efc14e8f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.3 This release

2 release files

0.9.2

2 release files

0.9.1

3 release files

0.8.2

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page