numbers-parser 4.7.0__tar.gz → 4.8.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 (63) hide show
  1. numbers_parser-4.8.0/PKG-INFO +378 -0
  2. numbers_parser-4.8.0/README.md +347 -0
  3. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/pyproject.toml +11 -5
  4. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/__init__.py +2 -1
  5. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/cell.py +389 -101
  6. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/cell_storage.py +153 -162
  7. numbers_parser-4.8.0/src/numbers_parser/constants.py +274 -0
  8. numbers_parser-4.8.0/src/numbers_parser/document.py +1269 -0
  9. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/formula.py +10 -10
  10. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/model.py +291 -124
  11. numbers_parser-4.7.0/PKG-INFO +0 -626
  12. numbers_parser-4.7.0/README.md +0 -594
  13. numbers_parser-4.7.0/src/numbers_parser/constants.py +0 -110
  14. numbers_parser-4.7.0/src/numbers_parser/document.py +0 -565
  15. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/LICENSE.rst +0 -0
  16. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/_cat_numbers.py +0 -0
  17. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/_unpack_numbers.py +0 -0
  18. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/bullets.py +0 -0
  19. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/containers.py +0 -0
  20. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/currencies.py +0 -0
  21. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/data/empty.numbers +0 -0
  22. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/exceptions.py +0 -0
  23. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/experimental.py +0 -0
  24. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/file.py +0 -0
  25. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TNArchives_pb2.py +0 -0
  26. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TNArchives_sos_pb2.py +0 -0
  27. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TNCommandArchives_pb2.py +0 -0
  28. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TNCommandArchives_sos_pb2.py +0 -0
  29. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSAArchives_pb2.py +0 -0
  30. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSAArchives_sos_pb2.py +0 -0
  31. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSACommandArchives_sos_pb2.py +0 -0
  32. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCEArchives_pb2.py +0 -0
  33. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCH3DArchives_pb2.py +0 -0
  34. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCHArchives_Common_pb2.py +0 -0
  35. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCHArchives_GEN_pb2.py +0 -0
  36. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCHArchives_pb2.py +0 -0
  37. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCHArchives_sos_pb2.py +0 -0
  38. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCHCommandArchives_pb2.py +0 -0
  39. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSCHPreUFFArchives_pb2.py +0 -0
  40. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSDArchives_pb2.py +0 -0
  41. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSDArchives_sos_pb2.py +0 -0
  42. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSDCommandArchives_pb2.py +0 -0
  43. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSKArchives_pb2.py +0 -0
  44. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSKArchives_sos_pb2.py +0 -0
  45. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSPArchiveMessages_pb2.py +0 -0
  46. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSPDatabaseMessages_pb2.py +0 -0
  47. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSPMessages_pb2.py +0 -0
  48. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSSArchives_pb2.py +0 -0
  49. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSSArchives_sos_pb2.py +0 -0
  50. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSTArchives_pb2.py +0 -0
  51. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSTArchives_sos_pb2.py +0 -0
  52. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSTCommandArchives_pb2.py +0 -0
  53. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSTStylePropertyArchiving_pb2.py +0 -0
  54. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSWPArchives_pb2.py +0 -0
  55. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSWPArchives_sos_pb2.py +0 -0
  56. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/TSWPCommandArchives_pb2.py +0 -0
  57. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/__init__.py +0 -0
  58. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/fontmap.py +0 -0
  59. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/generated/functionmap.py +0 -0
  60. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/iwafile.py +0 -0
  61. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/mapping.py +0 -0
  62. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/numbers_cache.py +0 -0
  63. {numbers_parser-4.7.0 → numbers_parser-4.8.0}/src/numbers_parser/numbers_uuid.py +0 -0
@@ -0,0 +1,378 @@
1
+ Metadata-Version: 2.1
2
+ Name: numbers-parser
3
+ Version: 4.8.0
4
+ Summary: Read and write Apple Numbers spreadsheets
5
+ Home-page: https://github.com/masaccio/numbers-parser
6
+ License: MIT
7
+ Author: Jon Connell
8
+ Author-email: python@figsandfudge.com
9
+ Requires-Python: >=3.9,<4.0
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Office/Business :: Financial :: Spreadsheet
18
+ Requires-Dist: compact-json (>=1.1.3,<2.0.0)
19
+ Requires-Dist: importlib-resources (>=6.1.1,<7.0.0)
20
+ Requires-Dist: pendulum (>=3.0,<4.0)
21
+ Requires-Dist: protobuf (>=4.21.1,<5.0.0)
22
+ Requires-Dist: python-snappy (>=0.6.1,<0.7.0)
23
+ Requires-Dist: regex (>=2022.9.13,<2023.0.0)
24
+ Requires-Dist: roman (>=3.3,<4.0)
25
+ Requires-Dist: setuptools (>=69.0.3,<70.0.0)
26
+ Requires-Dist: sigfig (>=1.3.2,<2.0.0)
27
+ Project-URL: Documentation, https://github.com/masaccio/numbers-parser/blob/main/README.md
28
+ Project-URL: Repository, https://github.com/masaccio/numbers-parser
29
+ Description-Content-Type: text/markdown
30
+
31
+ # numbers-parser
32
+
33
+ [![Test Status](https://github.com/masaccio/numbers-parser/actions/workflows/run-all-tests.yml/badge.svg)](https://github.com/masaccio/numbers-parser/actions/workflows/run-all-tests.yml)[![Security Checks](https://github.com/masaccio/numbers-parser/actions/workflows/codeql.yml/badge.svg)](https://github.com/masaccio/numbers-parser/actions/workflows/codeql.yml)[![Code Coverage](https://codecov.io/gh/masaccio/numbers-parser/branch/main/graph/badge.svg?token=EKIUFGT05E)](https://codecov.io/gh/masaccio/numbers-parser)[![PyPI Version](https://badge.fury.io/py/numbers-parser.svg)](https://badge.fury.io/py/numbers-parser)
34
+
35
+ `numbers-parser` is a Python module for parsing [Apple Numbers](https://www.apple.com/numbers/)`.numbers` files. It supports Numbers files
36
+ generated by Numbers version 10.3, and up with the latest tested version being 13.2
37
+ (current as of September 2023).
38
+
39
+ It supports and is tested against Python versions from 3.8 onwards. It is not compatible
40
+ with earlier versions of Python.
41
+
42
+ ## Installation
43
+
44
+ ```bash
45
+ python3 -m pip install numbers-parser
46
+ ```
47
+
48
+ A pre-requisite for this package is [python-snappy](https://pypi.org/project/python-snappy/)
49
+ which will be installed by Python automatically, but python-snappy also requires that the binary
50
+ libraries for snappy compression are present.
51
+
52
+ The most straightforward way to install the binary dependencies is to use
53
+ [Homebrew](https://brew.sh) and source Python from Homebrew rather than from macOS as described
54
+ in the [python-snappy github](https://github.com/andrix/python-snappy):
55
+
56
+ For Intel Macs:
57
+
58
+ ```bash
59
+ brew install snappy python3
60
+ CPPFLAGS="-I/usr/local/include -L/usr/local/lib" python3 -m pip install python-snappy
61
+ ```
62
+
63
+ For Apple Silicon Macs:
64
+
65
+ ```bash
66
+ brew install snappy python3
67
+ CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" python3 -m pip install python-snappy
68
+ ```
69
+
70
+ For Linux (your package manager may be different):
71
+
72
+ ```bash
73
+ sudo apt-get -y install libsnappy-dev
74
+ ```
75
+
76
+ On Windows, you will need to either arrange for snappy to be found for VSC++ or you can install python
77
+ binary libraries compiled by [Christoph Gohlke](https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-snappy). You must select the correct python
78
+ version for your installation. For example for python 3.11:
79
+
80
+ ```text
81
+ C:\Users\Jon>pip install C:\Users\Jon\Downloads\python_snappy-0.6.1-cp311-cp311-win_amd64.whl
82
+ ```
83
+
84
+ ### Quick Start
85
+
86
+ Reading documents:
87
+
88
+ ```python
89
+ >>> from numbers_parser import Document
90
+ >>> doc = Document("mydoc.numbers")
91
+ >>> sheets = doc.sheets
92
+ >>> tables = sheets[0].tables
93
+ >>> rows = tables[0].rows()
94
+ ```
95
+
96
+ Sheets and tables are iterables that can be indexed using either an
97
+ integer index or using the name of the sheet/table:
98
+
99
+ ```python
100
+ >>> doc.sheets[0].name
101
+ 'Sheet 1'
102
+ >>> doc.sheets["Sheet 1"].name
103
+ 'Sheet 1'
104
+ >>> doc.sheets[0].tables[0].name
105
+ 'Table 1'
106
+ >>> doc.sheets[0].tables["Table 1"].name
107
+ 'Table 1'
108
+ ```
109
+
110
+ `Table` objects have a `rows` method which contains a nested list
111
+ with an entry for each row of the table. Each row is itself a list of
112
+ the column values.
113
+
114
+ ```python
115
+ >>> data = sheets["Sheet 1"].tables["Table 1"].rows()
116
+ >>> data[0][0]
117
+ <numbers_parser.cell.EmptyCell object at 0x1022b5710>
118
+ >>> data[1][0]
119
+ <numbers_parser.cell.TextCell object at 0x101eb6790>
120
+ >>> data[1][0].value
121
+ 'Debit'
122
+ ```
123
+
124
+ #### Cell Data
125
+
126
+ Cells are objects with a common base class of `Cell`. All cell types
127
+ have a property `value` which returns the contents of the cell as a
128
+ python datatype. `numbers-parser` uses
129
+ [pendulum](https://pendulum.eustace.io) instead of python’s builtin
130
+ types. Available cell types are:
131
+
132
+ | Cell type | value type | Additional properties |
133
+ |-------------------|--------------------------|-------------------------------------------------------------------------------------------------|
134
+ | N<br/>umberCell | `float` | |
135
+ | TextCell | `str` | |
136
+ | Ric<br/>hTextCell | `str` | See [Bullets and<br/>lists](#bullets-and-lists) |
137
+ | EmptyCell | `None` | |
138
+ | BoolCell | `bool` | |
139
+ | DateCell | `pend<br/>ulum.datetime` | |
140
+ | Dur<br/>ationCell | `pend<br/>ulum.duration` | |
141
+ | ErrorCell | `None` | |
142
+ | M<br/>ergedCell | `None` | See [Merged<br/>c<br/>ells](https://masaccio.github.io/numbers-parser/#table-cell-merged-cells) |
143
+
144
+ Cell references can be either zero-offset row/column integers or an
145
+ Excel/Numbers A1 notation. Where cell values are not `None` the
146
+ property `formatted_value` returns the cell value as a `str` as
147
+ displayed in Numbers. Cells that have no values in a table are
148
+ represented as `EmptyCell` and cells containing evaluation errors of
149
+ any kind `ErrorCell`.
150
+
151
+ ```python
152
+ >>> table.cell(1,0)
153
+ <numbers_parser.cell.TextCell object at 0x1019ade50>
154
+ >>> table.cell(1,0).value
155
+ 'Debit'
156
+ >>> table.cell("B2")
157
+ <numbers_parser.cell.NumberCell object at 0x103a99790>
158
+ >>> table.cell("B2").value
159
+ 1234.5
160
+ >>> table.cell("B2").formatted_value
161
+ '£1,234.50'
162
+ ```
163
+
164
+ #### Pandas Support
165
+
166
+ Since the return value of `rows()` is a list of lists, you can pass
167
+ this directly to pandas. Assuming you have a Numbers table with a single
168
+ header which contains the names of the pandas series you want to create
169
+ you can construct a pandas dataframe using:
170
+
171
+ ```python
172
+ import pandas as pd
173
+
174
+ doc = Document("simple.numbers")
175
+ sheets = doc.sheets
176
+ tables = sheets[0].tables
177
+ data = tables[0].rows(values_only=True)
178
+ df = pd.DataFrame(data[1:], columns=data[0])
179
+ ```
180
+
181
+ #### Writing Numbers Documents
182
+
183
+ Whilst support for writing numbers files has been stable since version
184
+ 3.4.0, you are highly recommended not to overwrite working Numbers files
185
+ and instead save data to a new file.
186
+
187
+ Cell values are written using
188
+ [Table.write()](https://masaccio.github.io/numbers-parser/#numbers_parser.Table.write)
189
+ and `numbers-parser` will automatically create empty rows and columns
190
+ for any cell references that are out of range of the current table.
191
+
192
+ ```python
193
+ doc = Document("write.numbers")
194
+ sheets = doc.sheets
195
+ tables = sheets[0].tables
196
+ table = tables[0]
197
+ table.write(1, 1, "This is new text")
198
+ table.write("B7", datetime(2020, 12, 25))
199
+ doc.save("new-sheet.numbers")
200
+ ```
201
+
202
+ Additional tables and worksheets can be added to a `Document` before
203
+ saving using
204
+ [Document.add_sheet()](https://masaccio.github.io/numbers-parser/#numbers_parser.Document.add_sheet)
205
+ and
206
+ [Sheet.add_table()](https://masaccio.github.io/numbers-parser/#numbers_parser.Sheet.add_table)
207
+ respectively:
208
+
209
+ ```python
210
+ doc = Document()
211
+ doc.add_sheet("New Sheet", "New Table")
212
+ sheet = doc.sheets["New Sheet"]
213
+ table = sheet.tables["New Table"]
214
+ table.write(1, 1, 1000)
215
+ table.write(1, 2, 2000)
216
+ table.write(1, 3, 3000)
217
+ doc.save("sheet.numbers")
218
+ ```
219
+
220
+ #### Styles
221
+
222
+ `numbers_parser` currently only supports paragraph styles and cell
223
+ styles. The following paragraph styles are supported:
224
+
225
+ - font attributes: bold, italic, underline, strikethrough
226
+ - font selection and size
227
+ - text foreground color
228
+ - horizontal and vertical alignment
229
+ - cell background color
230
+ - cell indents (first line, left, right, and text inset)
231
+
232
+ Numbers conflates style attributes that can be stored in paragraph
233
+ styles (the style menu in the text panel) with the settings that are
234
+ available on the Style tab of the Text panel. Some attributes in Numbers
235
+ are not applied to new cells when a style is applied. To keep the API
236
+ simple, `numbers-parser` packs all styling into a single
237
+ [Style](https://masaccio.github.io/numbers-parser/#numbers_parser.Style)
238
+ object. When a document is saved, the attributes not stored in a
239
+ paragraph style are applied to each cell that includes it.
240
+
241
+ Styles are read from cells using the
242
+ [Cell.style](https://masaccio.github.io/numbers-parser/#numbers_parser.Cell.style)
243
+ propert and you can add new styles with
244
+ [Document.add_style](https://masaccio.github.io/numbers-parser/#numbers_parser.Document.add_style).
245
+
246
+ Since `Style` objects are shared, changing `Cell.style.font_size`
247
+ will have the effect of changing the font size for that style and will
248
+ in turn affect the styles of all cells using that style.
249
+
250
+ #### Cell Data Formatting
251
+
252
+ Numbers has two different cell formatting types: data formats and custom
253
+ formats.
254
+
255
+ Data formats are presented in Numbers in the Cell tab of the Format pane
256
+ and are applied to individual cells. Like Numbers, `numbers-parsers`
257
+ caches formatting information that is identical across multiple cells.
258
+ You do not need to take any action for this to happen; this is handled
259
+ internally by the package. Changing a data format for cell has no impact
260
+ on any other cells.
261
+
262
+ Cell formats are changed using
263
+ [Table.set_cell_formatting](https://masaccio.github.io/numbers-parser/#numbers_parser.Table.set_cell_formatting):
264
+
265
+ ```python
266
+ table.set_cell_formatting("C1", "date", date_time_format="EEEE, d MMMM yyyy")
267
+ table.set_cell_formatting(0, 4, "number", decimal_places=3, negative_style=NegativeNumberStyle.RED)
268
+ ```
269
+
270
+ Custom formats are shared across a Document and can be applied to
271
+ multiple cells in multiple tables. Editing a custom format changes the
272
+ appearance of data in all cells that share that format. You must first
273
+ add a custom format to the document using
274
+ [Document.add_custom_format](https://masaccio.github.io/numbers-parser/#numbers_parser.Document.add_custom_format)
275
+ before assigning it to cells using
276
+ [Table.set_cell_formatting](https://masaccio.github.io/numbers-parser/#numbers_parser.Table.set_cell_formatting):
277
+
278
+ ```python
279
+ long_date = doc.add_custom_format(name="Long Date", type="date", date_time_format="EEEE, d MMMM yyyy")
280
+ table.set_cell_formatting("C1", "custom", format=long_date)
281
+ ```
282
+
283
+ A limited number of currencies are formatted using symbolic notation
284
+ rather than an ISO code. These are defined in
285
+ `numbers_parser.currencies` and match the ones chosen by Numbers. For
286
+ example, US dollars are referred to as `US$` whereas Euros and British
287
+ Pounds are referred to using their symbols of `€` and `£`
288
+ respectively.
289
+
290
+ #### Borders
291
+
292
+ `numbers-parser` supports reading and writing cell borders, though the
293
+ interface for each differs. Individual cells can have each of their four
294
+ borders tested, but when drawing new borders, these are set for the
295
+ table to allow for drawing borders across multiple cells. Setting the
296
+ border of merged cells is not possible unless the edge of the cells is
297
+ at the end of the merged region.
298
+
299
+ Borders are represented using the
300
+ [Border](https://masaccio.github.io/numbers-parser/#numbers_parser.Border)
301
+ class that can be initialized with line width, color and line style. The
302
+ current state of a cell border is read using the
303
+ [Cell.border](https://masaccio.github.io/numbers-parser/#numbers_parser.Cell.border)
304
+ property. The
305
+ [Table.set_cell_border](https://masaccio.github.io/numbers-parser/#numbers_parser.Table.set_cell_border)
306
+ sets the border for a cell edge or a range of cells.
307
+
308
+ ## API
309
+
310
+ For more examples and details of all available classes and methods,
311
+ see the [full API docs](https://masaccio.github.io/numbers-parser/).
312
+
313
+ ## Command-line scripts
314
+
315
+ When installed from [PyPI](https://pypi.org/project/numbers-parser/),
316
+ a command-like script `cat-numbers` is installed in Python’s scripts
317
+ folder. This script dumps Numbers spreadsheets into Excel-compatible CSV
318
+ format, iterating through all the spreadsheets passed on the
319
+ command-line.
320
+
321
+ ```text
322
+ usage: cat-numbers [-h] [-T | -S | -b] [-V] [--debug] [--formulas]
323
+ [--formatting] [-s SHEET] [-t TABLE] [document ...]
324
+
325
+ Export data from Apple Numbers spreadsheet tables
326
+
327
+ positional arguments:
328
+ document Document(s) to export
329
+
330
+ optional arguments:
331
+ -h, --help show this help message and exit
332
+ -T, --list-tables List the names of tables and exit
333
+ -S, --list-sheets List the names of sheets and exit
334
+ -b, --brief Don't prefix data rows with name of sheet/table (default: false)
335
+ -V, --version
336
+ --debug Enable debug output
337
+ --formulas Dump formulas instead of formula results
338
+ --formatting Dump formatted cells (durations) as they appear in Numbers
339
+ -s SHEET, --sheet SHEET Names of sheet(s) to include in export
340
+ -t TABLE, --table TABLE Names of table(s) to include in export
341
+ ```
342
+
343
+ Note: `--formatting` will return different capitalization for 12-hour
344
+ times due to differences between Numbers’ representation of these dates
345
+ and `datetime.strftime`. Numbers in English locales displays 12-hour
346
+ times with ‘am’ and ‘pm’, but `datetime.strftime` on macOS at least
347
+ cannot return lower-case versions of AM/PM.
348
+
349
+ ## Limitations
350
+
351
+ Current known limitations of `numbers-parser` are:
352
+
353
+ - Formulas cannot be written to a document
354
+ - Table styles that allow new tables to adopt a style across the whole
355
+ table are not planned.
356
+ - Creating cells of type `BulletedTextCell` is not supported
357
+ - New tables are inserted with a fixed offset below the last table in a
358
+ worksheet which does not take into account title or caption size
359
+ - New sheets insert tables with formats copied from the first table in
360
+ the previous sheet rather than default table formats
361
+ - Creating custom cell formats and cell data formats is experimental
362
+ and not all formats are supported. See
363
+ [Table.set_cell_formatting](https://masaccio.github.io/numbers-parser/#numbers_parser.Table.set_cell_formatting)
364
+ for more details.
365
+ - Due to a limitation in Python’s
366
+ [ZipFile](https://docs.python.org/3/library/zipfile.html), Python
367
+ versions older than 3.11 do not support image filenames with UTF-8
368
+ characters (see [issue
369
+ 69](https://github.com/masaccio/numbers-parser/issues/69)).
370
+ [Cell.style.bg_image](https://masaccio.github.io/numbers-parser/#numbers_parser.Style)
371
+ returns `None` for such files and issues a `RuntimeWarning`.
372
+ - Pivot tables are unsupported, but re-saving a document is believed to work. Saving a document with a pivot table issues a UnsupportedWarning.
373
+
374
+ ## License
375
+
376
+ All code in this repository is licensed under the [MIT
377
+ License](https://github.com/masaccio/numbers-parser/blob/master/LICENSE.rst)
378
+