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.4rc3.tar.gz (77.1 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.4rc3-cp311-abi3-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.11+Windows x86-64

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

Uploaded CPython 3.11+PyEmscripten 2026.0 wasm32

refkit_core-0.0.4rc3-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.4rc3-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.4rc3.tar.gz.

File metadata

  • Download URL: refkit_core-0.0.4rc3.tar.gz
  • Upload date:
  • Size: 77.1 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.4rc3.tar.gz
Algorithm Hash digest
SHA256 dad4c0c9c08fd7e3f27be3bef3ea30858ac647046c0ee42f0e1ca48909ff59ae
MD5 10a39c99ef214021f3fddefacc27cadc
BLAKE2b-256 026725dd3cf78202e9f9a2425cc5c5c7ffe4f97655c5598bcdf912001ac8bb79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc3-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.4rc3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 571d51c66265145a2db26459a2b090b07721d87105723dd199ea71336ece78e6
MD5 f10aae9963e82390db04c108423b0e66
BLAKE2b-256 fd2f681dc07a943c2f7563f2a906e38a17358506a5def577960cb9367a06895c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc3-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.4rc3-cp311-abi3-pyemscripten_2026_0_wasm32.whl
Algorithm Hash digest
SHA256 0dcb0536a465877fa829f98c7cded5efe2f2532700ff19a8c7c112c4075bb307
MD5 f7f440f5402ceae493c1495736ee981b
BLAKE2b-256 8274f5db2e2aa68ca52456d897eed5704efea5b28266ad3b957d7ca8819f5097

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc3-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.4rc3-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 91197c7a8c5da9b276ee86d1c3e1da4741035b934b33ea3819fbb9f002c9cafc
MD5 74197500d28a9dc3f923fa6b6557fb0a
BLAKE2b-256 6630d731a1e8061e9ff0d372d121f3b7fc5d8f5bdc1f20c1684b48338bb18a7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc3-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.4rc3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af90bbc4d59ae3932018602daa2fe3f043f0c9e6841c446eef6625ed1b5dd961
MD5 55d8dd90e449172fef0b8eccc52a9c57
BLAKE2b-256 09a1ead9befce811672e6522891e368f5e1160c764b88a405302e9cb6c992640

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