numbers-parser 4.18.2__tar.gz → 4.18.4__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.
- {numbers_parser-4.18.2/src/numbers_parser.egg-info → numbers_parser-4.18.4}/PKG-INFO +2 -2
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/pyproject.toml +8 -7
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/_cat_numbers.py +3 -3
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/_csv2numbers.py +1 -1
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/cell.py +38 -26
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/constants.py +53 -48
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/formula.py +1 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TNArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TNArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TNCommandArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TNCommandArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSAArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSAArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSACommandArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCEArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCH3DArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHArchives_Common_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHArchives_GEN_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHCommandArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHPreUFFArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCKArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCKArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSDArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSDArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSDCommandArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSKArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSPArchiveMessages_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSPDatabaseMessages_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSPMessages_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSSArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSSArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSTArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSTArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSTCommandArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSTStylePropertyArchiving_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSWPArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSWPArchives_sos_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSWPCommandArchives_pb2.py +4 -4
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/iwafile.py +1 -1
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/iwork.py +1 -1
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/model.py +10 -3
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/xrefs.py +17 -5
- {numbers_parser-4.18.2 → numbers_parser-4.18.4/src/numbers_parser.egg-info}/PKG-INFO +2 -2
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser.egg-info/SOURCES.txt +1 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser.egg-info/requires.txt +1 -1
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_cat_numbers.py +30 -22
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_coverage.py +23 -20
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_csv2numbers.py +36 -7
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_formatting.py +9 -1
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_issues.py +34 -2
- numbers_parser-4.18.4/tests/test_local_docs.py +95 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_unpack_numbers.py +25 -10
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/LICENSE.rst +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/README.md +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/setup.cfg +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/__init__.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/_unpack_numbers.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/bullets.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/containers.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/currencies.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/data/empty.numbers +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/document.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/exceptions.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/experimental.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/__init__.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/fontmap.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/functionmap.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/mapping.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/numbers_cache.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/numbers_uuid.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/roman.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser.egg-info/dependency_links.txt +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser.egg-info/entry_points.txt +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser.egg-info/top_level.txt +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_all_formulas.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_api_change.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_borders.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_bullets.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_categories.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_create_cells.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_currency.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_folder.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_formulas.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_large.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_memory_leaks.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_merges.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_package.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_properties.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_roman.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_save.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_slices.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_styles.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_table_size.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_tables.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_unsupported.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_uuids.py +0 -0
- {numbers_parser-4.18.2 → numbers_parser-4.18.4}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numbers-parser
|
|
3
|
-
Version: 4.18.
|
|
3
|
+
Version: 4.18.4
|
|
4
4
|
Summary: Read and write Apple Numbers spreadsheets
|
|
5
5
|
Author-email: Jon Connell <python@figsandfudge.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -13,7 +13,7 @@ Requires-Python: >=3.10
|
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE.rst
|
|
15
15
|
Requires-Dist: compact-json>=1.1.3
|
|
16
|
-
Requires-Dist: protobuf>=
|
|
16
|
+
Requires-Dist: protobuf>=7.34.0
|
|
17
17
|
Requires-Dist: python-snappy>=0.7
|
|
18
18
|
Requires-Dist: sigfig>=1.3.3
|
|
19
19
|
Requires-Dist: setuptools>=70.0.0
|
|
@@ -6,7 +6,7 @@ license = "MIT"
|
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
dependencies = [
|
|
8
8
|
"compact-json>=1.1.3",
|
|
9
|
-
"protobuf>=
|
|
9
|
+
"protobuf>=7.34.0",
|
|
10
10
|
"python-snappy>=0.7",
|
|
11
11
|
"sigfig>=1.3.3",
|
|
12
12
|
"setuptools>=70.0.0",
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
description = "Read and write Apple Numbers spreadsheets"
|
|
23
23
|
name = "numbers-parser"
|
|
24
24
|
readme = "README.md"
|
|
25
|
-
version = "4.18.
|
|
25
|
+
version = "4.18.4"
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
28
28
|
repository = "https://github.com/masaccio/numbers-parser"
|
|
@@ -35,7 +35,7 @@ csv2numbers = "numbers_parser._csv2numbers:main"
|
|
|
35
35
|
|
|
36
36
|
[dependency-groups]
|
|
37
37
|
dev = [
|
|
38
|
-
"gprof2dot
|
|
38
|
+
"gprof2dot>=2022.7.29,<2026.0.0",
|
|
39
39
|
"line-profiler>=5.0.0",
|
|
40
40
|
"mock>=5.1.0",
|
|
41
41
|
"pytest>=7.2.0",
|
|
@@ -43,6 +43,7 @@ dev = [
|
|
|
43
43
|
"pytest-console-scripts<2.0.0,>=1.3.1",
|
|
44
44
|
"pytest-cov>=4.0,>=5.0",
|
|
45
45
|
"pytest-xdist<4.0.0,>=3.3.1",
|
|
46
|
+
"pytest-profiling",
|
|
46
47
|
"ruff",
|
|
47
48
|
"tox<5.0.0,>=4.11.4",
|
|
48
49
|
"python-magic>=0.4",
|
|
@@ -51,14 +52,14 @@ dev = [
|
|
|
51
52
|
"pympler<2.0,>=1.1",
|
|
52
53
|
]
|
|
53
54
|
docs = [
|
|
54
|
-
"sphinx
|
|
55
|
+
"sphinx<9.0,>=7.3",
|
|
55
56
|
"enum-tools>=0.11",
|
|
56
57
|
"sphinx-toolbox>=3.5",
|
|
57
58
|
"sphinx-nefertiti>=0.7",
|
|
58
59
|
"sphinx-markdown-builder>=0.6",
|
|
59
60
|
"sphinx-copybutton>=0.5.2",
|
|
60
61
|
# Security updates
|
|
61
|
-
"urllib3>=2.
|
|
62
|
+
"urllib3>=2.7.0",
|
|
62
63
|
"filelock>=3.20.1"
|
|
63
64
|
]
|
|
64
65
|
bootstrap = [
|
|
@@ -75,7 +76,7 @@ build-backend = "setuptools.build_meta"
|
|
|
75
76
|
[tool.setuptools.packages.find]
|
|
76
77
|
where = ["src"]
|
|
77
78
|
include = ["numbers_parser*"]
|
|
78
|
-
exclude = ["*tests*"]
|
|
79
|
+
exclude = ["*tests*", "numbers_parser.data"]
|
|
79
80
|
namespaces = false # disable scanning PEP 420 namespaces
|
|
80
81
|
|
|
81
82
|
[tool.setuptools.package-data]
|
|
@@ -94,7 +95,7 @@ addopts = "--cov=src/numbers_parser --cov-report=html --cov-report=term-missing:
|
|
|
94
95
|
|
|
95
96
|
[tool.tox]
|
|
96
97
|
requires = ["tox>=4.0"]
|
|
97
|
-
envlist = ["
|
|
98
|
+
envlist = ["py310", "py311", "py312", "py313"]
|
|
98
99
|
|
|
99
100
|
[testenv]
|
|
100
101
|
deps = [
|
|
@@ -139,9 +139,9 @@ def main() -> None:
|
|
|
139
139
|
elif len(args.document) == 0:
|
|
140
140
|
parser.print_help()
|
|
141
141
|
else:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
logger.addHandler(
|
|
142
|
+
handler = logging.StreamHandler()
|
|
143
|
+
handler.setFormatter(logging.Formatter("%(levelname)s:%(name)s:%(message)s"))
|
|
144
|
+
logger.addHandler(handler)
|
|
145
145
|
if args.debug:
|
|
146
146
|
logger.setLevel("DEBUG")
|
|
147
147
|
else:
|
|
@@ -393,7 +393,7 @@ def main() -> None:
|
|
|
393
393
|
output_filenames = args.output
|
|
394
394
|
|
|
395
395
|
if len(args.csvfile) != len(output_filenames):
|
|
396
|
-
print("The
|
|
396
|
+
print("The number of input and output file names do not match", file=sys.stderr)
|
|
397
397
|
sys.exit(1)
|
|
398
398
|
|
|
399
399
|
try:
|
|
@@ -703,7 +703,7 @@ class Cell(CellStorageFlags, Cacheable):
|
|
|
703
703
|
supported, or as their number values where there is no suitable
|
|
704
704
|
visual representation. Currently supported mappings are:
|
|
705
705
|
|
|
706
|
-
* Checkboxes are U+2610 (
|
|
706
|
+
* Checkboxes are U+2610 (Ballot Box) or U+2611 (Ballot Box with Check)
|
|
707
707
|
* Ratings are their star value represented using (U+2605) (Black Star)
|
|
708
708
|
|
|
709
709
|
.. code-block:: python
|
|
@@ -867,19 +867,21 @@ class Cell(CellStorageFlags, Cacheable):
|
|
|
867
867
|
if flags & 0x80:
|
|
868
868
|
# cond_style_id skipped
|
|
869
869
|
offset += 4
|
|
870
|
-
|
|
870
|
+
if flags & 0x100:
|
|
871
|
+
# cond_rule_style_id skipped
|
|
872
|
+
offset += 4
|
|
871
873
|
if flags & 0x200:
|
|
872
874
|
storage_flags._formula_id = unpack("<i", buffer[offset : offset + 4])[0]
|
|
873
875
|
offset += 4
|
|
874
876
|
if flags & 0x400:
|
|
875
877
|
storage_flags._control_id = unpack("<i", buffer[offset : offset + 4])[0]
|
|
876
878
|
offset += 4
|
|
877
|
-
|
|
879
|
+
if flags & 0x800:
|
|
880
|
+
storage_flags.formula_error_id = unpack("<i", buffer[offset : offset + 4])[0]
|
|
881
|
+
offset += 4
|
|
878
882
|
if flags & 0x1000:
|
|
879
883
|
storage_flags._suggest_id = unpack("<i", buffer[offset : offset + 4])[0]
|
|
880
884
|
offset += 4
|
|
881
|
-
# Skip unused flags
|
|
882
|
-
offset += 4 * bin(flags & 0x900).count("1")
|
|
883
885
|
if flags & 0x2000:
|
|
884
886
|
storage_flags._num_format_id = unpack("<i", buffer[offset : offset + 4])[0]
|
|
885
887
|
offset += 4
|
|
@@ -1205,7 +1207,8 @@ class Cell(CellStorageFlags, Cacheable):
|
|
|
1205
1207
|
elif custom_format.format_type == FormatType.BOOLEAN:
|
|
1206
1208
|
return "TRUE" if self.value else "FALSE"
|
|
1207
1209
|
elif custom_format.format_type == FormatType.PERCENT:
|
|
1208
|
-
|
|
1210
|
+
d128 = self._d128 or 0.0
|
|
1211
|
+
return _format_decimal(d128 * 100, custom_format, percent=True)
|
|
1209
1212
|
elif custom_format.format_type == FormatType.BASE:
|
|
1210
1213
|
return _format_base(self._d128, custom_format)
|
|
1211
1214
|
elif custom_format.format_type == FormatType.FRACTION:
|
|
@@ -1306,7 +1309,7 @@ class Cell(CellStorageFlags, Cacheable):
|
|
|
1306
1309
|
dstr.append(str(dd) + _unit_format("second", dd, duration_style))
|
|
1307
1310
|
|
|
1308
1311
|
if unit_smallest >= DurationUnits.MILLISECOND:
|
|
1309
|
-
dd =
|
|
1312
|
+
dd = round(1000 * d)
|
|
1310
1313
|
if duration_style == DurationStyle.COMPACT:
|
|
1311
1314
|
padding = "0" if dd >= 10 else "00"
|
|
1312
1315
|
padding = "" if dd >= 100 else padding
|
|
@@ -1583,7 +1586,6 @@ def _decode_date_format(date_format, value):
|
|
|
1583
1586
|
chars = [*date_format]
|
|
1584
1587
|
index = 0
|
|
1585
1588
|
in_string = False
|
|
1586
|
-
in_field = False
|
|
1587
1589
|
result = ""
|
|
1588
1590
|
field = ""
|
|
1589
1591
|
while index < len(chars):
|
|
@@ -1600,28 +1602,31 @@ def _decode_date_format(date_format, value):
|
|
|
1600
1602
|
index += 1
|
|
1601
1603
|
else:
|
|
1602
1604
|
in_string = True
|
|
1603
|
-
if in_field:
|
|
1604
|
-
result += _decode_date_format_field(field, value)
|
|
1605
|
-
in_field = False
|
|
1606
1605
|
index += 1
|
|
1607
1606
|
elif in_string:
|
|
1608
1607
|
result += current_char
|
|
1609
1608
|
index += 1
|
|
1610
|
-
elif
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1609
|
+
elif current_char.isalpha():
|
|
1610
|
+
remaining_str = date_format[index:]
|
|
1611
|
+
matched_field = None
|
|
1612
|
+
for field in DATETIME_FIELD_MAP:
|
|
1613
|
+
# Greedily match the longest possible valid field
|
|
1614
|
+
if remaining_str.startswith(field):
|
|
1615
|
+
matched_field = field
|
|
1616
|
+
break
|
|
1617
|
+
|
|
1618
|
+
if matched_field:
|
|
1619
|
+
result += _decode_date_format_field(matched_field, value)
|
|
1620
|
+
index += len(matched_field)
|
|
1621
|
+
else:
|
|
1622
|
+
unknown_field = ""
|
|
1623
|
+
while index < len(chars) and chars[index].isalpha():
|
|
1624
|
+
unknown_field += chars[index]
|
|
1625
|
+
index += 1
|
|
1626
|
+
result += _decode_date_format_field(unknown_field, value)
|
|
1619
1627
|
else:
|
|
1620
|
-
|
|
1621
|
-
field = current_char
|
|
1628
|
+
result += current_char
|
|
1622
1629
|
index += 1
|
|
1623
|
-
if in_field:
|
|
1624
|
-
result += _decode_date_format_field(field, value)
|
|
1625
1630
|
|
|
1626
1631
|
return result
|
|
1627
1632
|
|
|
@@ -1660,6 +1665,9 @@ def _expand_quotes(value: str) -> str:
|
|
|
1660
1665
|
|
|
1661
1666
|
def _decode_number_format(number_format, value, name): # noqa: PLR0912
|
|
1662
1667
|
"""Parse a custom date format string and return a formatted number value."""
|
|
1668
|
+
if value is None:
|
|
1669
|
+
return None
|
|
1670
|
+
|
|
1663
1671
|
custom_format_string = number_format.custom_format_string
|
|
1664
1672
|
value *= number_format.scale_factor
|
|
1665
1673
|
if "%" in custom_format_string and number_format.scale_factor == 1.0:
|
|
@@ -1679,7 +1687,8 @@ def _decode_number_format(number_format, value, name): # noqa: PLR0912
|
|
|
1679
1687
|
UnsupportedWarning,
|
|
1680
1688
|
stacklevel=1,
|
|
1681
1689
|
)
|
|
1682
|
-
return
|
|
1690
|
+
return str(value)
|
|
1691
|
+
|
|
1683
1692
|
format_spec = match.group(1)
|
|
1684
1693
|
scientific_spec = match.group(2)
|
|
1685
1694
|
|
|
@@ -1830,6 +1839,9 @@ def _format_decimal(value: float, number_format, percent: bool = False) -> str:
|
|
|
1830
1839
|
|
|
1831
1840
|
|
|
1832
1841
|
def _format_currency(value: float, number_format) -> str:
|
|
1842
|
+
if value is None:
|
|
1843
|
+
return None
|
|
1844
|
+
|
|
1833
1845
|
formatted_value = _format_decimal(value, number_format)
|
|
1834
1846
|
if number_format.currency_code in CURRENCY_SYMBOLS:
|
|
1835
1847
|
symbol = CURRENCY_SYMBOLS[number_format.currency_code]
|
|
@@ -1911,7 +1923,7 @@ def _float_to_fraction(value: float, denominator: int) -> str:
|
|
|
1911
1923
|
|
|
1912
1924
|
def _float_to_n_digit_fraction(value: float, max_digits: int) -> str:
|
|
1913
1925
|
"""
|
|
1914
|
-
Convert a float to a fraction of a
|
|
1926
|
+
Convert a float to a fraction of a maximum number of digits
|
|
1915
1927
|
and return as a string.
|
|
1916
1928
|
"""
|
|
1917
1929
|
max_denominator = 10**max_digits - 1
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from collections import OrderedDict
|
|
2
1
|
from datetime import datetime
|
|
3
2
|
from enum import IntEnum
|
|
4
3
|
from math import ceil
|
|
@@ -82,6 +81,9 @@ CUSTOM_TEXT_PLACEHOLDER = "\ue421"
|
|
|
82
81
|
|
|
83
82
|
# Supported versions
|
|
84
83
|
SUPPORTED_NUMBERS_VERSIONS = [
|
|
84
|
+
"10.0",
|
|
85
|
+
"10.1",
|
|
86
|
+
"10.2",
|
|
85
87
|
"10.3",
|
|
86
88
|
"11.0",
|
|
87
89
|
"11.1",
|
|
@@ -100,6 +102,7 @@ SUPPORTED_NUMBERS_VERSIONS = [
|
|
|
100
102
|
"14.5",
|
|
101
103
|
# Numbers Creator Studio
|
|
102
104
|
"26.0",
|
|
105
|
+
"26.1",
|
|
103
106
|
]
|
|
104
107
|
|
|
105
108
|
|
|
@@ -120,51 +123,53 @@ def _week_of_month(value: datetime) -> int:
|
|
|
120
123
|
return ceil((value.day + value.replace(day=1).weekday()) / 7.0)
|
|
121
124
|
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
126
|
+
# Cell formats. We reorder so that the keys are in length order to greedily
|
|
127
|
+
# match ss in favour of s, etc.
|
|
128
|
+
_DATETIME_FIELD_MAP = {
|
|
129
|
+
"a": lambda x: x.strftime("%p").lower(),
|
|
130
|
+
"EEEE": "%A",
|
|
131
|
+
"EEE": "%a",
|
|
132
|
+
"yyyy": "%Y",
|
|
133
|
+
"yy": "%y",
|
|
134
|
+
"y": "%Y",
|
|
135
|
+
"MMMM": "%B",
|
|
136
|
+
"MMM": "%b",
|
|
137
|
+
"MM": "%m",
|
|
138
|
+
"M": "%-m",
|
|
139
|
+
"d": "%-d",
|
|
140
|
+
"dd": "%d",
|
|
141
|
+
"DDD": lambda x: str(_day_of_year(x)).zfill(3),
|
|
142
|
+
"DD": lambda x: str(_day_of_year(x)).zfill(2),
|
|
143
|
+
"D": lambda x: str(_day_of_year(x)).zfill(1),
|
|
144
|
+
"HH": "%H",
|
|
145
|
+
"H": "%-H",
|
|
146
|
+
"hh": "%I",
|
|
147
|
+
"h": "%-I",
|
|
148
|
+
"k": lambda x: str(x.hour).replace("0", "24"),
|
|
149
|
+
"kk": lambda x: str(x.hour).replace("0", "24").zfill(2),
|
|
150
|
+
"K": lambda x: str(x.hour % 12),
|
|
151
|
+
"KK": lambda x: str(x.hour % 12).zfill(2),
|
|
152
|
+
"mm": lambda x: str(x.minute).zfill(2),
|
|
153
|
+
"m": lambda x: str(x.minute),
|
|
154
|
+
"ss": "%S",
|
|
155
|
+
"s": lambda x: str(x.second),
|
|
156
|
+
"W": lambda x: str(_week_of_month(x) - 1),
|
|
157
|
+
"ww": "%W",
|
|
158
|
+
"G": "AD", # TODO: support BC
|
|
159
|
+
"F": lambda x: _days_occurred_in_month(x),
|
|
160
|
+
"S": lambda x: str(x.microsecond).zfill(6)[0],
|
|
161
|
+
"SS": lambda x: str(x.microsecond).zfill(6)[0:2],
|
|
162
|
+
"SSS": lambda x: str(x.microsecond).zfill(6)[0:3],
|
|
163
|
+
"SSSS": lambda x: str(x.microsecond).zfill(6)[0:4],
|
|
164
|
+
"SSSSS": lambda x: str(x.microsecond).zfill(6)[0:5],
|
|
165
|
+
# Table category formats
|
|
166
|
+
"QQQ": lambda x: "Q" + str(int(x.month / 3) + 1),
|
|
167
|
+
"LLLL": "%B",
|
|
168
|
+
"w": "%-W",
|
|
169
|
+
}
|
|
170
|
+
DATETIME_FIELD_MAP = {
|
|
171
|
+
x: _DATETIME_FIELD_MAP[x] for x in sorted(_DATETIME_FIELD_MAP, key=len, reverse=True)
|
|
172
|
+
}
|
|
168
173
|
|
|
169
174
|
# From TSCEArchives
|
|
170
175
|
COLON_TRACT_NODE = 67
|
|
@@ -323,13 +328,13 @@ class FractionAccuracy(IntEnum):
|
|
|
323
328
|
"""Fractions are formatted to the nearest half."""
|
|
324
329
|
QUARTERS = 4
|
|
325
330
|
"""Fractions are formatted to the nearest quarter."""
|
|
326
|
-
|
|
331
|
+
EIGHTHS = 8
|
|
327
332
|
"""Fractions are formatted to the nearest eighth."""
|
|
328
333
|
SIXTEENTHS = 16
|
|
329
334
|
"""Fractions are formatted to the nearest sixteenth."""
|
|
330
335
|
TENTHS = 10
|
|
331
336
|
"""Fractions are formatted to the nearest tenth."""
|
|
332
|
-
|
|
337
|
+
HUNDREDTHS = 100
|
|
333
338
|
"""Fractions are formatted to the nearest hundredth."""
|
|
334
339
|
|
|
335
340
|
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TNArchives_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TNArchives.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TNArchives.proto'
|
|
19
19
|
)
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TNArchives_sos_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TNArchives_sos.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TNArchives_sos.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TNCommandArchives.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TNCommandArchives.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TNCommandArchives_sos.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TNCommandArchives_sos.proto'
|
|
19
19
|
)
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSAArchives_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSAArchives.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSAArchives.proto'
|
|
19
19
|
)
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSAArchives_sos_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSAArchives_sos.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSAArchives_sos.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSACommandArchives_sos.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSACommandArchives_sos.proto'
|
|
19
19
|
)
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCEArchives_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSCEArchives.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSCEArchives.proto'
|
|
19
19
|
)
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCH3DArchives_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSCH3DArchives.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSCH3DArchives.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSCHArchives_Common.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSCHArchives_Common.proto'
|
|
19
19
|
)
|
{numbers_parser-4.18.2 → numbers_parser-4.18.4}/src/numbers_parser/generated/TSCHArchives_GEN_pb2.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: TSCHArchives_GEN.proto
|
|
5
|
-
# Protobuf Python Version:
|
|
5
|
+
# Protobuf Python Version: 7.34.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -11,9 +11,9 @@ from google.protobuf import symbol_database as _symbol_database
|
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
7,
|
|
15
|
+
34,
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'TSCHArchives_GEN.proto'
|
|
19
19
|
)
|