bxc 1.1.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 (54) hide show
  1. bxc-1.1.0/.gitignore +28 -0
  2. bxc-1.1.0/CHANGELOG.md +68 -0
  3. bxc-1.1.0/LICENSE +176 -0
  4. bxc-1.1.0/NOTICE +14 -0
  5. bxc-1.1.0/PKG-INFO +130 -0
  6. bxc-1.1.0/README.md +99 -0
  7. bxc-1.1.0/build_packages.py +553 -0
  8. bxc-1.1.0/packaging/publish_release.py +108 -0
  9. bxc-1.1.0/packaging/requirements.txt +87 -0
  10. bxc-1.1.0/pyproject.toml +86 -0
  11. bxc-1.1.0/src/bxc/__init__.py +76 -0
  12. bxc-1.1.0/src/bxc/author.py +62 -0
  13. bxc-1.1.0/src/bxc/cache.py +450 -0
  14. bxc-1.1.0/src/bxc/cli.py +191 -0
  15. bxc-1.1.0/src/bxc/exceptions.py +17 -0
  16. bxc-1.1.0/src/bxc/formatter.py +720 -0
  17. bxc-1.1.0/src/bxc/latex.py +205 -0
  18. bxc-1.1.0/src/bxc/parser.py +221 -0
  19. bxc-1.1.0/src/bxc/py.typed +0 -0
  20. bxc-1.1.0/src/bxc/registry.py +133 -0
  21. bxc-1.1.0/src/bxc/styles_bundle.tar.xz +0 -0
  22. bxc-1.1.0/src/bxc/styles_index.json +1 -0
  23. bxc-1.1.0/tests/__init__.py +1 -0
  24. bxc-1.1.0/tests/e2e/__init__.py +1 -0
  25. bxc-1.1.0/tests/e2e/conftest.py +184 -0
  26. bxc-1.1.0/tests/e2e/test_api.py +107 -0
  27. bxc-1.1.0/tests/e2e/test_cache_cmd.py +143 -0
  28. bxc-1.1.0/tests/e2e/test_cli.py +119 -0
  29. bxc-1.1.0/tests/e2e/test_combinations.py +128 -0
  30. bxc-1.1.0/tests/e2e/test_formats.py +115 -0
  31. bxc-1.1.0/tests/e2e/test_latex.py +134 -0
  32. bxc-1.1.0/tests/e2e/test_local_csl.py +164 -0
  33. bxc-1.1.0/tests/e2e/test_norm.py +147 -0
  34. bxc-1.1.0/tests/e2e/test_parsing.py +119 -0
  35. bxc-1.1.0/tests/e2e/test_registry.py +106 -0
  36. bxc-1.1.0/tests/e2e/test_remote.py +172 -0
  37. bxc-1.1.0/tests/e2e/test_selection.py +117 -0
  38. bxc-1.1.0/tests/e2e/test_workloads.py +133 -0
  39. bxc-1.1.0/tests/test_adversarial_wave2.py +230 -0
  40. bxc-1.1.0/tests/test_adversarial_wave3.py +211 -0
  41. bxc-1.1.0/tests/test_build_packages.py +98 -0
  42. bxc-1.1.0/tests/test_cache.py +538 -0
  43. bxc-1.1.0/tests/test_challenger_wave2.py +233 -0
  44. bxc-1.1.0/tests/test_cli.py +221 -0
  45. bxc-1.1.0/tests/test_cli_cache_fixes.py +106 -0
  46. bxc-1.1.0/tests/test_formatter.py +150 -0
  47. bxc-1.1.0/tests/test_output_safety.py +110 -0
  48. bxc-1.1.0/tests/test_parser.py +272 -0
  49. bxc-1.1.0/tests/test_parser_fixes.py +78 -0
  50. bxc-1.1.0/tests/test_publish_release.py +94 -0
  51. bxc-1.1.0/tests/test_registry.py +136 -0
  52. bxc-1.1.0/tests/test_release_metadata.py +30 -0
  53. bxc-1.1.0/tests/test_robustness_stress.py +80 -0
  54. bxc-1.1.0/tests/test_stress.py +101 -0
bxc-1.1.0/.gitignore ADDED
@@ -0,0 +1,28 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ venv/
4
+ .venv/
5
+ .env
6
+
7
+ # Antigravity / Agents
8
+ .agents/
9
+
10
+ # Build and Testing
11
+ dist/
12
+ .pytest_cache/
13
+ test_failures.log
14
+ test_trace.py
15
+ .coverage
16
+ coverage.xml
17
+ *.log
18
+
19
+ # Infra config that doesn't belong in this project (Forgejo/runner secrets)
20
+ app.ini
21
+ runner*.yaml
22
+ dind_config*.yaml
23
+
24
+ # Personal git/GPG workflow scripts, not part of the bxc project
25
+ do_merge.sh
26
+ gen_gpg.sh
27
+ gpg-batch
28
+ fchicout.pub.asc
bxc-1.1.0/CHANGELOG.md ADDED
@@ -0,0 +1,68 @@
1
+ # Changelog
2
+
3
+ All notable changes to bxc are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.1.0] - 2026-09-30
10
+
11
+ First release prepared for PyPI. It fixes the problems found by the pre-release security,
12
+ quality, performance and packaging audits and adds native installers.
13
+
14
+ ### Security
15
+ - HTML output no longer emits raw markup from the `year`, `date` and `type` BibTeX fields; every
16
+ string is escaped in one place before it reaches the output.
17
+ - Links are only created for plain `http://` and `https://` URLs. A `url` field such as
18
+ `javascript:...` is shown as text, and URLs can no longer break out of the HTML attribute or the
19
+ Markdown link.
20
+ - Markdown output escapes `<` and strips all attributes from `<sup>`/`<sub>`, so data cannot inject HTML.
21
+ - Style names are validated (`--style`, and `independent-parent` links inside styles). Path
22
+ separators, `..` and absolute paths are rejected instead of writing files outside the cache.
23
+ - Tag-matching regular expressions and the style-search wildcard run in linear time, so crafted
24
+ input can no longer stall the program.
25
+ - The SonarQube badge token was removed from the README (it would have been published on PyPI).
26
+
27
+ ### Fixed
28
+ - `$`, `<` and `>` in titles are kept in plain and Markdown output (a price like `$100` or
29
+ `Price < 5` used to lose characters). Math delimiters such as `$x$` are still dropped, and an
30
+ escaped `\$` renders as `$`.
31
+ - Numeric styles print a space after the label (`[1] J. Smith` instead of `[1]J. Smith`).
32
+ - Non-standard entry types (`@online`, `@software`, `@dataset`, ...) are no longer silently dropped.
33
+ - Author names: `{Institution Name}` stays one name, `and others` becomes "et al.", and
34
+ `Smith, Jr., John` keeps the suffix.
35
+ - Case-protection braces (`{DNA}`) no longer leak into the output, and page ranges written
36
+ with `--` become an en dash.
37
+ - A field with hundreds of `{...}` groups no longer fails with a recursion error.
38
+ - `--mode citation` without `--cite` no longer crashes.
39
+ - `bxc cache update` and `bxc cache rebuild` no longer always fail: upstream publishes no style
40
+ index, so the bundled one is installed instead.
41
+ - Output to a terminal or pipe that cannot represent a character no longer crashes the CLI.
42
+
43
+ ### Changed
44
+ - **Duplicate citation keys are now an error** (`BibTeXParseError`). Previously the first entry
45
+ was silently dropped.
46
+ - `update_cache()` returns `False` when it installed the bundled index because the remote has none
47
+ (it returns `True` when it downloaded one).
48
+ - The license metadata now says **Apache-2.0**, matching the `LICENSE` file (it said MIT). The
49
+ bundled CSL styles (CC BY-SA 3.0) are credited in `NOTICE`.
50
+ - The bundled style index is generated from the bundled styles: 10,852 styles with real titles,
51
+ categories and parents (it had 10 hand-written entries). `bxc search` now covers them all.
52
+ - Python 3.12, 3.13 and 3.14 are listed and tested; the package ships `py.typed`.
53
+
54
+ ### Added
55
+ - Native installers, attached to each release with a `SHA256SUMS` file:
56
+ `.deb` (Debian 13+, Ubuntu 24.04+), `.rpm` (Fedora 40+, RHEL/AlmaLinux 10+) and a Windows x64
57
+ `.msi` that bundles its own Python and adds `bxc` to the `PATH`. The Windows installer is not
58
+ code-signed.
59
+ - `--debug` prints the full traceback for unexpected errors.
60
+ - CI builds the wheel, sdist and all three installers on every change and runs the tests on
61
+ Python 3.12, 3.13 and 3.14; pushing a `v*` tag publishes a Forgejo release.
62
+ - This changelog, and an exit-code table in the README (0 success, 1 error, 2 usage, 130 interrupted).
63
+
64
+ ### Removed
65
+ - The GitHub issue-sync and GitHub release workflows. The old `.msi` (a renamed zip) is replaced by the real installer above.
66
+
67
+ [Unreleased]: https://forgejo.fchicout.dev/fchicout/bxc/compare/v1.1.0...HEAD
68
+ [1.1.0]: https://forgejo.fchicout.dev/fchicout/bxc/compare/v1.0.1...v1.1.0
bxc-1.1.0/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. for the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such patent license applies only to those patent claims
79
+ licensable by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
bxc-1.1.0/NOTICE ADDED
@@ -0,0 +1,14 @@
1
+ bxc (Bibliographic Reference Formatter)
2
+ Copyright 2026 fchicout
3
+
4
+ This product includes software developed by the bxc project contributors.
5
+ https://forgejo.fchicout.dev/fchicout/bxc
6
+
7
+ Bundled third-party data
8
+ ------------------------
9
+ src/bxc/styles_bundle.tar.xz contains a snapshot of the Citation Style Language
10
+ (CSL) styles repository, https://github.com/citation-style-language/styles,
11
+ Copyright the CSL style authors and contributors, licensed under the Creative
12
+ Commons Attribution-ShareAlike 3.0 Unported license
13
+ (https://creativecommons.org/licenses/by-sa/3.0/). Each style file carries its
14
+ own author and license metadata. The styles are redistributed unmodified.
bxc-1.1.0/PKG-INFO ADDED
@@ -0,0 +1,130 @@
1
+ Metadata-Version: 2.5
2
+ Name: bxc
3
+ Version: 1.1.0
4
+ Summary: A lightweight Python library and CLI tool to format BibTeX references using CSL
5
+ Project-URL: Homepage, https://forgejo.fchicout.dev/fchicout/bxc
6
+ Project-URL: Issues, https://forgejo.fchicout.dev/fchicout/bxc/issues
7
+ Author-email: Fabio Chicout <fchicout@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Keywords: bibliography,bibtex,citation,csl,references
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Text Processing :: Markup
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: bibtexparser<2.0.0,>=1.4.3
22
+ Requires-Dist: citeproc-py>=0.6.0
23
+ Requires-Dist: platformdirs>=4.0.0
24
+ Provides-Extra: lint
25
+ Requires-Dist: mypy>=2.0.0; extra == 'lint'
26
+ Requires-Dist: ruff>=0.14.0; extra == 'lint'
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
29
+ Requires-Dist: pytest>=8.0.0; extra == 'test'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # bxc (Bibliographic Reference Formatter)
33
+
34
+ A lightweight Python library and Command Line Interface (CLI) tool designed to format BibTeX bibliography records into academic styles (like IEEE, ABNT, ACM) using **Citation Style Language (CSL)**. It natively outputs to Markdown, HTML, and Plain Text, making it perfect for static blogs, documentation websites, and automated citation pipelines.
35
+
36
+ ---
37
+
38
+ ## Key Features
39
+
40
+ * **Zero-Configuration UX:** Automatically resolves, downloads, and caches standard academic styles (e.g., `ieee`, `nature`, `abnt`) on demand from the official CSL repositories.
41
+ * **Offline-First Style Resolution:** Ships with a bundled, compressed snapshot of the entire CSL styles repository (10,000+ styles, ~1.4MB). Style lookups check this local archive before ever touching the network, so `bxc format` works instantly and fully offline for any standard style - the CDN is only used for brand-new styles not yet in the bundle, or when explicitly syncing (`bxc cache update` / `bxc cache rebuild`).
42
+ * **LaTeX to Unicode Normalization:** Seamlessly cleans and converts LaTeX accent escape codes (like `{\`e}`, `\c{c}`) to standard Unicode (e.g., `è`, `ç`) prior to formatting.
43
+ * **Multiple Output Targets:** Renders styled reference lists natively to Markdown, HTML, and Plain Text.
44
+ * **Local Cross-Platform Caching:** Caches downloaded styles locally according to OS-native standards (`~/.cache/bxc/` on Linux, `~/Library/Caches/bxc/` on macOS, `%LOCALAPPDATA%\\bxc\\Cache` on Windows; run `bxc cache status` to see yours).
45
+ * **Flexible Interface:** Use it as a terminal CLI tool or import it as a standard Python library.
46
+
47
+ ---
48
+
49
+ ## Installation
50
+
51
+ Requires Python 3.12 or newer.
52
+
53
+ **pip / pipx** (any platform):
54
+
55
+ ```bash
56
+ pipx install bxc # or: pip install bxc
57
+ ```
58
+
59
+ **Native installers** are attached to each release on the project page, with a `SHA256SUMS` file to verify them:
60
+
61
+ | Platform | Package | Install |
62
+ |---|---|---|
63
+ | Debian 13+, Ubuntu 24.04+ | `bxc_<version>_all.deb` | `sudo apt install ./bxc_<version>_all.deb` |
64
+ | Fedora 40+, RHEL / AlmaLinux 10+ | `bxc-<version>-1.noarch.rpm` | `sudo dnf install ./bxc-<version>-1.noarch.rpm` |
65
+ | Windows 10+ (x64) | `bxc-<version>-x64.msi` | double-click, or `msiexec /i bxc-<version>-x64.msi` |
66
+
67
+ The deb and rpm bundle bxc's pure-Python dependencies and use your distribution's `python3` and `python3-lxml`; the package manager installs them for you. They need Python 3.12+, so older distributions (Debian 12, Ubuntu 22.04, RHEL 9) should use `pipx` instead. The Windows installer is self-contained (it ships its own Python) and adds `bxc` to the system `PATH`; it is not code-signed, so Windows SmartScreen may warn on first run. Open a new terminal after installing.
68
+
69
+ ---
70
+
71
+ ## Quick Start
72
+
73
+ ### Command Line Interface (CLI)
74
+
75
+ Format a `.bib` file to Markdown using IEEE style:
76
+ ```bash
77
+ bxc format citations.bib --style ieee --output markdown
78
+ ```
79
+
80
+ Search for a citation style:
81
+ ```bash
82
+ bxc search "ABNT"
83
+ ```
84
+
85
+ Clear, sync, or inspect the local cache:
86
+ ```bash
87
+ bxc cache update # refresh the style search index from the CDN
88
+ bxc cache rebuild # re-download every cached style from the CDN (sync with CDN)
89
+ bxc cache status # show cache location and stats
90
+ bxc cache clear # remove all cached styles and the index
91
+ ```
92
+
93
+ `bxc cache update` and `bxc cache rebuild` are the commands that talk to the CDN on purpose - they're how you get styles fresher than the bundled snapshot. Everyday `bxc format` calls never need them: they resolve styles from the bundled local archive first (see [Offline-First Style Resolution](#key-features) above), which is why bxc works out of the box without a network connection.
94
+
95
+ Maintainers can refresh that bundled archive itself (a periodic task, not something end users run) with:
96
+ ```bash
97
+ python build_styles_bundle.py
98
+ ```
99
+
100
+ ### Python API
101
+
102
+ ```python
103
+ import bxc
104
+
105
+ # Parses, converts LaTeX escapes, fetches CSL, and formats citation
106
+ markdown_ref = bxc.format_bibtex(
107
+ bibtex_source="@article{smith2026, ...}",
108
+ style="ieee",
109
+ output_format="markdown"
110
+ )
111
+
112
+ print(markdown_ref)
113
+ ```
114
+
115
+ ---
116
+
117
+ ## CLI reference
118
+
119
+ `bxc format [BIB] --style STYLE [--output plain|markdown|html] [--mode bibliography|citation] [--cite KEYS] [--out-file PATH]`
120
+
121
+ * `BIB` (or `--bib/-b`): path to a `.bib` file; use `-` to read from stdin.
122
+ * `--style/-s`: a CSL style name (e.g. `ieee`, `apa`) or the path to a local `.csl` file.
123
+ * `--cite/-c`: comma-separated citation keys to format.
124
+ * Exit codes: `0` success, `1` error (parse failure, style not found, ...), `2` invalid usage, `130` interrupted.
125
+
126
+ `bxc search [QUERY] [--category CATEGORY]` searches the style registry; `bxc cache {status,update,rebuild,clear}` manages the local cache.
127
+
128
+ ## License
129
+
130
+ Apache License 2.0. The bundled CSL styles are from the [Citation Style Language styles repository](https://github.com/citation-style-language/styles) and are licensed under CC BY-SA 3.0; see `NOTICE`.
bxc-1.1.0/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # bxc (Bibliographic Reference Formatter)
2
+
3
+ A lightweight Python library and Command Line Interface (CLI) tool designed to format BibTeX bibliography records into academic styles (like IEEE, ABNT, ACM) using **Citation Style Language (CSL)**. It natively outputs to Markdown, HTML, and Plain Text, making it perfect for static blogs, documentation websites, and automated citation pipelines.
4
+
5
+ ---
6
+
7
+ ## Key Features
8
+
9
+ * **Zero-Configuration UX:** Automatically resolves, downloads, and caches standard academic styles (e.g., `ieee`, `nature`, `abnt`) on demand from the official CSL repositories.
10
+ * **Offline-First Style Resolution:** Ships with a bundled, compressed snapshot of the entire CSL styles repository (10,000+ styles, ~1.4MB). Style lookups check this local archive before ever touching the network, so `bxc format` works instantly and fully offline for any standard style - the CDN is only used for brand-new styles not yet in the bundle, or when explicitly syncing (`bxc cache update` / `bxc cache rebuild`).
11
+ * **LaTeX to Unicode Normalization:** Seamlessly cleans and converts LaTeX accent escape codes (like `{\`e}`, `\c{c}`) to standard Unicode (e.g., `è`, `ç`) prior to formatting.
12
+ * **Multiple Output Targets:** Renders styled reference lists natively to Markdown, HTML, and Plain Text.
13
+ * **Local Cross-Platform Caching:** Caches downloaded styles locally according to OS-native standards (`~/.cache/bxc/` on Linux, `~/Library/Caches/bxc/` on macOS, `%LOCALAPPDATA%\\bxc\\Cache` on Windows; run `bxc cache status` to see yours).
14
+ * **Flexible Interface:** Use it as a terminal CLI tool or import it as a standard Python library.
15
+
16
+ ---
17
+
18
+ ## Installation
19
+
20
+ Requires Python 3.12 or newer.
21
+
22
+ **pip / pipx** (any platform):
23
+
24
+ ```bash
25
+ pipx install bxc # or: pip install bxc
26
+ ```
27
+
28
+ **Native installers** are attached to each release on the project page, with a `SHA256SUMS` file to verify them:
29
+
30
+ | Platform | Package | Install |
31
+ |---|---|---|
32
+ | Debian 13+, Ubuntu 24.04+ | `bxc_<version>_all.deb` | `sudo apt install ./bxc_<version>_all.deb` |
33
+ | Fedora 40+, RHEL / AlmaLinux 10+ | `bxc-<version>-1.noarch.rpm` | `sudo dnf install ./bxc-<version>-1.noarch.rpm` |
34
+ | Windows 10+ (x64) | `bxc-<version>-x64.msi` | double-click, or `msiexec /i bxc-<version>-x64.msi` |
35
+
36
+ The deb and rpm bundle bxc's pure-Python dependencies and use your distribution's `python3` and `python3-lxml`; the package manager installs them for you. They need Python 3.12+, so older distributions (Debian 12, Ubuntu 22.04, RHEL 9) should use `pipx` instead. The Windows installer is self-contained (it ships its own Python) and adds `bxc` to the system `PATH`; it is not code-signed, so Windows SmartScreen may warn on first run. Open a new terminal after installing.
37
+
38
+ ---
39
+
40
+ ## Quick Start
41
+
42
+ ### Command Line Interface (CLI)
43
+
44
+ Format a `.bib` file to Markdown using IEEE style:
45
+ ```bash
46
+ bxc format citations.bib --style ieee --output markdown
47
+ ```
48
+
49
+ Search for a citation style:
50
+ ```bash
51
+ bxc search "ABNT"
52
+ ```
53
+
54
+ Clear, sync, or inspect the local cache:
55
+ ```bash
56
+ bxc cache update # refresh the style search index from the CDN
57
+ bxc cache rebuild # re-download every cached style from the CDN (sync with CDN)
58
+ bxc cache status # show cache location and stats
59
+ bxc cache clear # remove all cached styles and the index
60
+ ```
61
+
62
+ `bxc cache update` and `bxc cache rebuild` are the commands that talk to the CDN on purpose - they're how you get styles fresher than the bundled snapshot. Everyday `bxc format` calls never need them: they resolve styles from the bundled local archive first (see [Offline-First Style Resolution](#key-features) above), which is why bxc works out of the box without a network connection.
63
+
64
+ Maintainers can refresh that bundled archive itself (a periodic task, not something end users run) with:
65
+ ```bash
66
+ python build_styles_bundle.py
67
+ ```
68
+
69
+ ### Python API
70
+
71
+ ```python
72
+ import bxc
73
+
74
+ # Parses, converts LaTeX escapes, fetches CSL, and formats citation
75
+ markdown_ref = bxc.format_bibtex(
76
+ bibtex_source="@article{smith2026, ...}",
77
+ style="ieee",
78
+ output_format="markdown"
79
+ )
80
+
81
+ print(markdown_ref)
82
+ ```
83
+
84
+ ---
85
+
86
+ ## CLI reference
87
+
88
+ `bxc format [BIB] --style STYLE [--output plain|markdown|html] [--mode bibliography|citation] [--cite KEYS] [--out-file PATH]`
89
+
90
+ * `BIB` (or `--bib/-b`): path to a `.bib` file; use `-` to read from stdin.
91
+ * `--style/-s`: a CSL style name (e.g. `ieee`, `apa`) or the path to a local `.csl` file.
92
+ * `--cite/-c`: comma-separated citation keys to format.
93
+ * Exit codes: `0` success, `1` error (parse failure, style not found, ...), `2` invalid usage, `130` interrupted.
94
+
95
+ `bxc search [QUERY] [--category CATEGORY]` searches the style registry; `bxc cache {status,update,rebuild,clear}` manages the local cache.
96
+
97
+ ## License
98
+
99
+ Apache License 2.0. The bundled CSL styles are from the [Citation Style Language styles repository](https://github.com/citation-style-language/styles) and are licensed under CC BY-SA 3.0; see `NOTICE`.