Get Started
RefKit parses a bibliography and applies a Citation Style Language (CSL) style to produce citations and a bibliography. Choose a language tab to follow the same workflow in Python or TypeScript, JavaScript with checked types.
Install
Use Python 3.10 through 3.14 or Node.js 22.19 or newer. The package managers pip and npm install the corresponding binding:
python -m pip install refkitnpm install refkit-jsNode.js initializes RefKit during import. Browser applications initialize the WebAssembly module before using the same objects.
Building Python from source
Pip selects a compatible wheel when available. A source build requires Rust and Git and retrieves pinned revisions of the Hayagriva bibliography engine and Citationberg CSL model. The first build needs network access unless those revisions are cached.
Render a citation
Save the example as first_citation.py or first_citation.ts:
import refkit as rk
source = """
@article{doe2024,
author = {Doe, Jane},
title = {Fast Citations},
journal = {Journal of Citation Tests},
year = {2024}
}
"""
library = rk.Library.parse_bibtex(source)
document = rk.Document(library, rk.Style.load("apa"), locale="en-US")
rendered = document.render([rk.Citation("intro", "doe2024")])
print(rendered["intro"].text)
print(rendered.bibliography.text)import * as rk from "refkit-js";
const source = `
@article{doe2024,
author = {Doe, Jane},
title = {Fast Citations},
journal = {Journal of Citation Tests},
year = {2024}
}
`;
const library = rk.Library.parseBibtex(source);
const document = new rk.Document(library, rk.Style.load("apa"), { locale: "en-US" });
const rendered = document.render([new rk.Citation("intro", "doe2024")]);
console.log(rendered.get("intro").text);
console.log(rendered.bibliography.text);Run the file:
python first_citation.pynode first_citation.tsBoth produce:
(Doe, 2024)
Doe, J. (2024). Fast Citations. Journal of Citation Tests.Library holds normalized references. Style selects the citation rules. Document combines them with a locale, and each Citation names a result. RenderedDocument gives you the named citations and the bibliography of entries they cite.
Choose the next task
| Task | Continue with |
|---|---|
| Understand normalized records and editable source | Choose a bibliography model |
| Inspect entries, fields, and diagnostics | Parse bibliographies |
| Render groups, locators, and ordered citations | Render citations |
| Preserve comments and duplicate occurrences during edits | Edit raw BibTeX |
| Canonically format a bibliography | Format BibTeX |
| Process Python dataframe columns | Use Polars expressions |
How RefKit works connects these tasks through the shared object model.