Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Automatic bibliography generation

The goal of this project is to provide an easy-to-use tool that autogenerates a bibliography. Specifically, the code provides a decorator that allows you to add citations to your functions. Then, if one of the decorated functions is called, their relevant citation keys are added to a dictionary together with the function signature that generated those citation keys. Once the program is finished running, you can request a list of used citation keys to see which cites you used where. Also, you can export the bibliography as a bibtex file containing only the references that are used at least once.

Installation

The library is available on PyPI, so you can install it with pip:

pip install bibdec

Simple example

Below is a minimal example demonstrating with only one key. However, you can also decorate a function with multiple keys, or even have conditional citations based on the function signature. More complex examples are available in the example section of the documentation.

from bibdec import Bibliography

bibtex = """
@article{key1,
author = {Some Author},
title = {Some paper},
journal = {Some Journal},
year = {1999},
volume = {42},
number = {100 -- 150}
}
"""
bibliography = Bibliography(bibtex)

@bibliography.register_cites("key1")
def f(a):
    return a + 2

print("Before calling the function:")
print(bibliography.citations)
print(bibliography.active_bibliography)

f(0)
print("After calling the function:")
print(bibliography.citations)
print(bibliography.active_bibliography)

Output:

Before calling the function:
{}

After calling the function:
{'__main__.f()': {'key1'}}
@article{key1,
author = {Some Author},
journal = {Some Journal},
number = {100 -- 150},
title = {Some paper},
volume = {42},
year = {1999}
}

Metadata

Release files for bibdec 0.0.1

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

Source distribution (sdist)

Source distribution for bibdec 0.0.1
File Size Uploaded Provenance
bibdec-0.0.1.tar.gz 34.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 40.6 kB

Release files / bibdec-0.0.1.tar.gz

Download URL bibdec-0.0.1.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9baf491a91caa46ea13778b3f39ba633d710b8a76149e71071fa84f200ccdc15
BLAKE2b-256 checksum
How to use checksums
99af02af0230e3c6e05230f84025ea7c88ef0de7ea9ac1ffbc5f523f728b72cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release files / bibdec-0.0.1-py2.py3-none-any.whl

Download URL bibdec-0.0.1-py2.py3-none-any.whl
Size 5.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
b15a37dacd4d97a77cd950e8c7ec85a0b9d1958611c77cfa8071e46f24fbccbd
BLAKE2b-256 checksum
How to use checksums
a504308926559aa08e33ac8e41bbae20a651da70a9c88b6f02a2fafea6da1968
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Security for bibdec 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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