Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

refkit_core-0.0.4rc5.tar.gz (77.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

refkit_core-0.0.4rc5-cp311-abi3-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

refkit_core-0.0.4rc5-cp311-abi3-pyemscripten_2026_0_wasm32.whl (1.9 MB view details)

Uploaded CPython 3.11+PyEmscripten 2026.0 wasm32

refkit_core-0.0.4rc5-cp311-abi3-manylinux_2_34_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.34+ x86-64

refkit_core-0.0.4rc5-cp311-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file refkit_core-0.0.4rc5.tar.gz.

File metadata

  • Download URL: refkit_core-0.0.4rc5.tar.gz
  • Upload date:
  • Size: 77.2 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

Hashes for refkit_core-0.0.4rc5.tar.gz
Algorithm Hash digest
SHA256 13699a66fe247448deda6a1818eb1e6315a7498010e1de05f2a8ce546dd73a74
MD5 6882f7488dbf65a3db4d1837299a85da
BLAKE2b-256 972b410cc40e50fe0064e9594468a6963501db7395c2c404c348c88b692aada0

See more details on using hashes here.

File details

Details for the file refkit_core-0.0.4rc5-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: refkit_core-0.0.4rc5-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

Hashes for refkit_core-0.0.4rc5-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1667721fc823bb9b71844bd3419911fb9b238e1bf48c1d3e3012c12652792add
MD5 42d43a928cfdbb09de44b36830a201d8
BLAKE2b-256 af354c0b1ab77f79e2a2ad2bca03daecf46128977eee8928a7f9cb038c694a55

See more details on using hashes here.

File details

Details for the file refkit_core-0.0.4rc5-cp311-abi3-pyemscripten_2026_0_wasm32.whl.

File metadata

  • Download URL: refkit_core-0.0.4rc5-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

Hashes for refkit_core-0.0.4rc5-cp311-abi3-pyemscripten_2026_0_wasm32.whl
Algorithm Hash digest
SHA256 da829d0879bb0a3074670f84dcc708ccdce626af6149708ffb101c629ff7a298
MD5 dd0770be02625264419f53fcf61226ba
BLAKE2b-256 6711a62db8e24e8d3103c8192d385a0d1343392cb8266eecfcad8078740cb2a7

See more details on using hashes here.

File details

Details for the file refkit_core-0.0.4rc5-cp311-abi3-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: refkit_core-0.0.4rc5-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

Hashes for refkit_core-0.0.4rc5-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 199fb4ceb0268fee3af7073847059f257619775c08be29cf6eb8c962a6d12476
MD5 3f0bcc97f34221487d2a32f73b5203c9
BLAKE2b-256 d2014c4779f2efec0d3091ef2124e9a9b9ed4b38ab90f42a7a088877264ec1ee

See more details on using hashes here.

File details

Details for the file refkit_core-0.0.4rc5-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: refkit_core-0.0.4rc5-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

Hashes for refkit_core-0.0.4rc5-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6a2144394aeda34b3c1c1bfbae05bc4fb8247855a8800343ef9e1965b20bf282
MD5 4828cad3f482bbef74beb54c343cff86
BLAKE2b-256 cd6a1578a2cf3da31eb34e13af9e527693805622e53e1e7d7301cb619f7812b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page