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

Uploaded CPython 3.11+Windows x86-64

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

Uploaded CPython 3.11+PyEmscripten 2026.0 wasm32

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

File metadata

  • Download URL: refkit_core-0.0.4rc4.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.4rc4.tar.gz
Algorithm Hash digest
SHA256 589755044adbe027d85eb7f132f657dd3026aeb2e26f48db256704615364061c
MD5 c846b5d8baa499c0781978d69f19ed22
BLAKE2b-256 a2851db58b97172ab01f18d5d5c74872bb27647eef7501b4542e8ccd4624db55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc4-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.4rc4-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e148c113138baec08e6b0c09d7551427d5becc4d352ed8b0fd59c31de3b2d3f5
MD5 f9a446291c00d97144776fc607a86e9c
BLAKE2b-256 18c2996ac36b80506dd8ac018581c7cd1adb6139ba0f9980c9014ba649a8bb3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc4-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.4rc4-cp311-abi3-pyemscripten_2026_0_wasm32.whl
Algorithm Hash digest
SHA256 7aaab62344b073efbc298928b83be69c9eac99701a885edd12b75477f687f897
MD5 4a374f6df6e24f1b8a9924f2d8e8498d
BLAKE2b-256 4fe5721bee3a7a611add91a618a99a3c10a6ba3896badf811b41f7b27565cdc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc4-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.4rc4-cp311-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 89aa5e66543831e3f2fac92cb11e69462b44053060bf71d8f08e9006725286d6
MD5 7c6c5c9361ea312dd08223996db31d1e
BLAKE2b-256 0059df0ac53aac2b8db5010b1453ee8f1b5dfee1aee8a4109a41c490d88f039d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refkit_core-0.0.4rc4-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.4rc4-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 595202511820ea958f4d022f844e79508f8ad5e954c5bb8e2912b93bd7dc9a91
MD5 0d7cd267eab4f4e1f8c6e3d2d18a5f1b
BLAKE2b-256 d686da186083572200984591e16fd0ad2b9a59d3a3550685fd44970d4af21e13

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