crate2bib

Crates.iocrate2bib
lib.rscrate2bib
version0.7.1
created_at2025-01-21 03:01:43.199165+00
updated_at2025-11-16 14:26:32.419225+00
descriptionCreate BibLaTeX entries for crates hosted on crates.io
homepage
repositoryhttps://github.com/jonaspleyer/crate2bib
max_upload_size
id1524531
size110,561
Jonas Pleyer (jonaspleyer)

documentation

README

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},
> }
Commit count: 194

cargo fmt