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.4

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.4
File Size Uploaded Provenance
reference_handler-0.9.4.tar.gz 45.7 kB With provenance Details

Built distribution (wheel)

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

Total release size: 76.3 kB

Release files / reference_handler-0.9.4.tar.gz

Download URL reference_handler-0.9.4.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f26feb90b59d78ec9c7e46a9b02d2d1465476675d383b98141d65d0f7c71213f
BLAKE2b-256 checksum
How to use checksums
f8446a7fb5eb64ec5862ba305b8ba1e5b9ddd8862dde94d5af9ca2eb91c72f43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

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

Download URL reference_handler-0.9.4-py2.py3-none-any.whl
Size 30.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
9afd38d23883f69122648c7de558815c02122bb37d36f5149717ffcf24f1dc3c
BLAKE2b-256 checksum
How to use checksums
d639ecd2074f5ca5628919f1fad8f630c3dcda76f8c8307af23a37a0bb5c5353
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 24, 2026.

Transparency log

Security for reference-handler 0.9.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for reference_handler-0.9.4.tar.gz

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 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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