refkit 0.3.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/skills/refkit/references/contracts.md +2 -2
  2. refkit-0.4.0/.agent-plugin/skills/refkit/references/edit.md +44 -0
  3. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/skills/refkit/references/inspect.md +4 -0
  4. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/skills/refkit/references/render.md +4 -0
  5. {refkit-0.3.0 → refkit-0.4.0}/Cargo.lock +103 -81
  6. refkit-0.4.0/Cargo.toml +59 -0
  7. {refkit-0.3.0 → refkit-0.4.0}/PKG-INFO +4 -2
  8. {refkit-0.3.0 → refkit-0.4.0}/README.md +3 -1
  9. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/Cargo.toml +6 -2
  10. refkit-0.4.0/crates/refkit-core/src/codec/biblatex.rs +761 -0
  11. refkit-0.4.0/crates/refkit-core/src/codec/csl/decode.rs +553 -0
  12. refkit-0.4.0/crates/refkit-core/src/codec/csl/encode.rs +430 -0
  13. refkit-0.4.0/crates/refkit-core/src/codec/csl/types.rs +69 -0
  14. refkit-0.4.0/crates/refkit-core/src/codec/csl.rs +35 -0
  15. refkit-0.4.0/crates/refkit-core/src/codec/yaml.rs +259 -0
  16. refkit-0.4.0/crates/refkit-core/src/codec.rs +528 -0
  17. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/document.rs +139 -2
  18. refkit-0.4.0/crates/refkit-core/src/duplicates/components.rs +52 -0
  19. refkit-0.4.0/crates/refkit-core/src/duplicates/merge.rs +437 -0
  20. refkit-0.4.0/crates/refkit-core/src/duplicates/model.rs +169 -0
  21. refkit-0.4.0/crates/refkit-core/src/duplicates/review.rs +187 -0
  22. refkit-0.4.0/crates/refkit-core/src/duplicates/signature.rs +46 -0
  23. refkit-0.4.0/crates/refkit-core/src/duplicates/view.rs +33 -0
  24. refkit-0.4.0/crates/refkit-core/src/duplicates.rs +11 -0
  25. refkit-0.4.0/crates/refkit-core/src/lib.rs +67 -0
  26. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/library/diagnostic.rs +23 -0
  27. refkit-0.4.0/crates/refkit-core/src/library/guard/cycles.rs +174 -0
  28. refkit-0.4.0/crates/refkit-core/src/library/guard/dates.rs +187 -0
  29. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/library/guard.rs +273 -98
  30. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/library/mod.rs +301 -117
  31. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/library/parse.rs +28 -7
  32. refkit-0.4.0/crates/refkit-core/src/library/recovery/raw.rs +153 -0
  33. refkit-0.4.0/crates/refkit-core/src/library/recovery.rs +426 -0
  34. refkit-0.4.0/crates/refkit-core/src/library/source.rs +15 -0
  35. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/raw/edit.rs +38 -73
  36. refkit-0.4.0/crates/refkit-core/src/raw/parse/boundaries.rs +222 -0
  37. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/raw/parse.rs +146 -136
  38. refkit-0.4.0/crates/refkit-core/src/raw/patch/apply.rs +304 -0
  39. refkit-0.4.0/crates/refkit-core/src/raw/patch/model.rs +219 -0
  40. refkit-0.4.0/crates/refkit-core/src/raw/patch/plan.rs +417 -0
  41. refkit-0.4.0/crates/refkit-core/src/raw/patch/references.rs +155 -0
  42. refkit-0.4.0/crates/refkit-core/src/raw/patch.rs +105 -0
  43. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/raw/resolve.rs +59 -56
  44. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/raw/sanitize.rs +5 -0
  45. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/raw/tests.rs +168 -52
  46. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/raw.rs +171 -29
  47. refkit-0.4.0/crates/refkit-core/src/record/engine.rs +569 -0
  48. refkit-0.4.0/crates/refkit-core/src/record/json.rs +131 -0
  49. refkit-0.4.0/crates/refkit-core/src/record/source.rs +419 -0
  50. refkit-0.4.0/crates/refkit-core/src/record.rs +452 -0
  51. refkit-0.4.0/crates/refkit-core/src/references.rs +118 -0
  52. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/render/citation.rs +11 -4
  53. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/render/html.rs +8 -6
  54. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/render/mod.rs +25 -1
  55. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/render_tree.rs +106 -3
  56. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/source.rs +8 -0
  57. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/strings.rs +4 -4
  58. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/style/validate.rs +102 -68
  59. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/style.rs +161 -32
  60. refkit-0.4.0/crates/refkit-core/src/tidy/duplicates.rs +219 -0
  61. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/keys.rs +44 -34
  62. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/latex.rs +4 -9
  63. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/mod.rs +70 -24
  64. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/options.rs +66 -1
  65. refkit-0.4.0/crates/refkit-core/src/tidy/references.rs +192 -0
  66. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/render/sort.rs +9 -9
  67. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/render/value.rs +21 -26
  68. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/render.rs +48 -76
  69. refkit-0.4.0/crates/refkit-core/src/validation/biblatex.rs +163 -0
  70. refkit-0.4.0/crates/refkit-core/src/validation/identifiers.rs +152 -0
  71. refkit-0.4.0/crates/refkit-core/src/validation.rs +377 -0
  72. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/Cargo.toml +4 -1
  73. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/citation.rs +29 -8
  74. refkit-0.4.0/packages/refkit/rust/src/codec.rs +117 -0
  75. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/conversion.rs +69 -9
  76. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/document.rs +7 -15
  77. refkit-0.4.0/packages/refkit/rust/src/errors.rs +119 -0
  78. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/lib.rs +3 -1
  79. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/library.rs +77 -31
  80. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/module.rs +8 -3
  81. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/raw.rs +284 -75
  82. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/rendered.rs +12 -25
  83. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/style.rs +34 -11
  84. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/tidy.rs +1 -4
  85. {refkit-0.3.0 → refkit-0.4.0}/pyproject.toml +2 -2
  86. {refkit-0.3.0 → refkit-0.4.0}/src/refkit/__init__.py +13 -1
  87. {refkit-0.3.0 → refkit-0.4.0}/src/refkit/__init__.pyi +13 -1
  88. {refkit-0.3.0 → refkit-0.4.0}/src/refkit/_native.pyi +91 -23
  89. refkit-0.4.0/src/refkit/types.py +601 -0
  90. refkit-0.3.0/.agent-plugin/skills/refkit/references/edit.md +0 -29
  91. refkit-0.3.0/Cargo.toml +0 -24
  92. refkit-0.3.0/crates/refkit-core/src/lib.rs +0 -34
  93. refkit-0.3.0/crates/refkit-core/src/library/recovery.rs +0 -313
  94. refkit-0.3.0/crates/refkit-core/src/library/source.rs +0 -48
  95. refkit-0.3.0/crates/refkit-core/src/tidy/duplicates.rs +0 -292
  96. refkit-0.3.0/crates/refkit-core/src/tidy/references.rs +0 -224
  97. refkit-0.3.0/packages/refkit/rust/src/entry.rs +0 -72
  98. refkit-0.3.0/packages/refkit/rust/src/errors.rs +0 -64
  99. refkit-0.3.0/src/refkit/types.py +0 -178
  100. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/plugin.json +0 -0
  101. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/skills/refkit/SKILL.md +0 -0
  102. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/skills/refkit/agents/openai.yaml +0 -0
  103. {refkit-0.3.0 → refkit-0.4.0}/.agent-plugin/skills/refkit/references/tidy.md +0 -0
  104. {refkit-0.3.0 → refkit-0.4.0}/LICENSE +0 -0
  105. {refkit-0.3.0 → refkit-0.4.0}/build_backend.py +0 -0
  106. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/render/bibliography.rs +0 -0
  107. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/render/text.rs +0 -0
  108. {refkit-0.3.0 → refkit-0.4.0}/crates/refkit-core/src/tidy/unicode.rs +0 -0
  109. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/filesystem.rs +0 -0
  110. {refkit-0.3.0 → refkit-0.4.0}/packages/refkit/rust/src/repr.rs +0 -0
  111. {refkit-0.3.0 → refkit-0.4.0}/src/refkit/agent.py +0 -0
  112. {refkit-0.3.0 → refkit-0.4.0}/src/refkit/py.typed +0 -0
@@ -22,13 +22,13 @@
22
22
 
23
23
  ## Projection boundaries
24
24
 
25
- `Library.project` and the Polars `entries` expression accept `key`, `entry_type`, `type`, `title`, `date`, `doi`, and `volume`. `type` is an output-name alias for `entry_type`. The default projection contains `key`, `title`, `doi`, and `volume`.
25
+ `Library.project` and the Polars `entries` expression accept `key`, `entry_type`, `title`, `date`, `doi`, and `volume`. The default projection contains `key`, `title`, `doi`, and `volume`. Complete `Entry` dictionaries retain structured values and namespaced extensions. Use `Library.from_records` and `to_records` for construction and extraction. Version-one `to_json` snapshots can be read by either Python or TypeScript.
26
26
 
27
27
  ## Duplicate boundaries
28
28
 
29
29
  Normalized `Library` keys are unique. Report recovery retains the first recoverable entry for a duplicate key and records a diagnostic.
30
30
 
31
- Raw `BibDocument` entries and fields preserve duplicate occurrences. Direct lookup requires one match. Use `get_all` to select a source-order occurrence before editing.
31
+ Raw `BibDocument` snapshots preserve duplicate occurrences. Direct lookup requires one match. Use `get_all` to select an occurrence, then pass its IDs to `apply_patch`. The result contains a new document, byte changes and occurrence mappings. Old handles retain their original values and spans.
32
32
 
33
33
  `BibEntry.key` is read-only. Canonical formatting can generate new keys, but accepting generated keys also requires updating downstream citations that refer to the old keys.
34
34
 
@@ -0,0 +1,44 @@
1
+ # Edit BibTeX
2
+
3
+ Use `BibDocument.apply_patch` to create an edited snapshot while preserving unrelated source bytes. Entry keys are case-sensitive. Field lookup is case-insensitive. Duplicate entry and field occurrences require explicit selection.
4
+
5
+ ```python
6
+ import refkit as rk
7
+
8
+ source = """% Keep this comment.
9
+ @article{doe2024, TITLE={First title}, year={2024}}
10
+ @article{doe2024, tItLe={Second title}, year={2025}}
11
+ """
12
+ raw = rk.BibDocument.parse(source)
13
+ entries = raw.entries.get_all("doe2024")
14
+ assert len(entries) == 2
15
+ fields = entries[1].fields.get_all("title")
16
+ assert len(fields) == 1
17
+ result = raw.apply_patch(
18
+ [
19
+ {
20
+ "kind": "set_field",
21
+ "entry_id": fields[0].entry_id,
22
+ "field_id": fields[0].id,
23
+ "value": "Corrected title",
24
+ }
25
+ ]
26
+ )
27
+ updated = result["document"]
28
+ preview = updated.to_bibtex()
29
+ assert fields[0].value == "Second title"
30
+
31
+ assert (
32
+ preview
33
+ == """% Keep this comment.
34
+ @article{doe2024, TITLE={First title}, year={2024}}
35
+ @article{doe2024, tItLe={Corrected title}, year={2025}}
36
+ """
37
+ )
38
+ ```
39
+
40
+ Review `preview`, `result["changes"]`, occurrence mappings in `result["entries"]`, and `result["warnings"]`. Call `updated.write(intended_path)` when the task authorizes that write. Patch kinds are `set_field`, `add_field`, `remove_field`, `add_entry`, `remove_entry`, `rename_entry`, and `set_entry_type`. Use input-snapshot IDs and final values for explicitly edited reference fields. `PatchError.code` and `.operation` explain an atomic rejection. Inspect source diagnostics and failed blocks before planning repairs. Review rename changes before updating citations outside the bibliography.
41
+
42
+ Use `expression=True` when a patch value is one complete BibTeX value expression, including its delimiters or macros. Extra assignments are rejected.
43
+
44
+ For duplicate review, call `raw.find_duplicates(rules=["doi"])` and inspect each group's `evidence` and `conflicts`. Matching signatures are candidate evidence. Call `raw.plan_merge(entry_ids, retain=retained_id, fields=choices)` to select field occurrences with `{"kind": "take", "name": name, "entry_id": entry_id, "field_id": field_id}` or omit a field with `{"kind": "drop", "name": name}`. A null `plan["patch"]` requires more choices. Inspect a non-null patch before calling `raw.apply_patch(plan["patch"])`. Plans preserve source expressions and update unambiguous references. `MergeError.code` explains invalid selections or unsafe reference transformations.
@@ -1,7 +1,11 @@
1
1
  # Inspect bibliography data
2
2
 
3
+ Use `decode(source, format="csl-json")` for CSL item arrays, or `format="biblatex"` / `"hayagriva"` for bibliography source formats. Its report contains `library`, `format`, and `issues`. `encode(library, format=...)` and `convert(source, source_format=..., target_format=...)` return text plus field-level issues. Set `loss="error"` when a lossy result must be refused. `ConversionError.issues` and `.diagnostics` retain the failure detail.
4
+
3
5
  Use `Library` for normalized lookup and projection. `recovery="report"` retains recoverable entries and records diagnostics. Strict parsing uses `recovery="error"`. Recovery raises `ParseError` when every entry fails. Inspect the exception's `.diagnostics` for structured failure details.
4
6
 
7
+ Use `Library.validate()` for format-neutral record quality and `BibDocument.validate()` for the BibLaTeX field profile. Reports contain `profile`, `valid`, and inspect-only `issues`. Each issue includes `code`, `severity`, `target`, `related`, `message`, and nullable `suggestion`. Return bounded issue previews with the total count. Source targets carry current-snapshot occurrence IDs and UTF-8 spans. Identifier checks establish syntax or checksum validity, not registry assignment. Review shared identifiers before proposing a merge.
8
+
5
9
  ```python
6
10
  import refkit as rk
7
11
 
@@ -30,10 +30,14 @@ assert "Roe" not in rendered.bibliography.text
30
30
 
31
31
  Use `CitationGroup` to combine references within one citation occurrence. A citation ID identifies that occurrence in `RenderedDocument`. For a note style, set `Citation(..., note_number=actual_note_number)` to the surrounding document's note number.
32
32
 
33
+ Set `Cite(..., purpose="prose")` for a citation inside a sentence. Other purposes are `normal` (default), `author`, `year`, and `full`. Purpose changes text, HTML, and the rendered tree together. Discover bundled styles with `Style.list()`, which returns dictionaries containing `name`, `aliases`, `title`, and `csl_id`.
34
+
33
35
  Use `.text` for inspection, `.html` for HTML consumers, and `.tree` for structured formatting and link metadata. Bibliography `.layout` carries spacing and alignment requirements. The cited bibliography contains references processed by the render call. `full_bibliography()` includes every library entry.
34
36
 
35
37
  Load custom styles with `Style.from_xml(xml)` or `Style.from_path(path)`. A missing reference raises `MissingReferenceError` for the whole call. Inspect requested keys first and return a bounded candidate sample when resolving a mismatch.
36
38
 
39
+ For dependent styles, use `Style.from_xml(child_xml, parent_xml=parent_xml)`. Supply the independent parent identified by the child's link. `title` and `csl_id` describe the child. An explicit document locale overrides the child's default locale, which overrides the parent's default.
40
+
37
41
  For a custom title-based style, supply Citation Style Language XML:
38
42
 
39
43
  ```python
@@ -67,13 +67,13 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
67
67
 
68
68
  [[package]]
69
69
  name = "displaydoc"
70
- version = "0.2.6"
70
+ version = "0.2.7"
71
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
72
- checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
72
+ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
73
73
  dependencies = [
74
74
  "proc-macro2",
75
75
  "quote",
76
- "syn 2.0.118",
76
+ "syn 3.0.5",
77
77
  ]
78
78
 
79
79
  [[package]]
@@ -138,14 +138,14 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
138
138
 
139
139
  [[package]]
140
140
  name = "icu_collator"
141
- version = "2.2.1"
141
+ version = "2.3.1"
142
142
  source = "registry+https://github.com/rust-lang/crates.io-index"
143
- checksum = "8bbdf98e5e0aa827770acee171ebb568aaab975a36b56afdb5fd0e2f525750bb"
143
+ checksum = "08984ed58ac439ebf3e13d2cf26b0c46a60afcd21721c1d14087c0b240344dda"
144
144
  dependencies = [
145
145
  "icu_collator_data",
146
146
  "icu_collections",
147
- "icu_locale",
148
147
  "icu_locale_core",
148
+ "icu_locale_fallback",
149
149
  "icu_normalizer",
150
150
  "icu_properties",
151
151
  "icu_provider",
@@ -157,15 +157,15 @@ dependencies = [
157
157
 
158
158
  [[package]]
159
159
  name = "icu_collator_data"
160
- version = "2.2.0"
160
+ version = "2.3.0"
161
161
  source = "registry+https://github.com/rust-lang/crates.io-index"
162
- checksum = "038ed8e5817f2059c2f3efb0945ba78d060d3d25e8f1a1bea5139f821a21a2f0"
162
+ checksum = "f7d7e54efdddeb1208c08dd5d32b53a879ac00d2d3d051b2255fd26821d16368"
163
163
 
164
164
  [[package]]
165
165
  name = "icu_collections"
166
- version = "2.2.0"
166
+ version = "2.3.0"
167
167
  source = "registry+https://github.com/rust-lang/crates.io-index"
168
- checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"
168
+ checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513"
169
169
  dependencies = [
170
170
  "displaydoc",
171
171
  "potential_utf",
@@ -177,24 +177,24 @@ dependencies = [
177
177
 
178
178
  [[package]]
179
179
  name = "icu_locale"
180
- version = "2.2.0"
180
+ version = "2.3.1"
181
181
  source = "registry+https://github.com/rust-lang/crates.io-index"
182
- checksum = "d5a396343c7208121dc86e35623d3dfe19814a7613cfd14964994cdc9c9a2e26"
182
+ checksum = "785f595c61ef57169a467eeed7b4b6936a66f6cacbb116a96ee86da983251bf4"
183
183
  dependencies = [
184
184
  "icu_collections",
185
185
  "icu_locale_core",
186
186
  "icu_locale_data",
187
+ "icu_locale_fallback",
187
188
  "icu_provider",
188
- "potential_utf",
189
189
  "tinystr",
190
190
  "zerovec",
191
191
  ]
192
192
 
193
193
  [[package]]
194
194
  name = "icu_locale_core"
195
- version = "2.2.0"
195
+ version = "2.3.0"
196
196
  source = "registry+https://github.com/rust-lang/crates.io-index"
197
- checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"
197
+ checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb"
198
198
  dependencies = [
199
199
  "displaydoc",
200
200
  "litemap",
@@ -206,15 +206,35 @@ dependencies = [
206
206
 
207
207
  [[package]]
208
208
  name = "icu_locale_data"
209
- version = "2.2.0"
209
+ version = "2.3.0"
210
210
  source = "registry+https://github.com/rust-lang/crates.io-index"
211
- checksum = "d5fdcc9ac77c6d74ff5cf6e65ef3181d6af32003b16fce3a77fb451d2f695993"
211
+ checksum = "d37d91460e362a5cf58907cd7ce871411775ee6294e49a5cc8e6cec16dfa75ea"
212
+
213
+ [[package]]
214
+ name = "icu_locale_fallback"
215
+ version = "2.3.0"
216
+ source = "registry+https://github.com/rust-lang/crates.io-index"
217
+ checksum = "251af8e57c9400e3eb58242fe5b8b1152b2a64fdf4cf632f923c38ccee6f2fa9"
218
+ dependencies = [
219
+ "icu_locale_core",
220
+ "icu_locale_fallback_data",
221
+ "icu_provider",
222
+ "potential_utf",
223
+ "tinystr",
224
+ "zerovec",
225
+ ]
226
+
227
+ [[package]]
228
+ name = "icu_locale_fallback_data"
229
+ version = "2.3.0"
230
+ source = "registry+https://github.com/rust-lang/crates.io-index"
231
+ checksum = "decf2a22ec8fa68f1a0c1129a3f8583f8f8bc24e8b9ccbe98ead99f62a4dc3a8"
212
232
 
213
233
  [[package]]
214
234
  name = "icu_normalizer"
215
- version = "2.2.0"
235
+ version = "2.3.0"
216
236
  source = "registry+https://github.com/rust-lang/crates.io-index"
217
- checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"
237
+ checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f"
218
238
  dependencies = [
219
239
  "icu_collections",
220
240
  "icu_normalizer_data",
@@ -229,16 +249,17 @@ dependencies = [
229
249
 
230
250
  [[package]]
231
251
  name = "icu_normalizer_data"
232
- version = "2.2.0"
252
+ version = "2.3.0"
233
253
  source = "registry+https://github.com/rust-lang/crates.io-index"
234
- checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"
254
+ checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0"
235
255
 
236
256
  [[package]]
237
257
  name = "icu_properties"
238
- version = "2.2.0"
258
+ version = "2.3.0"
239
259
  source = "registry+https://github.com/rust-lang/crates.io-index"
240
- checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"
260
+ checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148"
241
261
  dependencies = [
262
+ "displaydoc",
242
263
  "icu_collections",
243
264
  "icu_locale_core",
244
265
  "icu_properties_data",
@@ -249,15 +270,15 @@ dependencies = [
249
270
 
250
271
  [[package]]
251
272
  name = "icu_properties_data"
252
- version = "2.2.0"
273
+ version = "2.3.0"
253
274
  source = "registry+https://github.com/rust-lang/crates.io-index"
254
- checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"
275
+ checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa"
255
276
 
256
277
  [[package]]
257
278
  name = "icu_provider"
258
- version = "2.2.0"
279
+ version = "2.3.1"
259
280
  source = "registry+https://github.com/rust-lang/crates.io-index"
260
- checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"
281
+ checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73"
261
282
  dependencies = [
262
283
  "displaydoc",
263
284
  "icu_locale_core",
@@ -283,9 +304,9 @@ dependencies = [
283
304
 
284
305
  [[package]]
285
306
  name = "idna_adapter"
286
- version = "1.2.1"
307
+ version = "1.2.2"
287
308
  source = "registry+https://github.com/rust-lang/crates.io-index"
288
- checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
309
+ checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"
289
310
  dependencies = [
290
311
  "icu_normalizer",
291
312
  "icu_properties",
@@ -293,9 +314,9 @@ dependencies = [
293
314
 
294
315
  [[package]]
295
316
  name = "indexmap"
296
- version = "2.14.1"
317
+ version = "2.14.2"
297
318
  source = "registry+https://github.com/rust-lang/crates.io-index"
298
- checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb"
319
+ checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855"
299
320
  dependencies = [
300
321
  "equivalent",
301
322
  "hashbrown",
@@ -311,15 +332,15 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
311
332
 
312
333
  [[package]]
313
334
  name = "libc"
314
- version = "0.2.186"
335
+ version = "0.2.189"
315
336
  source = "registry+https://github.com/rust-lang/crates.io-index"
316
- checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
337
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
317
338
 
318
339
  [[package]]
319
340
  name = "litemap"
320
- version = "0.8.2"
341
+ version = "0.8.3"
321
342
  source = "registry+https://github.com/rust-lang/crates.io-index"
322
- checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
343
+ checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae"
323
344
 
324
345
  [[package]]
325
346
  name = "memchr"
@@ -347,15 +368,15 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
347
368
 
348
369
  [[package]]
349
370
  name = "portable-atomic"
350
- version = "1.13.1"
371
+ version = "1.15.0"
351
372
  source = "registry+https://github.com/rust-lang/crates.io-index"
352
- checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
373
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
353
374
 
354
375
  [[package]]
355
376
  name = "potential_utf"
356
- version = "0.1.5"
377
+ version = "0.1.6"
357
378
  source = "registry+https://github.com/rust-lang/crates.io-index"
358
- checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
379
+ checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661"
359
380
  dependencies = [
360
381
  "serde_core",
361
382
  "writeable",
@@ -370,9 +391,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
370
391
 
371
392
  [[package]]
372
393
  name = "proc-macro2"
373
- version = "1.0.106"
394
+ version = "1.0.107"
374
395
  source = "registry+https://github.com/rust-lang/crates.io-index"
375
- checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
396
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
376
397
  dependencies = [
377
398
  "unicode-ident",
378
399
  ]
@@ -419,7 +440,7 @@ dependencies = [
419
440
  "proc-macro2",
420
441
  "pyo3-macros-backend",
421
442
  "quote",
422
- "syn 2.0.118",
443
+ "syn 2.0.119",
423
444
  ]
424
445
 
425
446
  [[package]]
@@ -431,7 +452,7 @@ dependencies = [
431
452
  "heck",
432
453
  "proc-macro2",
433
454
  "quote",
434
- "syn 2.0.118",
455
+ "syn 2.0.119",
435
456
  ]
436
457
 
437
458
  [[package]]
@@ -446,29 +467,30 @@ dependencies = [
446
467
 
447
468
  [[package]]
448
469
  name = "quote"
449
- version = "1.0.46"
470
+ version = "1.0.47"
450
471
  source = "registry+https://github.com/rust-lang/crates.io-index"
451
- checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
472
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
452
473
  dependencies = [
453
474
  "proc-macro2",
454
475
  ]
455
476
 
456
477
  [[package]]
457
478
  name = "refkit-core"
458
- version = "0.3.0"
479
+ version = "0.4.0"
459
480
  dependencies = [
460
481
  "biblatex",
461
482
  "hayagriva",
462
483
  "indexmap",
463
484
  "quick-xml",
464
485
  "serde",
486
+ "serde_json",
465
487
  "serde_yaml",
466
488
  "walkdir",
467
489
  ]
468
490
 
469
491
  [[package]]
470
492
  name = "refkit-native"
471
- version = "0.3.0"
493
+ version = "0.4.0"
472
494
  dependencies = [
473
495
  "pyo3",
474
496
  "refkit-core",
@@ -565,9 +587,9 @@ dependencies = [
565
587
 
566
588
  [[package]]
567
589
  name = "smallvec"
568
- version = "1.15.2"
590
+ version = "1.16.0"
569
591
  source = "registry+https://github.com/rust-lang/crates.io-index"
570
- checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"
592
+ checksum = "b9be42f50aa861c555654aa3a37f52f4b1074bacf4e48fe0ef7fa584e80f1f0f"
571
593
 
572
594
  [[package]]
573
595
  name = "stable_deref_trait"
@@ -593,14 +615,14 @@ dependencies = [
593
615
  "heck",
594
616
  "proc-macro2",
595
617
  "quote",
596
- "syn 2.0.118",
618
+ "syn 2.0.119",
597
619
  ]
598
620
 
599
621
  [[package]]
600
622
  name = "syn"
601
- version = "2.0.118"
623
+ version = "2.0.119"
602
624
  source = "registry+https://github.com/rust-lang/crates.io-index"
603
- checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
625
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
604
626
  dependencies = [
605
627
  "proc-macro2",
606
628
  "quote",
@@ -626,7 +648,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
626
648
  dependencies = [
627
649
  "proc-macro2",
628
650
  "quote",
629
- "syn 2.0.118",
651
+ "syn 2.0.119",
630
652
  ]
631
653
 
632
654
  [[package]]
@@ -637,29 +659,29 @@ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
637
659
 
638
660
  [[package]]
639
661
  name = "thiserror"
640
- version = "2.0.18"
662
+ version = "2.0.20"
641
663
  source = "registry+https://github.com/rust-lang/crates.io-index"
642
- checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
664
+ checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
643
665
  dependencies = [
644
666
  "thiserror-impl",
645
667
  ]
646
668
 
647
669
  [[package]]
648
670
  name = "thiserror-impl"
649
- version = "2.0.18"
671
+ version = "2.0.20"
650
672
  source = "registry+https://github.com/rust-lang/crates.io-index"
651
- checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
673
+ checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
652
674
  dependencies = [
653
675
  "proc-macro2",
654
676
  "quote",
655
- "syn 2.0.118",
677
+ "syn 3.0.5",
656
678
  ]
657
679
 
658
680
  [[package]]
659
681
  name = "tinystr"
660
- version = "0.8.3"
682
+ version = "0.8.4"
661
683
  source = "registry+https://github.com/rust-lang/crates.io-index"
662
- checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
684
+ checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643"
663
685
  dependencies = [
664
686
  "displaydoc",
665
687
  "serde_core",
@@ -668,9 +690,9 @@ dependencies = [
668
690
 
669
691
  [[package]]
670
692
  name = "tinyvec"
671
- version = "1.11.0"
693
+ version = "1.13.2"
672
694
  source = "registry+https://github.com/rust-lang/crates.io-index"
673
- checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
695
+ checksum = "4cf0ded5c4e56918d8f8a339e1bb67d038d3bc6d144ac407904015ba2e4cde9b"
674
696
  dependencies = [
675
697
  "tinyvec_macros",
676
698
  ]
@@ -721,7 +743,7 @@ checksum = "a1249a628de3ad34b821ecb1001355bca3940bcb2f88558f1a8bd82e977f75b5"
721
743
  dependencies = [
722
744
  "proc-macro-hack",
723
745
  "quote",
724
- "syn 2.0.118",
746
+ "syn 2.0.119",
725
747
  "unic-langid-impl",
726
748
  ]
727
749
 
@@ -825,9 +847,9 @@ checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
825
847
 
826
848
  [[package]]
827
849
  name = "writeable"
828
- version = "0.6.3"
850
+ version = "0.6.4"
829
851
  source = "registry+https://github.com/rust-lang/crates.io-index"
830
- checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
852
+ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
831
853
 
832
854
  [[package]]
833
855
  name = "yoke"
@@ -848,28 +870,28 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
848
870
  dependencies = [
849
871
  "proc-macro2",
850
872
  "quote",
851
- "syn 2.0.118",
873
+ "syn 2.0.119",
852
874
  "synstructure",
853
875
  ]
854
876
 
855
877
  [[package]]
856
878
  name = "zerocopy"
857
- version = "0.8.54"
879
+ version = "0.8.57"
858
880
  source = "registry+https://github.com/rust-lang/crates.io-index"
859
- checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19"
881
+ checksum = "d35102a9f36d089ccae9e4c6802bc118be4487b80aaffc0ab4e0cf5ce92d2873"
860
882
  dependencies = [
861
883
  "zerocopy-derive",
862
884
  ]
863
885
 
864
886
  [[package]]
865
887
  name = "zerocopy-derive"
866
- version = "0.8.54"
888
+ version = "0.8.57"
867
889
  source = "registry+https://github.com/rust-lang/crates.io-index"
868
- checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5"
890
+ checksum = "146c01f5ab44258da43cf276c74a2763db2ff3969c9c652c3f2de07041d0b2bc"
869
891
  dependencies = [
870
892
  "proc-macro2",
871
893
  "quote",
872
- "syn 2.0.118",
894
+ "syn 2.0.119",
873
895
  ]
874
896
 
875
897
  [[package]]
@@ -889,15 +911,15 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
889
911
  dependencies = [
890
912
  "proc-macro2",
891
913
  "quote",
892
- "syn 2.0.118",
914
+ "syn 2.0.119",
893
915
  "synstructure",
894
916
  ]
895
917
 
896
918
  [[package]]
897
919
  name = "zerotrie"
898
- version = "0.2.4"
920
+ version = "0.2.5"
899
921
  source = "registry+https://github.com/rust-lang/crates.io-index"
900
- checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
922
+ checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f"
901
923
  dependencies = [
902
924
  "displaydoc",
903
925
  "yoke",
@@ -907,9 +929,9 @@ dependencies = [
907
929
 
908
930
  [[package]]
909
931
  name = "zerovec"
910
- version = "0.11.6"
932
+ version = "0.11.8"
911
933
  source = "registry+https://github.com/rust-lang/crates.io-index"
912
- checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
934
+ checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8"
913
935
  dependencies = [
914
936
  "serde",
915
937
  "yoke",
@@ -919,17 +941,17 @@ dependencies = [
919
941
 
920
942
  [[package]]
921
943
  name = "zerovec-derive"
922
- version = "0.11.3"
944
+ version = "0.11.6"
923
945
  source = "registry+https://github.com/rust-lang/crates.io-index"
924
- checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
946
+ checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da"
925
947
  dependencies = [
926
948
  "proc-macro2",
927
949
  "quote",
928
- "syn 2.0.118",
950
+ "syn 3.0.5",
929
951
  ]
930
952
 
931
953
  [[package]]
932
954
  name = "zmij"
933
- version = "1.0.21"
955
+ version = "1.0.23"
934
956
  source = "registry+https://github.com/rust-lang/crates.io-index"
935
- checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
957
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,59 @@
1
+ [workspace]
2
+ members = ["crates/refkit-core", "packages/refkit/rust"]
3
+ resolver = "3"
4
+
5
+ [workspace.package]
6
+ version = "0.4.0"
7
+ edition = "2024"
8
+ rust-version = "1.95"
9
+ license = "Apache-2.0"
10
+ repository = "https://github.com/peter-gy/refkit"
11
+
12
+ [workspace.dependencies]
13
+ pyo3 = "0.29.0"
14
+ refkit-core = { version = "0.4.0", path = "crates/refkit-core" }
15
+ serde = { version = "1.0.228", features = ["derive"] }
16
+ serde_json = "1.0.150"
17
+
18
+ [profile.release]
19
+ lto = "thin"
20
+ codegen-units = 1
21
+ strip = true
22
+
23
+ [patch.crates-io]
24
+ citationberg = {git = "https://github.com/typst/citationberg", rev = "06a591e2f237d25e1dfdedac3f3d1494c496c52d"}
25
+
26
+ [workspace.lints.rust]
27
+ unsafe_code = "deny"
28
+ unused_must_use = "deny"
29
+ unused_imports = "deny"
30
+ unused_variables = "deny"
31
+ dead_code = "deny"
32
+ unfulfilled_lint_expectations = "deny"
33
+ missing_docs = "deny"
34
+
35
+ [workspace.lints.clippy]
36
+ all = { level = "deny", priority = -1 }
37
+ pedantic = { level = "deny", priority = -1 }
38
+ allow_attributes = "deny"
39
+ allow_attributes_without_reason = "deny"
40
+ dbg_macro = "deny"
41
+ todo = "deny"
42
+ unimplemented = "deny"
43
+ unwrap_used = "deny"
44
+ expect_used = "deny"
45
+ panic = "deny"
46
+ print_stdout = "deny"
47
+ print_stderr = "deny"
48
+ wildcard_imports = "deny"
49
+ undocumented_unsafe_blocks = "deny"
50
+ multiple_unsafe_ops_per_block = "deny"
51
+ excessive_nesting = "deny"
52
+ indexing_slicing = "deny"
53
+ clone_on_ref_ptr = "deny"
54
+ redundant_clone = "deny"
55
+ needless_pass_by_value = "deny"
56
+ large_stack_arrays = "deny"
57
+ large_futures = "deny"
58
+ missing_errors_doc = "deny"
59
+ missing_panics_doc = "deny"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: refkit
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -25,7 +25,9 @@ Project-URL: Repository, https://github.com/peter-gy/refkit
25
25
 
26
26
  # RefKit
27
27
 
28
- Parse bibliography data, render citations and bibliographies, and edit raw BibTeX from Python. RefKit accepts BibTeX, BibLaTeX, and [Hayagriva YAML](https://github.com/typst/hayagriva), with [Citation Style Language](https://citationstyles.org/) rendering into text, HTML, and structured trees.
28
+ Parse bibliography data, render citations and bibliographies, and edit raw BibTeX from Python. RefKit accepts BibTeX, BibLaTeX, [Hayagriva YAML](https://github.com/typst/hayagriva), and CSL-JSON, with [Citation Style Language](https://citationstyles.org/) rendering into text, HTML, and structured trees. Construct libraries from structured records or [convert formats with loss reports](https://peter-gy.github.io/refkit/guides/convert-bibliographies).
29
+
30
+ `BibDocument.apply_patch` applies atomic entry and field edits and returns a new snapshot with byte changes and occurrence mappings. Existing handles retain their original values and spans. The [raw editing guide](https://peter-gy.github.io/refkit/guides/edit-bibtex) covers patch operations and reference rewrites.
29
31
 
30
32
  [Documentation](https://peter-gy.github.io/refkit/) · [Python reference](https://peter-gy.github.io/refkit/reference/python) · [Polars](https://peter-gy.github.io/refkit/guides/polars)
31
33
 
@@ -1,6 +1,8 @@
1
1
  # RefKit
2
2
 
3
- Parse bibliography data, render citations and bibliographies, and edit raw BibTeX from Python. RefKit accepts BibTeX, BibLaTeX, and [Hayagriva YAML](https://github.com/typst/hayagriva), with [Citation Style Language](https://citationstyles.org/) rendering into text, HTML, and structured trees.
3
+ Parse bibliography data, render citations and bibliographies, and edit raw BibTeX from Python. RefKit accepts BibTeX, BibLaTeX, [Hayagriva YAML](https://github.com/typst/hayagriva), and CSL-JSON, with [Citation Style Language](https://citationstyles.org/) rendering into text, HTML, and structured trees. Construct libraries from structured records or [convert formats with loss reports](https://peter-gy.github.io/refkit/guides/convert-bibliographies).
4
+
5
+ `BibDocument.apply_patch` applies atomic entry and field edits and returns a new snapshot with byte changes and occurrence mappings. Existing handles retain their original values and spans. The [raw editing guide](https://peter-gy.github.io/refkit/guides/edit-bibtex) covers patch operations and reference rewrites.
4
6
 
5
7
  [Documentation](https://peter-gy.github.io/refkit/) · [Python reference](https://peter-gy.github.io/refkit/reference/python) · [Polars](https://peter-gy.github.io/refkit/guides/polars)
6
8