@v587d/capital-generation 2.29.0 → 2.30.1

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 (305) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +3 -3
  3. package/THIRD_PARTY_NOTICES.md +16 -0
  4. package/automation/package.json +1 -1
  5. package/chart-ui/package.json +1 -1
  6. package/config/package.json +1 -1
  7. package/lib/collector-runtime.js +56 -1
  8. package/lib/data-collector/catalog-taxonomy.d.ts +1 -1
  9. package/lib/data-collector/catalog-taxonomy.js +33 -0
  10. package/lib/data-collector/dataset-tools.js +4 -2
  11. package/lib/data-collector/describe.d.ts +2 -0
  12. package/lib/data-collector/describe.js +2 -0
  13. package/lib/data-collector/store.d.ts +11 -0
  14. package/lib/data-collector/store.js +80 -1
  15. package/lib/data-collector/tools.d.ts +1 -1
  16. package/lib/data-collector/tools.js +10 -9
  17. package/lib/python-runtime/errors.d.ts +1 -1
  18. package/lib/python-runtime/errors.js +2 -0
  19. package/lib/python-runtime/manager.d.ts +28 -1
  20. package/lib/python-runtime/manager.js +141 -5
  21. package/lib/python-runtime/probe.d.ts +24 -0
  22. package/lib/python-runtime/probe.js +66 -50
  23. package/lib/sources/csindex-http.d.ts +4 -0
  24. package/lib/sources/csindex-http.js +233 -0
  25. package/lib/sources/eastmoney-http.js +1504 -1
  26. package/lib/sources/fuyao-rest.js +168 -8
  27. package/lib/sources/official-http.d.ts +4 -0
  28. package/lib/sources/official-http.js +477 -0
  29. package/lib/sources/python-remote.d.ts +25 -0
  30. package/lib/sources/python-remote.js +461 -0
  31. package/lib/sources/sina-http.d.ts +2 -0
  32. package/lib/sources/sina-http.js +484 -0
  33. package/lib/sources/tencent-http.js +23 -8
  34. package/lib/sources/ths-http.d.ts +2 -0
  35. package/lib/sources/ths-http.js +517 -0
  36. package/lib/time/tools.js +19 -0
  37. package/lib/web-retriever/local-fetch.d.ts +1 -1
  38. package/lib/web-retriever/local-fetch.js +1 -1
  39. package/lib/web-retriever/sources.d.ts +7 -0
  40. package/lib/web-retriever/sources.js +46 -21
  41. package/lib/web-retriever/throttle.d.ts +8 -0
  42. package/lib/web-retriever/throttle.js +13 -0
  43. package/lib/web-retriever/tools.js +1 -1
  44. package/lib/web-retriever/wind-client.d.ts +1 -1
  45. package/lib/web-retriever/wind-client.js +1 -1
  46. package/package.json +1 -1
  47. package/preset/capital-generation/agent.patch.yml +7 -5
  48. package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +16 -16
  49. package/python/scripts/baostock_stock_basic.py +129 -0
  50. package/python/scripts/baostock_valuation_history.py +141 -0
  51. package/python/scripts/pbc_social_financing.py +291 -0
  52. package/python/vendor/baostock/LICENSE +19 -0
  53. package/python/vendor/baostock/__init__.py +42 -0
  54. package/python/vendor/baostock/common/__init__.py +0 -0
  55. package/python/vendor/baostock/common/contants.py +189 -0
  56. package/python/vendor/baostock/common/context.py +4 -0
  57. package/python/vendor/baostock/corpreport/__init__.py +0 -0
  58. package/python/vendor/baostock/corpreport/corp_performance.py +202 -0
  59. package/python/vendor/baostock/data/__init__.py +0 -0
  60. package/python/vendor/baostock/data/messageheader.py +17 -0
  61. package/python/vendor/baostock/data/msg.py +21 -0
  62. package/python/vendor/baostock/data/resultset.py +200 -0
  63. package/python/vendor/baostock/demo/__init__.py +0 -0
  64. package/python/vendor/baostock/demo/demo_A_stock_5mk-data.py +34 -0
  65. package/python/vendor/baostock/demo/demo_A_stock_k_data.py +36 -0
  66. package/python/vendor/baostock/demo/demo_AllStock.py +27 -0
  67. package/python/vendor/baostock/demo/demo_Balance_data.py +22 -0
  68. package/python/vendor/baostock/demo/demo_CashFlow_data.py +22 -0
  69. package/python/vendor/baostock/demo/demo_Dividend_data.py +35 -0
  70. package/python/vendor/baostock/demo/demo_Dupont_data.py +25 -0
  71. package/python/vendor/baostock/demo/demo_Forecast_report.py +24 -0
  72. package/python/vendor/baostock/demo/demo_Growth_data.py +22 -0
  73. package/python/vendor/baostock/demo/demo_Index_k_data.py +39 -0
  74. package/python/vendor/baostock/demo/demo_Operation_data.py +22 -0
  75. package/python/vendor/baostock/demo/demo_PerformanceExpress_report.py +25 -0
  76. package/python/vendor/baostock/demo/demo_Profit_data.py +22 -0
  77. package/python/vendor/baostock/demo/demo_TradeDates.py +27 -0
  78. package/python/vendor/baostock/demo/demo_adjust_factor_data.py +23 -0
  79. package/python/vendor/baostock/demo/demo_assignDayData.py +23 -0
  80. package/python/vendor/baostock/demo/demo_daily_adjust_factor_data.py +28 -0
  81. package/python/vendor/baostock/demo/demo_daily_k_4_AStock.py +28 -0
  82. package/python/vendor/baostock/demo/demo_daily_k_4_ETF.py +28 -0
  83. package/python/vendor/baostock/demo/demo_depositRate_data.py +26 -0
  84. package/python/vendor/baostock/demo/demo_hs300_stocks.py +26 -0
  85. package/python/vendor/baostock/demo/demo_loanRate_data.py +26 -0
  86. package/python/vendor/baostock/demo/demo_moneySupplyDataMonth_data.py +26 -0
  87. package/python/vendor/baostock/demo/demo_moneySupplyDataYear_data.py +26 -0
  88. package/python/vendor/baostock/demo/demo_requiredReserveRatio_data.py +26 -0
  89. package/python/vendor/baostock/demo/demo_set_API_key.py +37 -0
  90. package/python/vendor/baostock/demo/demo_stockBasic_data.py +27 -0
  91. package/python/vendor/baostock/demo/demo_stock_Valuation_indicator_data.py +34 -0
  92. package/python/vendor/baostock/demo/demo_stock_industry.py +26 -0
  93. package/python/vendor/baostock/demo/demo_sz50stocks.py +26 -0
  94. package/python/vendor/baostock/demo/demo_zz500_stock.py +26 -0
  95. package/python/vendor/baostock/evaluation/__init__.py +0 -0
  96. package/python/vendor/baostock/evaluation/season_index.py +758 -0
  97. package/python/vendor/baostock/login/__init__.py +0 -0
  98. package/python/vendor/baostock/login/loginout.py +230 -0
  99. package/python/vendor/baostock/macroscopic/__init__.py +0 -0
  100. package/python/vendor/baostock/macroscopic/economic_data.py +723 -0
  101. package/python/vendor/baostock/metadata/__init__.py +0 -0
  102. package/python/vendor/baostock/metadata/stock_metadata.py +207 -0
  103. package/python/vendor/baostock/security/__init__.py +0 -0
  104. package/python/vendor/baostock/security/history.py +265 -0
  105. package/python/vendor/baostock/security/sectorinfo.py +1024 -0
  106. package/python/vendor/baostock/util/__init__.py +0 -0
  107. package/python/vendor/baostock/util/socketutil.py +97 -0
  108. package/python/vendor/baostock/util/stringutil.py +83 -0
  109. package/python/vendor/et_xmlfile/LICENSE +23 -0
  110. package/python/vendor/et_xmlfile/LICENSE.python +298 -0
  111. package/python/vendor/et_xmlfile/__init__.py +8 -0
  112. package/python/vendor/et_xmlfile/incremental_tree.py +917 -0
  113. package/python/vendor/et_xmlfile/xmlfile.py +158 -0
  114. package/python/vendor/openpyxl/LICENSE +23 -0
  115. package/python/vendor/openpyxl/__init__.py +19 -0
  116. package/python/vendor/openpyxl/_constants.py +13 -0
  117. package/python/vendor/openpyxl/cell/__init__.py +4 -0
  118. package/python/vendor/openpyxl/cell/_writer.py +136 -0
  119. package/python/vendor/openpyxl/cell/cell.py +332 -0
  120. package/python/vendor/openpyxl/cell/read_only.py +136 -0
  121. package/python/vendor/openpyxl/cell/rich_text.py +202 -0
  122. package/python/vendor/openpyxl/cell/text.py +184 -0
  123. package/python/vendor/openpyxl/chart/_3d.py +105 -0
  124. package/python/vendor/openpyxl/chart/__init__.py +19 -0
  125. package/python/vendor/openpyxl/chart/_chart.py +199 -0
  126. package/python/vendor/openpyxl/chart/area_chart.py +106 -0
  127. package/python/vendor/openpyxl/chart/axis.py +401 -0
  128. package/python/vendor/openpyxl/chart/bar_chart.py +144 -0
  129. package/python/vendor/openpyxl/chart/bubble_chart.py +67 -0
  130. package/python/vendor/openpyxl/chart/chartspace.py +195 -0
  131. package/python/vendor/openpyxl/chart/data_source.py +246 -0
  132. package/python/vendor/openpyxl/chart/descriptors.py +43 -0
  133. package/python/vendor/openpyxl/chart/error_bar.py +62 -0
  134. package/python/vendor/openpyxl/chart/label.py +127 -0
  135. package/python/vendor/openpyxl/chart/layout.py +74 -0
  136. package/python/vendor/openpyxl/chart/legend.py +75 -0
  137. package/python/vendor/openpyxl/chart/line_chart.py +129 -0
  138. package/python/vendor/openpyxl/chart/marker.py +90 -0
  139. package/python/vendor/openpyxl/chart/picture.py +35 -0
  140. package/python/vendor/openpyxl/chart/pie_chart.py +177 -0
  141. package/python/vendor/openpyxl/chart/pivot.py +65 -0
  142. package/python/vendor/openpyxl/chart/plotarea.py +162 -0
  143. package/python/vendor/openpyxl/chart/print_settings.py +57 -0
  144. package/python/vendor/openpyxl/chart/radar_chart.py +55 -0
  145. package/python/vendor/openpyxl/chart/reader.py +32 -0
  146. package/python/vendor/openpyxl/chart/reference.py +124 -0
  147. package/python/vendor/openpyxl/chart/scatter_chart.py +53 -0
  148. package/python/vendor/openpyxl/chart/series.py +197 -0
  149. package/python/vendor/openpyxl/chart/series_factory.py +41 -0
  150. package/python/vendor/openpyxl/chart/shapes.py +89 -0
  151. package/python/vendor/openpyxl/chart/stock_chart.py +54 -0
  152. package/python/vendor/openpyxl/chart/surface_chart.py +119 -0
  153. package/python/vendor/openpyxl/chart/text.py +78 -0
  154. package/python/vendor/openpyxl/chart/title.py +76 -0
  155. package/python/vendor/openpyxl/chart/trendline.py +98 -0
  156. package/python/vendor/openpyxl/chart/updown_bars.py +31 -0
  157. package/python/vendor/openpyxl/chartsheet/__init__.py +3 -0
  158. package/python/vendor/openpyxl/chartsheet/chartsheet.py +107 -0
  159. package/python/vendor/openpyxl/chartsheet/custom.py +61 -0
  160. package/python/vendor/openpyxl/chartsheet/properties.py +28 -0
  161. package/python/vendor/openpyxl/chartsheet/protection.py +41 -0
  162. package/python/vendor/openpyxl/chartsheet/publish.py +58 -0
  163. package/python/vendor/openpyxl/chartsheet/relation.py +97 -0
  164. package/python/vendor/openpyxl/chartsheet/views.py +51 -0
  165. package/python/vendor/openpyxl/comments/__init__.py +4 -0
  166. package/python/vendor/openpyxl/comments/author.py +21 -0
  167. package/python/vendor/openpyxl/comments/comment_sheet.py +211 -0
  168. package/python/vendor/openpyxl/comments/comments.py +62 -0
  169. package/python/vendor/openpyxl/comments/shape_writer.py +112 -0
  170. package/python/vendor/openpyxl/compat/__init__.py +54 -0
  171. package/python/vendor/openpyxl/compat/abc.py +8 -0
  172. package/python/vendor/openpyxl/compat/numbers.py +43 -0
  173. package/python/vendor/openpyxl/compat/product.py +17 -0
  174. package/python/vendor/openpyxl/compat/singleton.py +40 -0
  175. package/python/vendor/openpyxl/compat/strings.py +25 -0
  176. package/python/vendor/openpyxl/descriptors/__init__.py +58 -0
  177. package/python/vendor/openpyxl/descriptors/base.py +272 -0
  178. package/python/vendor/openpyxl/descriptors/container.py +41 -0
  179. package/python/vendor/openpyxl/descriptors/excel.py +112 -0
  180. package/python/vendor/openpyxl/descriptors/namespace.py +12 -0
  181. package/python/vendor/openpyxl/descriptors/nested.py +129 -0
  182. package/python/vendor/openpyxl/descriptors/sequence.py +136 -0
  183. package/python/vendor/openpyxl/descriptors/serialisable.py +240 -0
  184. package/python/vendor/openpyxl/descriptors/slots.py +18 -0
  185. package/python/vendor/openpyxl/drawing/__init__.py +4 -0
  186. package/python/vendor/openpyxl/drawing/colors.py +435 -0
  187. package/python/vendor/openpyxl/drawing/connector.py +144 -0
  188. package/python/vendor/openpyxl/drawing/drawing.py +92 -0
  189. package/python/vendor/openpyxl/drawing/effect.py +407 -0
  190. package/python/vendor/openpyxl/drawing/fill.py +425 -0
  191. package/python/vendor/openpyxl/drawing/geometry.py +584 -0
  192. package/python/vendor/openpyxl/drawing/graphic.py +177 -0
  193. package/python/vendor/openpyxl/drawing/image.py +65 -0
  194. package/python/vendor/openpyxl/drawing/line.py +144 -0
  195. package/python/vendor/openpyxl/drawing/picture.py +144 -0
  196. package/python/vendor/openpyxl/drawing/properties.py +174 -0
  197. package/python/vendor/openpyxl/drawing/relation.py +17 -0
  198. package/python/vendor/openpyxl/drawing/spreadsheet_drawing.py +382 -0
  199. package/python/vendor/openpyxl/drawing/text.py +717 -0
  200. package/python/vendor/openpyxl/drawing/xdr.py +33 -0
  201. package/python/vendor/openpyxl/formatting/__init__.py +3 -0
  202. package/python/vendor/openpyxl/formatting/formatting.py +114 -0
  203. package/python/vendor/openpyxl/formatting/rule.py +291 -0
  204. package/python/vendor/openpyxl/formula/__init__.py +3 -0
  205. package/python/vendor/openpyxl/formula/tokenizer.py +446 -0
  206. package/python/vendor/openpyxl/formula/translate.py +166 -0
  207. package/python/vendor/openpyxl/packaging/__init__.py +3 -0
  208. package/python/vendor/openpyxl/packaging/core.py +115 -0
  209. package/python/vendor/openpyxl/packaging/custom.py +289 -0
  210. package/python/vendor/openpyxl/packaging/extended.py +137 -0
  211. package/python/vendor/openpyxl/packaging/interface.py +56 -0
  212. package/python/vendor/openpyxl/packaging/manifest.py +194 -0
  213. package/python/vendor/openpyxl/packaging/relationship.py +158 -0
  214. package/python/vendor/openpyxl/packaging/workbook.py +185 -0
  215. package/python/vendor/openpyxl/pivot/__init__.py +1 -0
  216. package/python/vendor/openpyxl/pivot/cache.py +965 -0
  217. package/python/vendor/openpyxl/pivot/fields.py +326 -0
  218. package/python/vendor/openpyxl/pivot/record.py +111 -0
  219. package/python/vendor/openpyxl/pivot/table.py +1261 -0
  220. package/python/vendor/openpyxl/reader/__init__.py +1 -0
  221. package/python/vendor/openpyxl/reader/drawings.py +71 -0
  222. package/python/vendor/openpyxl/reader/excel.py +349 -0
  223. package/python/vendor/openpyxl/reader/strings.py +44 -0
  224. package/python/vendor/openpyxl/reader/workbook.py +133 -0
  225. package/python/vendor/openpyxl/styles/__init__.py +11 -0
  226. package/python/vendor/openpyxl/styles/alignment.py +62 -0
  227. package/python/vendor/openpyxl/styles/borders.py +103 -0
  228. package/python/vendor/openpyxl/styles/builtins.py +1397 -0
  229. package/python/vendor/openpyxl/styles/cell_style.py +206 -0
  230. package/python/vendor/openpyxl/styles/colors.py +172 -0
  231. package/python/vendor/openpyxl/styles/differential.py +95 -0
  232. package/python/vendor/openpyxl/styles/fills.py +224 -0
  233. package/python/vendor/openpyxl/styles/fonts.py +113 -0
  234. package/python/vendor/openpyxl/styles/named_styles.py +282 -0
  235. package/python/vendor/openpyxl/styles/numbers.py +200 -0
  236. package/python/vendor/openpyxl/styles/protection.py +17 -0
  237. package/python/vendor/openpyxl/styles/proxy.py +62 -0
  238. package/python/vendor/openpyxl/styles/styleable.py +151 -0
  239. package/python/vendor/openpyxl/styles/stylesheet.py +274 -0
  240. package/python/vendor/openpyxl/styles/table.py +94 -0
  241. package/python/vendor/openpyxl/utils/__init__.py +17 -0
  242. package/python/vendor/openpyxl/utils/bound_dictionary.py +26 -0
  243. package/python/vendor/openpyxl/utils/cell.py +240 -0
  244. package/python/vendor/openpyxl/utils/dataframe.py +87 -0
  245. package/python/vendor/openpyxl/utils/datetime.py +140 -0
  246. package/python/vendor/openpyxl/utils/escape.py +43 -0
  247. package/python/vendor/openpyxl/utils/exceptions.py +34 -0
  248. package/python/vendor/openpyxl/utils/formulas.py +24 -0
  249. package/python/vendor/openpyxl/utils/indexed_list.py +49 -0
  250. package/python/vendor/openpyxl/utils/inference.py +60 -0
  251. package/python/vendor/openpyxl/utils/protection.py +22 -0
  252. package/python/vendor/openpyxl/utils/units.py +108 -0
  253. package/python/vendor/openpyxl/workbook/__init__.py +4 -0
  254. package/python/vendor/openpyxl/workbook/_writer.py +197 -0
  255. package/python/vendor/openpyxl/workbook/child.py +166 -0
  256. package/python/vendor/openpyxl/workbook/defined_name.py +189 -0
  257. package/python/vendor/openpyxl/workbook/external_link/__init__.py +3 -0
  258. package/python/vendor/openpyxl/workbook/external_link/external.py +190 -0
  259. package/python/vendor/openpyxl/workbook/external_reference.py +18 -0
  260. package/python/vendor/openpyxl/workbook/function_group.py +36 -0
  261. package/python/vendor/openpyxl/workbook/properties.py +151 -0
  262. package/python/vendor/openpyxl/workbook/protection.py +163 -0
  263. package/python/vendor/openpyxl/workbook/smart_tags.py +56 -0
  264. package/python/vendor/openpyxl/workbook/views.py +155 -0
  265. package/python/vendor/openpyxl/workbook/web.py +98 -0
  266. package/python/vendor/openpyxl/workbook/workbook.py +438 -0
  267. package/python/vendor/openpyxl/worksheet/__init__.py +1 -0
  268. package/python/vendor/openpyxl/worksheet/_read_only.py +190 -0
  269. package/python/vendor/openpyxl/worksheet/_reader.py +472 -0
  270. package/python/vendor/openpyxl/worksheet/_write_only.py +160 -0
  271. package/python/vendor/openpyxl/worksheet/_writer.py +390 -0
  272. package/python/vendor/openpyxl/worksheet/cell_range.py +512 -0
  273. package/python/vendor/openpyxl/worksheet/cell_watch.py +34 -0
  274. package/python/vendor/openpyxl/worksheet/controls.py +107 -0
  275. package/python/vendor/openpyxl/worksheet/copier.py +70 -0
  276. package/python/vendor/openpyxl/worksheet/custom.py +35 -0
  277. package/python/vendor/openpyxl/worksheet/datavalidation.py +202 -0
  278. package/python/vendor/openpyxl/worksheet/dimensions.py +306 -0
  279. package/python/vendor/openpyxl/worksheet/drawing.py +14 -0
  280. package/python/vendor/openpyxl/worksheet/errors.py +93 -0
  281. package/python/vendor/openpyxl/worksheet/filters.py +486 -0
  282. package/python/vendor/openpyxl/worksheet/formula.py +51 -0
  283. package/python/vendor/openpyxl/worksheet/header_footer.py +270 -0
  284. package/python/vendor/openpyxl/worksheet/hyperlink.py +46 -0
  285. package/python/vendor/openpyxl/worksheet/merge.py +141 -0
  286. package/python/vendor/openpyxl/worksheet/ole.py +133 -0
  287. package/python/vendor/openpyxl/worksheet/page.py +174 -0
  288. package/python/vendor/openpyxl/worksheet/pagebreak.py +94 -0
  289. package/python/vendor/openpyxl/worksheet/picture.py +8 -0
  290. package/python/vendor/openpyxl/worksheet/print_settings.py +184 -0
  291. package/python/vendor/openpyxl/worksheet/properties.py +97 -0
  292. package/python/vendor/openpyxl/worksheet/protection.py +120 -0
  293. package/python/vendor/openpyxl/worksheet/related.py +17 -0
  294. package/python/vendor/openpyxl/worksheet/scenario.py +105 -0
  295. package/python/vendor/openpyxl/worksheet/smart_tag.py +78 -0
  296. package/python/vendor/openpyxl/worksheet/table.py +385 -0
  297. package/python/vendor/openpyxl/worksheet/views.py +155 -0
  298. package/python/vendor/openpyxl/worksheet/worksheet.py +907 -0
  299. package/python/vendor/openpyxl/writer/__init__.py +1 -0
  300. package/python/vendor/openpyxl/writer/excel.py +295 -0
  301. package/python/vendor/openpyxl/writer/theme.py +291 -0
  302. package/python/vendor/openpyxl/xml/__init__.py +42 -0
  303. package/python/vendor/openpyxl/xml/constants.py +129 -0
  304. package/python/vendor/openpyxl/xml/functions.py +87 -0
  305. package/watchlist/package.json +1 -1
@@ -0,0 +1,190 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+
4
+ from openpyxl.descriptors.serialisable import Serialisable
5
+ from openpyxl.descriptors import (
6
+ Typed,
7
+ String,
8
+ Bool,
9
+ Integer,
10
+ NoneSet,
11
+ Sequence,
12
+ )
13
+ from openpyxl.descriptors.excel import Relation
14
+ from openpyxl.descriptors.nested import NestedText
15
+ from openpyxl.descriptors.sequence import NestedSequence, ValueSequence
16
+
17
+ from openpyxl.packaging.relationship import (
18
+ Relationship,
19
+ get_rels_path,
20
+ get_dependents
21
+ )
22
+ from openpyxl.xml.constants import SHEET_MAIN_NS
23
+ from openpyxl.xml.functions import fromstring
24
+
25
+
26
+ """Manage links to external Workbooks"""
27
+
28
+
29
+ class ExternalCell(Serialisable):
30
+
31
+ r = String()
32
+ t = NoneSet(values=(['b', 'd', 'n', 'e', 's', 'str', 'inlineStr']))
33
+ vm = Integer(allow_none=True)
34
+ v = NestedText(allow_none=True, expected_type=str)
35
+
36
+ def __init__(self,
37
+ r=None,
38
+ t=None,
39
+ vm=None,
40
+ v=None,
41
+ ):
42
+ self.r = r
43
+ self.t = t
44
+ self.vm = vm
45
+ self.v = v
46
+
47
+
48
+ class ExternalRow(Serialisable):
49
+
50
+ r = Integer()
51
+ cell = Sequence(expected_type=ExternalCell)
52
+
53
+ __elements__ = ('cell',)
54
+
55
+ def __init__(self,
56
+ r=(),
57
+ cell=None,
58
+ ):
59
+ self.r = r
60
+ self.cell = cell
61
+
62
+
63
+ class ExternalSheetData(Serialisable):
64
+
65
+ sheetId = Integer()
66
+ refreshError = Bool(allow_none=True)
67
+ row = Sequence(expected_type=ExternalRow)
68
+
69
+ __elements__ = ('row',)
70
+
71
+ def __init__(self,
72
+ sheetId=None,
73
+ refreshError=None,
74
+ row=(),
75
+ ):
76
+ self.sheetId = sheetId
77
+ self.refreshError = refreshError
78
+ self.row = row
79
+
80
+
81
+ class ExternalSheetDataSet(Serialisable):
82
+
83
+ sheetData = Sequence(expected_type=ExternalSheetData, )
84
+
85
+ __elements__ = ('sheetData',)
86
+
87
+ def __init__(self,
88
+ sheetData=None,
89
+ ):
90
+ self.sheetData = sheetData
91
+
92
+
93
+ class ExternalSheetNames(Serialisable):
94
+
95
+ sheetName = ValueSequence(expected_type=str)
96
+
97
+ __elements__ = ('sheetName',)
98
+
99
+ def __init__(self,
100
+ sheetName=(),
101
+ ):
102
+ self.sheetName = sheetName
103
+
104
+
105
+ class ExternalDefinedName(Serialisable):
106
+
107
+ tagname = "definedName"
108
+
109
+ name = String()
110
+ refersTo = String(allow_none=True)
111
+ sheetId = Integer(allow_none=True)
112
+
113
+ def __init__(self,
114
+ name=None,
115
+ refersTo=None,
116
+ sheetId=None,
117
+ ):
118
+ self.name = name
119
+ self.refersTo = refersTo
120
+ self.sheetId = sheetId
121
+
122
+
123
+ class ExternalBook(Serialisable):
124
+
125
+ tagname = "externalBook"
126
+
127
+ sheetNames = Typed(expected_type=ExternalSheetNames, allow_none=True)
128
+ definedNames = NestedSequence(expected_type=ExternalDefinedName)
129
+ sheetDataSet = Typed(expected_type=ExternalSheetDataSet, allow_none=True)
130
+ id = Relation()
131
+
132
+ __elements__ = ('sheetNames', 'definedNames', 'sheetDataSet')
133
+
134
+ def __init__(self,
135
+ sheetNames=None,
136
+ definedNames=(),
137
+ sheetDataSet=None,
138
+ id=None,
139
+ ):
140
+ self.sheetNames = sheetNames
141
+ self.definedNames = definedNames
142
+ self.sheetDataSet = sheetDataSet
143
+ self.id = id
144
+
145
+
146
+ class ExternalLink(Serialisable):
147
+
148
+ tagname = "externalLink"
149
+
150
+ _id = None
151
+ _path = "/xl/externalLinks/externalLink{0}.xml"
152
+ _rel_type = "externalLink"
153
+ mime_type = "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml"
154
+
155
+ externalBook = Typed(expected_type=ExternalBook, allow_none=True)
156
+ file_link = Typed(expected_type=Relationship, allow_none=True) # link to external file
157
+
158
+ __elements__ = ('externalBook', )
159
+
160
+ def __init__(self,
161
+ externalBook=None,
162
+ ddeLink=None,
163
+ oleLink=None,
164
+ extLst=None,
165
+ ):
166
+ self.externalBook = externalBook
167
+ # ignore other items for the moment.
168
+
169
+
170
+ def to_tree(self):
171
+ node = super().to_tree()
172
+ node.set("xmlns", SHEET_MAIN_NS)
173
+ return node
174
+
175
+
176
+ @property
177
+ def path(self):
178
+ return self._path.format(self._id)
179
+
180
+
181
+ def read_external_link(archive, book_path):
182
+ src = archive.read(book_path)
183
+ node = fromstring(src)
184
+ book = ExternalLink.from_tree(node)
185
+
186
+ link_path = get_rels_path(book_path)
187
+ deps = get_dependents(archive, link_path)
188
+ book.file_link = deps[0]
189
+
190
+ return book
@@ -0,0 +1,18 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ Sequence
6
+ )
7
+ from openpyxl.descriptors.excel import (
8
+ Relation,
9
+ )
10
+
11
+ class ExternalReference(Serialisable):
12
+
13
+ tagname = "externalReference"
14
+
15
+ id = Relation()
16
+
17
+ def __init__(self, id):
18
+ self.id = id
@@ -0,0 +1,36 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ Sequence,
6
+ String,
7
+ Integer,
8
+ )
9
+
10
+ class FunctionGroup(Serialisable):
11
+
12
+ tagname = "functionGroup"
13
+
14
+ name = String()
15
+
16
+ def __init__(self,
17
+ name=None,
18
+ ):
19
+ self.name = name
20
+
21
+
22
+ class FunctionGroupList(Serialisable):
23
+
24
+ tagname = "functionGroups"
25
+
26
+ builtInGroupCount = Integer(allow_none=True)
27
+ functionGroup = Sequence(expected_type=FunctionGroup, allow_none=True)
28
+
29
+ __elements__ = ('functionGroup',)
30
+
31
+ def __init__(self,
32
+ builtInGroupCount=16,
33
+ functionGroup=(),
34
+ ):
35
+ self.builtInGroupCount = builtInGroupCount
36
+ self.functionGroup = functionGroup
@@ -0,0 +1,151 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ String,
6
+ Float,
7
+ Integer,
8
+ Bool,
9
+ NoneSet,
10
+ Set,
11
+ )
12
+
13
+ from openpyxl.descriptors.excel import Guid
14
+
15
+
16
+ class WorkbookProperties(Serialisable):
17
+
18
+ tagname = "workbookPr"
19
+
20
+ date1904 = Bool(allow_none=True)
21
+ dateCompatibility = Bool(allow_none=True)
22
+ showObjects = NoneSet(values=(['all', 'placeholders']))
23
+ showBorderUnselectedTables = Bool(allow_none=True)
24
+ filterPrivacy = Bool(allow_none=True)
25
+ promptedSolutions = Bool(allow_none=True)
26
+ showInkAnnotation = Bool(allow_none=True)
27
+ backupFile = Bool(allow_none=True)
28
+ saveExternalLinkValues = Bool(allow_none=True)
29
+ updateLinks = NoneSet(values=(['userSet', 'never', 'always']))
30
+ codeName = String(allow_none=True)
31
+ hidePivotFieldList = Bool(allow_none=True)
32
+ showPivotChartFilter = Bool(allow_none=True)
33
+ allowRefreshQuery = Bool(allow_none=True)
34
+ publishItems = Bool(allow_none=True)
35
+ checkCompatibility = Bool(allow_none=True)
36
+ autoCompressPictures = Bool(allow_none=True)
37
+ refreshAllConnections = Bool(allow_none=True)
38
+ defaultThemeVersion = Integer(allow_none=True)
39
+
40
+ def __init__(self,
41
+ date1904=None,
42
+ dateCompatibility=None,
43
+ showObjects=None,
44
+ showBorderUnselectedTables=None,
45
+ filterPrivacy=None,
46
+ promptedSolutions=None,
47
+ showInkAnnotation=None,
48
+ backupFile=None,
49
+ saveExternalLinkValues=None,
50
+ updateLinks=None,
51
+ codeName=None,
52
+ hidePivotFieldList=None,
53
+ showPivotChartFilter=None,
54
+ allowRefreshQuery=None,
55
+ publishItems=None,
56
+ checkCompatibility=None,
57
+ autoCompressPictures=None,
58
+ refreshAllConnections=None,
59
+ defaultThemeVersion=None,
60
+ ):
61
+ self.date1904 = date1904
62
+ self.dateCompatibility = dateCompatibility
63
+ self.showObjects = showObjects
64
+ self.showBorderUnselectedTables = showBorderUnselectedTables
65
+ self.filterPrivacy = filterPrivacy
66
+ self.promptedSolutions = promptedSolutions
67
+ self.showInkAnnotation = showInkAnnotation
68
+ self.backupFile = backupFile
69
+ self.saveExternalLinkValues = saveExternalLinkValues
70
+ self.updateLinks = updateLinks
71
+ self.codeName = codeName
72
+ self.hidePivotFieldList = hidePivotFieldList
73
+ self.showPivotChartFilter = showPivotChartFilter
74
+ self.allowRefreshQuery = allowRefreshQuery
75
+ self.publishItems = publishItems
76
+ self.checkCompatibility = checkCompatibility
77
+ self.autoCompressPictures = autoCompressPictures
78
+ self.refreshAllConnections = refreshAllConnections
79
+ self.defaultThemeVersion = defaultThemeVersion
80
+
81
+
82
+ class CalcProperties(Serialisable):
83
+
84
+ tagname = "calcPr"
85
+
86
+ calcId = Integer()
87
+ calcMode = NoneSet(values=(['manual', 'auto', 'autoNoTable']))
88
+ fullCalcOnLoad = Bool(allow_none=True)
89
+ refMode = NoneSet(values=(['A1', 'R1C1']))
90
+ iterate = Bool(allow_none=True)
91
+ iterateCount = Integer(allow_none=True)
92
+ iterateDelta = Float(allow_none=True)
93
+ fullPrecision = Bool(allow_none=True)
94
+ calcCompleted = Bool(allow_none=True)
95
+ calcOnSave = Bool(allow_none=True)
96
+ concurrentCalc = Bool(allow_none=True)
97
+ concurrentManualCount = Integer(allow_none=True)
98
+ forceFullCalc = Bool(allow_none=True)
99
+
100
+ def __init__(self,
101
+ calcId=124519,
102
+ calcMode=None,
103
+ fullCalcOnLoad=True,
104
+ refMode=None,
105
+ iterate=None,
106
+ iterateCount=None,
107
+ iterateDelta=None,
108
+ fullPrecision=None,
109
+ calcCompleted=None,
110
+ calcOnSave=None,
111
+ concurrentCalc=None,
112
+ concurrentManualCount=None,
113
+ forceFullCalc=None,
114
+ ):
115
+ self.calcId = calcId
116
+ self.calcMode = calcMode
117
+ self.fullCalcOnLoad = fullCalcOnLoad
118
+ self.refMode = refMode
119
+ self.iterate = iterate
120
+ self.iterateCount = iterateCount
121
+ self.iterateDelta = iterateDelta
122
+ self.fullPrecision = fullPrecision
123
+ self.calcCompleted = calcCompleted
124
+ self.calcOnSave = calcOnSave
125
+ self.concurrentCalc = concurrentCalc
126
+ self.concurrentManualCount = concurrentManualCount
127
+ self.forceFullCalc = forceFullCalc
128
+
129
+
130
+ class FileVersion(Serialisable):
131
+
132
+ tagname = "fileVersion"
133
+
134
+ appName = String(allow_none=True)
135
+ lastEdited = String(allow_none=True)
136
+ lowestEdited = String(allow_none=True)
137
+ rupBuild = String(allow_none=True)
138
+ codeName = Guid(allow_none=True)
139
+
140
+ def __init__(self,
141
+ appName=None,
142
+ lastEdited=None,
143
+ lowestEdited=None,
144
+ rupBuild=None,
145
+ codeName=None,
146
+ ):
147
+ self.appName = appName
148
+ self.lastEdited = lastEdited
149
+ self.lowestEdited = lowestEdited
150
+ self.rupBuild = rupBuild
151
+ self.codeName = codeName
@@ -0,0 +1,163 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ Alias,
6
+ Typed,
7
+ String,
8
+ Float,
9
+ Integer,
10
+ Bool,
11
+ NoneSet,
12
+ Set,
13
+ )
14
+ from openpyxl.descriptors.excel import (
15
+ ExtensionList,
16
+ HexBinary,
17
+ Guid,
18
+ Relation,
19
+ Base64Binary,
20
+ )
21
+ from openpyxl.utils.protection import hash_password
22
+
23
+
24
+ class WorkbookProtection(Serialisable):
25
+
26
+ _workbook_password, _revisions_password = None, None
27
+
28
+ tagname = "workbookPr"
29
+
30
+ workbook_password = Alias("workbookPassword")
31
+ workbookPasswordCharacterSet = String(allow_none=True)
32
+ revision_password = Alias("revisionsPassword")
33
+ revisionsPasswordCharacterSet = String(allow_none=True)
34
+ lockStructure = Bool(allow_none=True)
35
+ lock_structure = Alias("lockStructure")
36
+ lockWindows = Bool(allow_none=True)
37
+ lock_windows = Alias("lockWindows")
38
+ lockRevision = Bool(allow_none=True)
39
+ lock_revision = Alias("lockRevision")
40
+ revisionsAlgorithmName = String(allow_none=True)
41
+ revisionsHashValue = Base64Binary(allow_none=True)
42
+ revisionsSaltValue = Base64Binary(allow_none=True)
43
+ revisionsSpinCount = Integer(allow_none=True)
44
+ workbookAlgorithmName = String(allow_none=True)
45
+ workbookHashValue = Base64Binary(allow_none=True)
46
+ workbookSaltValue = Base64Binary(allow_none=True)
47
+ workbookSpinCount = Integer(allow_none=True)
48
+
49
+ __attrs__ = ('workbookPassword', 'workbookPasswordCharacterSet', 'revisionsPassword',
50
+ 'revisionsPasswordCharacterSet', 'lockStructure', 'lockWindows', 'lockRevision',
51
+ 'revisionsAlgorithmName', 'revisionsHashValue', 'revisionsSaltValue',
52
+ 'revisionsSpinCount', 'workbookAlgorithmName', 'workbookHashValue',
53
+ 'workbookSaltValue', 'workbookSpinCount')
54
+
55
+ def __init__(self,
56
+ workbookPassword=None,
57
+ workbookPasswordCharacterSet=None,
58
+ revisionsPassword=None,
59
+ revisionsPasswordCharacterSet=None,
60
+ lockStructure=None,
61
+ lockWindows=None,
62
+ lockRevision=None,
63
+ revisionsAlgorithmName=None,
64
+ revisionsHashValue=None,
65
+ revisionsSaltValue=None,
66
+ revisionsSpinCount=None,
67
+ workbookAlgorithmName=None,
68
+ workbookHashValue=None,
69
+ workbookSaltValue=None,
70
+ workbookSpinCount=None,
71
+ ):
72
+ if workbookPassword is not None:
73
+ self.workbookPassword = workbookPassword
74
+ self.workbookPasswordCharacterSet = workbookPasswordCharacterSet
75
+ if revisionsPassword is not None:
76
+ self.revisionsPassword = revisionsPassword
77
+ self.revisionsPasswordCharacterSet = revisionsPasswordCharacterSet
78
+ self.lockStructure = lockStructure
79
+ self.lockWindows = lockWindows
80
+ self.lockRevision = lockRevision
81
+ self.revisionsAlgorithmName = revisionsAlgorithmName
82
+ self.revisionsHashValue = revisionsHashValue
83
+ self.revisionsSaltValue = revisionsSaltValue
84
+ self.revisionsSpinCount = revisionsSpinCount
85
+ self.workbookAlgorithmName = workbookAlgorithmName
86
+ self.workbookHashValue = workbookHashValue
87
+ self.workbookSaltValue = workbookSaltValue
88
+ self.workbookSpinCount = workbookSpinCount
89
+
90
+ def set_workbook_password(self, value='', already_hashed=False):
91
+ """Set a password on this workbook."""
92
+ if not already_hashed:
93
+ value = hash_password(value)
94
+ self._workbook_password = value
95
+
96
+ @property
97
+ def workbookPassword(self):
98
+ """Return the workbook password value, regardless of hash."""
99
+ return self._workbook_password
100
+
101
+ @workbookPassword.setter
102
+ def workbookPassword(self, value):
103
+ """Set a workbook password directly, forcing a hash step."""
104
+ self.set_workbook_password(value)
105
+
106
+ def set_revisions_password(self, value='', already_hashed=False):
107
+ """Set a revision password on this workbook."""
108
+ if not already_hashed:
109
+ value = hash_password(value)
110
+ self._revisions_password = value
111
+
112
+ @property
113
+ def revisionsPassword(self):
114
+ """Return the revisions password value, regardless of hash."""
115
+ return self._revisions_password
116
+
117
+ @revisionsPassword.setter
118
+ def revisionsPassword(self, value):
119
+ """Set a revisions password directly, forcing a hash step."""
120
+ self.set_revisions_password(value)
121
+
122
+ @classmethod
123
+ def from_tree(cls, node):
124
+ """Don't hash passwords when deserialising from XML"""
125
+ self = super().from_tree(node)
126
+ if self.workbookPassword:
127
+ self.set_workbook_password(node.get('workbookPassword'), already_hashed=True)
128
+ if self.revisionsPassword:
129
+ self.set_revisions_password(node.get('revisionsPassword'), already_hashed=True)
130
+ return self
131
+
132
+ # Backwards compatibility
133
+ DocumentSecurity = WorkbookProtection
134
+
135
+
136
+ class FileSharing(Serialisable):
137
+
138
+ tagname = "fileSharing"
139
+
140
+ readOnlyRecommended = Bool(allow_none=True)
141
+ userName = String(allow_none=True)
142
+ reservationPassword = HexBinary(allow_none=True)
143
+ algorithmName = String(allow_none=True)
144
+ hashValue = Base64Binary(allow_none=True)
145
+ saltValue = Base64Binary(allow_none=True)
146
+ spinCount = Integer(allow_none=True)
147
+
148
+ def __init__(self,
149
+ readOnlyRecommended=None,
150
+ userName=None,
151
+ reservationPassword=None,
152
+ algorithmName=None,
153
+ hashValue=None,
154
+ saltValue=None,
155
+ spinCount=None,
156
+ ):
157
+ self.readOnlyRecommended = readOnlyRecommended
158
+ self.userName = userName
159
+ self.reservationPassword = reservationPassword
160
+ self.algorithmName = algorithmName
161
+ self.hashValue = hashValue
162
+ self.saltValue = saltValue
163
+ self.spinCount = spinCount
@@ -0,0 +1,56 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ Sequence,
6
+ String,
7
+ Bool,
8
+ NoneSet,
9
+
10
+ )
11
+
12
+ class SmartTag(Serialisable):
13
+
14
+ tagname = "smartTagType"
15
+
16
+ namespaceUri = String(allow_none=True)
17
+ name = String(allow_none=True)
18
+ url = String(allow_none=True)
19
+
20
+ def __init__(self,
21
+ namespaceUri=None,
22
+ name=None,
23
+ url=None,
24
+ ):
25
+ self.namespaceUri = namespaceUri
26
+ self.name = name
27
+ self.url = url
28
+
29
+
30
+ class SmartTagList(Serialisable):
31
+
32
+ tagname = "smartTagTypes"
33
+
34
+ smartTagType = Sequence(expected_type=SmartTag, allow_none=True)
35
+
36
+ __elements__ = ('smartTagType',)
37
+
38
+ def __init__(self,
39
+ smartTagType=(),
40
+ ):
41
+ self.smartTagType = smartTagType
42
+
43
+
44
+ class SmartTagProperties(Serialisable):
45
+
46
+ tagname = "smartTagPr"
47
+
48
+ embed = Bool(allow_none=True)
49
+ show = NoneSet(values=(['all', 'noIndicator']))
50
+
51
+ def __init__(self,
52
+ embed=None,
53
+ show=None,
54
+ ):
55
+ self.embed = embed
56
+ self.show = show