Polars RefKit
Parse, inspect, render, and format BibTeX columns inside Polars eager and lazy queries. Each source row owns an independent bibliography and citation state.
Documentation · Expression reference · Python objects
Render a citation column
Install in Python 3.10 through 3.14 with Polars 1.29 or newer:
python -m pip install polars-refkit
import polars as pl
import polars_refkit
frame = pl.DataFrame(
{
"bibtex": ["@article{doe2024, author={Doe, Jane}, title={Fast Citations}, year={2024}}"],
"key": ["doe2024"],
}
)
result = frame.select(
citation=pl.col("bibtex").refkit.cite("key"),
entries=pl.col("bibtex").refkit.entry_count(),
)
print(result.to_dicts())
[{'citation': '(Doe, 2024)', 'entries': 1}]
Importing polars_refkit registers pl.Expr.refkit. A string argument names a column. Use pl.lit(...) for literal bibliography text or citation keys.
Choose an operation
| Task | Expressions |
|---|---|
| Parse and inspect | entry_count, keys, entries, can_parse, diagnostics, has_diagnostics, parse_report |
| Render citations | cite, cite_each, cite_group |
| Render every entry | full_bibliography |
| Inspect render failures | render_report |
| Format and deduplicate | tidy_bibtex, tidy_bibtex_report |
Choose output="text", "html", or "rendered" on rendering expressions. Pass formatting settings as an options= dictionary. Value expressions return null on row-local failures. Reports retain structured diagnostics, errors, or rename records beside the source row.
Use with agents
The package includes version-matched task guidance:
import polars_refkit.agent
help(polars_refkit.agent)
Agent integration covers discovery. Data shapes defines reports.
polars-refkit supports native CPython on Linux, macOS, and Windows. For Python in Pyodide, use refkit directly. The Polars adapter does not support Pyodide.
RefKit is alpha software. Public APIs may change before 1.0.
Metadata
Release files for polars-refkit 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| polars_refkit-0.4.0.tar.gz | 172.3 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| polars_refkit-0.4.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| polars_refkit-0.4.0-cp310-abi3-manylinux_2_34_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.34+ x86-64 | Details |
| polars_refkit-0.4.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 18.7 MB
Release files / polars_refkit-0.4.0.tar.gz
| Download URL | polars_refkit-0.4.0.tar.gz |
|---|---|
| Size | 172.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d24cd82ef0ad96a7ddfc2417d3d11f267974916a0f34acf922959cd22a72792d
|
|
BLAKE2b-256 checksum How to use checksums |
d9d905f587670f4f360a92c99d9fe291434af43fd16d3e901b3ff4559668145f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_refkit-0.4.0-cp310-abi3-win_amd64.whl
| Download URL | polars_refkit-0.4.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2717602780f7575beaa4231b02ce7ba83fa1887ea72a5f2212d10903e0c4bf36
|
|
BLAKE2b-256 checksum How to use checksums |
34e921c56fe533b204e9278e53ab00a7373b20567a8b233b10329fed0dfe31de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_refkit-0.4.0-cp310-abi3-manylinux_2_34_x86_64.whl
| Download URL | polars_refkit-0.4.0-cp310-abi3-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.10 Linux glibc 2.34+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0ace8121803934e1f385f37de44063f3d637a7b3a61c272ca39b17bd6a35dad2
|
|
BLAKE2b-256 checksum How to use checksums |
07a2d491002f5acf0449c70da4589788610446a2952a02871d10e4d75157b7a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / polars_refkit-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | polars_refkit-0.4.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.6 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1d18463ab24f9fd1b572be445a840cafd98d374d57aa187cdfdd01cc421489ed
|
|
BLAKE2b-256 checksum How to use checksums |
6b8bb4ee0d3be3446ea43603dc83feb719ffab270682d88e551077f81a4d1ad8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|