numbers-parser 4.4.7__py3-none-any.whl → 4.4.8__py3-none-any.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.
@@ -291,8 +291,15 @@ class CellStorage(Cacheable):
291
291
  stored_filename = [x.file_name for x in datas if x.identifier == image_id][0]
292
292
  preferred_filename = [x.preferred_file_name for x in datas if x.identifier == image_id][0]
293
293
  all_paths = self.model.objects.file_store.keys()
294
- image_pathname = [x for x in all_paths if x == f"Data/{stored_filename}"][0]
295
- return (self.model.objects.file_store[image_pathname], preferred_filename)
294
+ image_pathnames = [x for x in all_paths if x == f"Data/{stored_filename}"]
295
+ if len(image_pathnames) == 0:
296
+ warn(
297
+ f"Cannot find file '{preferred_filename}' in Numbers archive",
298
+ RuntimeWarning,
299
+ stacklevel=3,
300
+ )
301
+ else:
302
+ return (self.model.objects.file_store[image_pathnames[0]], preferred_filename)
296
303
 
297
304
  def custom_format(self) -> str:
298
305
  if self.text_format_id is not None and self.type == CellType.TEXT:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: numbers-parser
3
- Version: 4.4.7
3
+ Version: 4.4.8
4
4
  Summary: Read and write Apple Numbers spreadsheets
5
5
  Home-page: https://github.com/masaccio/numbers-parser
6
6
  License: MIT
@@ -19,7 +19,6 @@ Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
19
19
  Requires-Dist: compact-json (>=1.1.3,<2.0.0)
20
20
  Requires-Dist: pendulum (>=3.0,<4.0)
21
21
  Requires-Dist: protobuf (>=4.21.1,<5.0.0)
22
- Requires-Dist: pylama (>=8.4.1,<9.0.0)
23
22
  Requires-Dist: python-snappy (>=0.6.1,<0.7.0)
24
23
  Requires-Dist: regex (>=2022.9.13,<2023.0.0)
25
24
  Requires-Dist: roman (>=3.3,<4.0)
@@ -284,6 +283,8 @@ with open (cell.style.bg_image.filename, "wb") as f:
284
283
  f.write(cell.style.bg_image.data)
285
284
  ```
286
285
 
286
+ Due to a limitation in Python's [ZipFile](https://docs.python.org/3/library/zipfile.html), Python versions older than 3.11 do not support image filenames with UTF-8 characters (see [issue 69](https://github.com/masaccio/numbers-parser/issues/69)). `cell.style.bg_image` returns `None` for such files and issues a `RuntimeWarning`.
287
+
287
288
  ### Borders
288
289
 
289
290
  `numbers-parser` supports reading and writing cell borders, though the interface for each differs. Individual cells can have each of their four borders tested, but when drawing new borders, these are set for the table to allow for drawing borders across multiple cells. Setting the border of merged cells is not possible unless the edge of the cells is at the end of the merged region.
@@ -3,7 +3,7 @@ numbers_parser/_cat_numbers.py,sha256=-HboBJT11Vjcr8sjLZl7Z6qAapnPEc_kFYq6PTqON2
3
3
  numbers_parser/_unpack_numbers.py,sha256=zfpBOfM92rMHSRQVR4tExf0fWI2Lbbb6WrwQPoq4gMo,5689
4
4
  numbers_parser/bullets.py,sha256=OnVVMPjhTDrC-ncw52Gb00UEXNmn2Rvd3xi7lfqW3hk,2616
5
5
  numbers_parser/cell.py,sha256=lWa0irSPfZqoTose-MrNiSe0WAl5kVlFKg4g3HFK_EU,26054
6
- numbers_parser/cell_storage.py,sha256=_k3tal9vHGQ8Fyk-84NITLmpflRk3gCjNdd7wJcukrI,29219
6
+ numbers_parser/cell_storage.py,sha256=CK_QpmjjCIIBmcj0Acq3pnNsHSO7y3j09HI8GRV39RM,29450
7
7
  numbers_parser/constants.py,sha256=0xOqyrp7-T9hggKOf44OQA9TphlBEE3zrSy1hJriKmo,1893
8
8
  numbers_parser/containers.py,sha256=b9sOCBd60YjMxJ-s9u-erWusA3guHU-c1RAUqM8CyKs,4191
9
9
  numbers_parser/data/empty.numbers,sha256=8JOp035V-p2ff9_Wao7mLcYvb6_if6O2cus_esjVA9k,90316
@@ -52,8 +52,8 @@ numbers_parser/mapping.py,sha256=in8W3S8DmTcPefFaxnATLw0FQ4YnFsnAE-cl5dljzJE,322
52
52
  numbers_parser/model.py,sha256=f4jdR8-RwNvCcHFNbc1XBkfvDy0KFBmpuHpG1giVyeU,91217
53
53
  numbers_parser/numbers_cache.py,sha256=1ghEBghQAYFpPiEeOtb74i016mXc039v1pOubbqvaLs,1141
54
54
  numbers_parser/numbers_uuid.py,sha256=-LeAj_ULC0va57pEmyegGY0xXqkNNjyuLukCaiQJhOk,2642
55
- numbers_parser-4.4.7.dist-info/LICENSE.rst,sha256=8vTa1-5KSdHrTpU9rlheO5005EWReEPMpjV7BjSaMc4,1050
56
- numbers_parser-4.4.7.dist-info/METADATA,sha256=F4nRqAQbscgjVJzTHJ0Hrt_kK6TerXnOzCShTAUsroQ,26504
57
- numbers_parser-4.4.7.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
58
- numbers_parser-4.4.7.dist-info/entry_points.txt,sha256=V91uB9vBPxf3eCY1h-0syv21imYCT0MJfMxf87DmwIk,115
59
- numbers_parser-4.4.7.dist-info/RECORD,,
55
+ numbers_parser-4.4.8.dist-info/LICENSE.rst,sha256=8vTa1-5KSdHrTpU9rlheO5005EWReEPMpjV7BjSaMc4,1050
56
+ numbers_parser-4.4.8.dist-info/METADATA,sha256=3nXzAhvFbk4FyvS5W_HMoWbAQwk1fgsCIiJpKfgR3GA,26797
57
+ numbers_parser-4.4.8.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
58
+ numbers_parser-4.4.8.dist-info/entry_points.txt,sha256=V91uB9vBPxf3eCY1h-0syv21imYCT0MJfMxf87DmwIk,115
59
+ numbers_parser-4.4.8.dist-info/RECORD,,