Native core for refkit citation parsing, rendering, and BibTeX editing
Project description
refkit-core
refkit-core is the native Rust/PyO3 package used by refkit.
It exposes the extension module refkit_core._refkit_core and the Python import package refkit_core.
Most projects should install refkit:
pip install refkit
refkit pins one exact refkit-core version and checks that version at import time.
Direct refkit_core imports are supported for native integration tests, packaging smoke tests, and low-level embedding.
import refkit_core
library = refkit_core.Library.parse_bibtex(
"""
@article{doe2024,
author = {Doe, Jane},
title = {Fast Citations},
journal = {Journal of Citation Tests},
year = {2024}
}
"""
)
document = refkit_core.Document(library, refkit_core.Style.load("apa"), locale="en-US")
rendered = document.render([refkit_core.Citation("intro", "doe2024")])
print(rendered["intro"].text)
Expected output:
(Doe, 2024)
tidy_bibtex formats BibTeX text through the same native package:
result = refkit_core.tidy_bibtex(
"@ARTICLE{doe2024, pages={6-13}, year={2024}}\n",
options=refkit_core.TidyOptions(sort_fields=True),
)
print(result.bibtex)
Package Contract
refkit-core owns the native implementation for:
| Capability | Public objects |
|---|---|
| Read normalized bibliography data | Library.read, Library.parse_bibtex, Library.parse_yaml |
| Render citations | Document.render, Citation, Cite, CitationGroup |
| Render bibliographies | Document.cited_bibliography, Document.full_bibliography |
| Load CSL styles and locales | Style.load, Style.from_path, Style.from_xml, Locale.load |
| Format BibTeX | tidy_bibtex, TidyOptions, TidyResult, TidyWarning |
| Edit raw BibTeX | BibDocument, BibEntry, BibField |
| Inspect rendered output | Rendered.text, Rendered.html, Rendered.tree |
Use refkit for one-call path helpers such as refkit.cite and refkit.full_bibliography.
Pyodide
Pyodide uses the same native extension package as CPython.
The release workflow builds refkit-core for wasm32-unknown-emscripten with toolchain values from pyodide config get, then publishes the PyEmscripten wheel alongside the CPython wheels.
The pure Python refkit package keeps the same exact dependency on refkit-core, so Pyodide resolves the matching wheel from PyPI.
The Pyodide lane takes the Python target and PyEmscripten ABI from the release workflow.
Development
uv sync --all-packages --group dev
(cd packages/refkit-core && uv run maturin develop)
uv run pytest packages/refkit/tests --no-cov
Build only the native package:
uv build --package refkit-core --no-create-gitignore
License
refkit-core is licensed under the Apache License, Version 2.0, available in LICENSE. See NOTICE for upstream citation and bibliography component acknowledgements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file refkit_core-0.0.3.tar.gz.
File metadata
- Download URL: refkit_core-0.0.3.tar.gz
- Upload date:
- Size: 76.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
619539a47b4255bce54f6530fb8622e162f12e61a255c6b8916ddec5779bc257
|
|
| MD5 |
3ac67f3b658888e54ef6dc344017d5ea
|
|
| BLAKE2b-256 |
fddde9b72ae356940e37cce81ff4e5be7a2ca29c4efbd9c4997ee508e78a2221
|
File details
Details for the file refkit_core-0.0.3-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: refkit_core-0.0.3-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbc6f53140e7ba5234935ff83f59dee78832a8acf8876bf537f9332415776cb8
|
|
| MD5 |
18fbf5e97d3b6457b0393aacdb2aab9b
|
|
| BLAKE2b-256 |
796f48305951ab01271e906752a6d973589897a425f98a5ea38f59986cec4524
|
File details
Details for the file refkit_core-0.0.3-cp311-abi3-pyemscripten_2026_0_wasm32.whl.
File metadata
- Download URL: refkit_core-0.0.3-cp311-abi3-pyemscripten_2026_0_wasm32.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11+, PyEmscripten 2026.0 wasm32
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c839d161038ffb159bf05d7e9856d3fa24f32693dfe7f36c7be0e24634beac15
|
|
| MD5 |
5ff2ea2b325da4da065dc4bde4561b3a
|
|
| BLAKE2b-256 |
80f3d89a29d46f93469c1d41e2fc9beca9fc428e2b18790d5bd5a2b6d3995a74
|
File details
Details for the file refkit_core-0.0.3-cp311-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: refkit_core-0.0.3-cp311-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.11+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2f4771ff7d5d20edbc35836d1d5ccf837c5ac382a1da36de6f80ee7702a9e00
|
|
| MD5 |
121cdc0f81a6c226c8b337a979874b0d
|
|
| BLAKE2b-256 |
42630c055901605d6b878097da4cc842cac5fdb87b50ccab9ad0af28d5d89ee5
|
File details
Details for the file refkit_core-0.0.3-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: refkit_core-0.0.3-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06c5426e5b8f26bbd4671c096f3d9a3572ddfd18192fb1908ff837d4c005b3b9
|
|
| MD5 |
cd36e1b48c91be5f662815e2acc5dbba
|
|
| BLAKE2b-256 |
37cdd449a9aa77cefcfa3b1197b8e4d8f2ac5cefd21a0a9048226c548d01c9b0
|