11 releases (6 breaking)

0.7.1 Nov 16, 2025
0.6.0 Oct 10, 2025
0.5.1 Jun 12, 2025
0.3.2 Feb 1, 2025

#1250 in Text processing


Used in crate2bib-cli

MIT/Apache

40KB
842 lines

Crates.io Version GitHub Actions Workflow Status GitHub Actions Workflow Status GitHub Actions Workflow Status GitHub Actions Workflow Status PyPI - Version

crate2bib

Converts a given crate and version number to a BibLaTeX entry.

The crate will try to determine if a publication is already available by scanning for possible CITATION.cff files. It will further generate entries from the information available at crates.io. There are 4 distinct ways of using this package:

  1. Webapp jonaspleyer/.github.io/crate2bib
  2. Python bindings pypi.org/project/crate2bib
  3. CLI tool crate2bib-cli
  4. Rust crate crate2bib
def get_biblatex(
        crate_name: str,
        semver: Optional[str] = None,
        user_agent: Optional[str] = None,
        branch_name: Optional[str] = None,
        filenames: Sequence[str] = ['CITATION.cff', 'citation.bib'],
    ) -> typing.Any:
    r"""
    Wraps the [crate2bib::get_biblatex] function.

    Args:
        crate_name: Name of the crate to get BibLaTeX entry
        version: A semver-compliant version number for the crate
        user_agent: The name of the user agent. Defaults to None.
        branch_name: Name of the branch where to look for citaiton files.
        filenames: Filenames to search for within repository.
    Returns:
        list: A list of formatted BibLaTeX entries.
    """
    ...

Example Usage

import asyncio
from crate2bib import get_biblatex

async def obtain_result():
    results = await get_biblatex(
        "serde", "1.0.228", "crate2bib-py-testing-serde-user-agent"
    )
    biblatex = results[0]
    print(biblatex)
> @software {Tolnay2025,
>     author = {David Tolnay},
>     title = {{serde}: A generic serialization/deserialization framework},
>     url = {https://github.com/serde-rs/serde},
>     date = {2025-09-27},
>     version = {1.0.228},
>     license = {MIT OR Apache-2.0},
> }

Dependencies

~13–34MB
~465K SLoC