libbbf 0.2.4__cp312-cp312-win32.whl → 0.2.13__cp312-cp312-win32.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: libbbf
3
- Version: 0.2.4
3
+ Version: 0.2.13
4
4
  Summary: Bound Book Format (BBF) tools and bindings
5
5
  Home-page: https://github.com/ef1500/libbbf
6
6
  Author: EF1500
@@ -23,7 +23,7 @@ Dynamic: summary
23
23
 
24
24
  ## Project Overview
25
25
 
26
- `libbbf-python` provides Python bindings and command-line tools for the Bound Book Format (BBF). The Bound Book Format is an archive format designed for digital books and comics. This package allows Python developers to programmatically create and read `.bbf` files, and provides convenient command-line utilities to convert between common archive formats (like CBZ/CBX) and BBF.
26
+ `libbbf-python` provides Python bindings and command-line tools for the [Bound Book Format (BBF)](https://github.com/ef1500/libbbf). The Bound Book Format is an archive format designed for digital books and comics. This package allows Python developers to programmatically create and read `.bbf` files, and provides convenient command-line utilities to convert between common archive formats (like CBZ/CBX) and BBF.
27
27
 
28
28
  The core of `libbbf-python` is a `pybind11` wrapper around the high-performance C++ `libbbf` library, ensuring speed and native integration.
29
29
 
@@ -53,7 +53,8 @@ Once installed, two command-line tools will be available globally: `cbx2bbf` and
53
53
  ### `cbx2bbf`: Create BBF Files from CBZ/Images
54
54
 
55
55
  **Usage:**
56
- ```cbx2bbf <inputs...> [options] --output <output.bbf>
56
+ ```
57
+ cbx2bbf <inputs...> [options] --output <output.bbf>
57
58
  ```
58
59
 
59
60
  **Inputs:**
@@ -132,6 +133,60 @@ bbf2cbx <input.bbf> [options] --output <output.cbz_or_dir>
132
133
  bbf2cbx series.bbf --info
133
134
  ```
134
135
 
136
+ ## Using `libbbf`
137
+
138
+ You can also interface libbbf directly from python.
139
+
140
+ Example 1: Creating a .bbf file
141
+ ```python
142
+ from libbbf import BBFBuilder
143
+ import os
144
+
145
+ # Create a new Bound Book
146
+ builder = BBFBuilder("my_comic.bbf")
147
+
148
+ # Add Metadata
149
+ builder.add_metadata("Title", "Solo Leveling")
150
+ builder.add_metadata("Author", "Chugong")
151
+
152
+ # Add Pages (Assets are automatically deduplicated by hash!)
153
+ page_files = sorted(os.listdir("./chapter_images"))
154
+ for i, filename in enumerate(page_files):
155
+ full_path = os.path.join("./chapter_images", filename)
156
+
157
+ # Flags: 0 = Standard
158
+ builder.add_page(full_path, type=1, flags=0)
159
+
160
+ # Define a Chapter every 20 pages
161
+ if i % 20 == 0:
162
+ builder.add_section(f"Chapter {i // 20 + 1}", start_page=i)
163
+
164
+ # Finalize writes the footer and optimized tables
165
+ builder.finalize()
166
+ print("BBF created successfully.")
167
+ ```
168
+
169
+ Example 2: Verifying a .bbf file
170
+ ```python
171
+ import libbbf
172
+ import time
173
+
174
+ reader = libbbf.BBFReader("massive_archive.bbf")
175
+
176
+ print("Verifying file integrity...")
177
+ start = time.time()
178
+
179
+ # This releases the GIL, so it's thread-safe and incredibly fast
180
+ is_valid = reader.verify()
181
+
182
+ end = time.time()
183
+
184
+ if is_valid:
185
+ print(f"SUCCESS: Integrity verified in {end - start:.4f}s")
186
+ else:
187
+ print("ERROR: Corruption detected!")
188
+ ```
189
+
135
190
  ## Contributing
136
191
 
137
192
  Contributions, issues, and feature requests are welcome! For libbbf, free to check the [issues page](https://github.com/ef1500/libbbf/issues) (or create one if it doesn't exist yet).
@@ -0,0 +1,9 @@
1
+ libbbf.cp312-win32.pyd,sha256=64db_SpECd3TJAMLbZCVN29vdRg4AQTKSL66AtXWIEY,246272
2
+ libbbf_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ libbbf_tools/bbf2cbx.py,sha256=HbPmcVOUSTgVnkPpXEJCTRYesIhcYnn0rA91oGC9XKI,4314
4
+ libbbf_tools/cbx2bbf.py,sha256=n9qsPojUqnm_2yFyBWB4q5_4J71_lZjVdz9L8LIYLTQ,8107
5
+ libbbf-0.2.13.dist-info/METADATA,sha256=3Hv-VSbobLJtJbjTUZXsDYvDN54dbc_3NUUJHwcZ4b4,7491
6
+ libbbf-0.2.13.dist-info/WHEEL,sha256=3-JGBxlfJ7cpG1EEEM2PrRJYpl2Lix3zyWKiPlGiWWY,97
7
+ libbbf-0.2.13.dist-info/entry_points.txt,sha256=7qX-_x7iM2ygeZmkpL_bLEuJY1TlifTetaprHlK39hA,90
8
+ libbbf-0.2.13.dist-info/top_level.txt,sha256=DM4mwVaAZp8aBb8KOwCvyYCev1_RMhsj3lXjBWDnbJc,20
9
+ libbbf-0.2.13.dist-info/RECORD,,
libbbf.cp312-win32.pyd CHANGED
Binary file
@@ -1,9 +0,0 @@
1
- libbbf.cp312-win32.pyd,sha256=NMLCloFzmYQc4OkOJtHVBjlBOJ2p5gX6fZo_-T6iP0M,240640
2
- libbbf_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- libbbf_tools/bbf2cbx.py,sha256=HbPmcVOUSTgVnkPpXEJCTRYesIhcYnn0rA91oGC9XKI,4314
4
- libbbf_tools/cbx2bbf.py,sha256=n9qsPojUqnm_2yFyBWB4q5_4J71_lZjVdz9L8LIYLTQ,8107
5
- libbbf-0.2.4.dist-info/METADATA,sha256=WBPIrNkDde5UEM3JEJ8uWA-0TYRIrH8Fcfa5Re8NDR4,6123
6
- libbbf-0.2.4.dist-info/WHEEL,sha256=3-JGBxlfJ7cpG1EEEM2PrRJYpl2Lix3zyWKiPlGiWWY,97
7
- libbbf-0.2.4.dist-info/entry_points.txt,sha256=7qX-_x7iM2ygeZmkpL_bLEuJY1TlifTetaprHlK39hA,90
8
- libbbf-0.2.4.dist-info/top_level.txt,sha256=DM4mwVaAZp8aBb8KOwCvyYCev1_RMhsj3lXjBWDnbJc,20
9
- libbbf-0.2.4.dist-info/RECORD,,