@v587d/capital-generation 2.29.0 → 2.30.0

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 (299) hide show
  1. package/CHANGELOG.md +38 -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/tools.js +7 -7
  11. package/lib/python-runtime/errors.d.ts +1 -1
  12. package/lib/python-runtime/errors.js +2 -0
  13. package/lib/python-runtime/manager.d.ts +28 -1
  14. package/lib/python-runtime/manager.js +141 -5
  15. package/lib/python-runtime/probe.d.ts +24 -0
  16. package/lib/python-runtime/probe.js +66 -50
  17. package/lib/sources/csindex-http.d.ts +4 -0
  18. package/lib/sources/csindex-http.js +233 -0
  19. package/lib/sources/eastmoney-http.js +1504 -1
  20. package/lib/sources/fuyao-rest.js +168 -8
  21. package/lib/sources/official-http.d.ts +4 -0
  22. package/lib/sources/official-http.js +477 -0
  23. package/lib/sources/python-remote.d.ts +25 -0
  24. package/lib/sources/python-remote.js +461 -0
  25. package/lib/sources/sina-http.d.ts +2 -0
  26. package/lib/sources/sina-http.js +484 -0
  27. package/lib/sources/tencent-http.js +23 -8
  28. package/lib/sources/ths-http.d.ts +2 -0
  29. package/lib/sources/ths-http.js +514 -0
  30. package/lib/time/tools.js +19 -0
  31. package/lib/web-retriever/local-fetch.d.ts +1 -1
  32. package/lib/web-retriever/local-fetch.js +1 -1
  33. package/lib/web-retriever/sources.d.ts +7 -0
  34. package/lib/web-retriever/sources.js +46 -21
  35. package/lib/web-retriever/throttle.d.ts +8 -0
  36. package/lib/web-retriever/throttle.js +13 -0
  37. package/lib/web-retriever/tools.js +1 -1
  38. package/lib/web-retriever/wind-client.d.ts +1 -1
  39. package/lib/web-retriever/wind-client.js +1 -1
  40. package/package.json +1 -1
  41. package/preset/capital-generation/agent.patch.yml +7 -5
  42. package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +16 -16
  43. package/python/scripts/baostock_stock_basic.py +129 -0
  44. package/python/scripts/baostock_valuation_history.py +141 -0
  45. package/python/scripts/pbc_social_financing.py +291 -0
  46. package/python/vendor/baostock/LICENSE +19 -0
  47. package/python/vendor/baostock/__init__.py +42 -0
  48. package/python/vendor/baostock/common/__init__.py +0 -0
  49. package/python/vendor/baostock/common/contants.py +189 -0
  50. package/python/vendor/baostock/common/context.py +4 -0
  51. package/python/vendor/baostock/corpreport/__init__.py +0 -0
  52. package/python/vendor/baostock/corpreport/corp_performance.py +202 -0
  53. package/python/vendor/baostock/data/__init__.py +0 -0
  54. package/python/vendor/baostock/data/messageheader.py +17 -0
  55. package/python/vendor/baostock/data/msg.py +21 -0
  56. package/python/vendor/baostock/data/resultset.py +200 -0
  57. package/python/vendor/baostock/demo/__init__.py +0 -0
  58. package/python/vendor/baostock/demo/demo_A_stock_5mk-data.py +34 -0
  59. package/python/vendor/baostock/demo/demo_A_stock_k_data.py +36 -0
  60. package/python/vendor/baostock/demo/demo_AllStock.py +27 -0
  61. package/python/vendor/baostock/demo/demo_Balance_data.py +22 -0
  62. package/python/vendor/baostock/demo/demo_CashFlow_data.py +22 -0
  63. package/python/vendor/baostock/demo/demo_Dividend_data.py +35 -0
  64. package/python/vendor/baostock/demo/demo_Dupont_data.py +25 -0
  65. package/python/vendor/baostock/demo/demo_Forecast_report.py +24 -0
  66. package/python/vendor/baostock/demo/demo_Growth_data.py +22 -0
  67. package/python/vendor/baostock/demo/demo_Index_k_data.py +39 -0
  68. package/python/vendor/baostock/demo/demo_Operation_data.py +22 -0
  69. package/python/vendor/baostock/demo/demo_PerformanceExpress_report.py +25 -0
  70. package/python/vendor/baostock/demo/demo_Profit_data.py +22 -0
  71. package/python/vendor/baostock/demo/demo_TradeDates.py +27 -0
  72. package/python/vendor/baostock/demo/demo_adjust_factor_data.py +23 -0
  73. package/python/vendor/baostock/demo/demo_assignDayData.py +23 -0
  74. package/python/vendor/baostock/demo/demo_daily_adjust_factor_data.py +28 -0
  75. package/python/vendor/baostock/demo/demo_daily_k_4_AStock.py +28 -0
  76. package/python/vendor/baostock/demo/demo_daily_k_4_ETF.py +28 -0
  77. package/python/vendor/baostock/demo/demo_depositRate_data.py +26 -0
  78. package/python/vendor/baostock/demo/demo_hs300_stocks.py +26 -0
  79. package/python/vendor/baostock/demo/demo_loanRate_data.py +26 -0
  80. package/python/vendor/baostock/demo/demo_moneySupplyDataMonth_data.py +26 -0
  81. package/python/vendor/baostock/demo/demo_moneySupplyDataYear_data.py +26 -0
  82. package/python/vendor/baostock/demo/demo_requiredReserveRatio_data.py +26 -0
  83. package/python/vendor/baostock/demo/demo_set_API_key.py +37 -0
  84. package/python/vendor/baostock/demo/demo_stockBasic_data.py +27 -0
  85. package/python/vendor/baostock/demo/demo_stock_Valuation_indicator_data.py +34 -0
  86. package/python/vendor/baostock/demo/demo_stock_industry.py +26 -0
  87. package/python/vendor/baostock/demo/demo_sz50stocks.py +26 -0
  88. package/python/vendor/baostock/demo/demo_zz500_stock.py +26 -0
  89. package/python/vendor/baostock/evaluation/__init__.py +0 -0
  90. package/python/vendor/baostock/evaluation/season_index.py +758 -0
  91. package/python/vendor/baostock/login/__init__.py +0 -0
  92. package/python/vendor/baostock/login/loginout.py +230 -0
  93. package/python/vendor/baostock/macroscopic/__init__.py +0 -0
  94. package/python/vendor/baostock/macroscopic/economic_data.py +723 -0
  95. package/python/vendor/baostock/metadata/__init__.py +0 -0
  96. package/python/vendor/baostock/metadata/stock_metadata.py +207 -0
  97. package/python/vendor/baostock/security/__init__.py +0 -0
  98. package/python/vendor/baostock/security/history.py +265 -0
  99. package/python/vendor/baostock/security/sectorinfo.py +1024 -0
  100. package/python/vendor/baostock/util/__init__.py +0 -0
  101. package/python/vendor/baostock/util/socketutil.py +97 -0
  102. package/python/vendor/baostock/util/stringutil.py +83 -0
  103. package/python/vendor/et_xmlfile/LICENSE +23 -0
  104. package/python/vendor/et_xmlfile/LICENSE.python +298 -0
  105. package/python/vendor/et_xmlfile/__init__.py +8 -0
  106. package/python/vendor/et_xmlfile/incremental_tree.py +917 -0
  107. package/python/vendor/et_xmlfile/xmlfile.py +158 -0
  108. package/python/vendor/openpyxl/LICENSE +23 -0
  109. package/python/vendor/openpyxl/__init__.py +19 -0
  110. package/python/vendor/openpyxl/_constants.py +13 -0
  111. package/python/vendor/openpyxl/cell/__init__.py +4 -0
  112. package/python/vendor/openpyxl/cell/_writer.py +136 -0
  113. package/python/vendor/openpyxl/cell/cell.py +332 -0
  114. package/python/vendor/openpyxl/cell/read_only.py +136 -0
  115. package/python/vendor/openpyxl/cell/rich_text.py +202 -0
  116. package/python/vendor/openpyxl/cell/text.py +184 -0
  117. package/python/vendor/openpyxl/chart/_3d.py +105 -0
  118. package/python/vendor/openpyxl/chart/__init__.py +19 -0
  119. package/python/vendor/openpyxl/chart/_chart.py +199 -0
  120. package/python/vendor/openpyxl/chart/area_chart.py +106 -0
  121. package/python/vendor/openpyxl/chart/axis.py +401 -0
  122. package/python/vendor/openpyxl/chart/bar_chart.py +144 -0
  123. package/python/vendor/openpyxl/chart/bubble_chart.py +67 -0
  124. package/python/vendor/openpyxl/chart/chartspace.py +195 -0
  125. package/python/vendor/openpyxl/chart/data_source.py +246 -0
  126. package/python/vendor/openpyxl/chart/descriptors.py +43 -0
  127. package/python/vendor/openpyxl/chart/error_bar.py +62 -0
  128. package/python/vendor/openpyxl/chart/label.py +127 -0
  129. package/python/vendor/openpyxl/chart/layout.py +74 -0
  130. package/python/vendor/openpyxl/chart/legend.py +75 -0
  131. package/python/vendor/openpyxl/chart/line_chart.py +129 -0
  132. package/python/vendor/openpyxl/chart/marker.py +90 -0
  133. package/python/vendor/openpyxl/chart/picture.py +35 -0
  134. package/python/vendor/openpyxl/chart/pie_chart.py +177 -0
  135. package/python/vendor/openpyxl/chart/pivot.py +65 -0
  136. package/python/vendor/openpyxl/chart/plotarea.py +162 -0
  137. package/python/vendor/openpyxl/chart/print_settings.py +57 -0
  138. package/python/vendor/openpyxl/chart/radar_chart.py +55 -0
  139. package/python/vendor/openpyxl/chart/reader.py +32 -0
  140. package/python/vendor/openpyxl/chart/reference.py +124 -0
  141. package/python/vendor/openpyxl/chart/scatter_chart.py +53 -0
  142. package/python/vendor/openpyxl/chart/series.py +197 -0
  143. package/python/vendor/openpyxl/chart/series_factory.py +41 -0
  144. package/python/vendor/openpyxl/chart/shapes.py +89 -0
  145. package/python/vendor/openpyxl/chart/stock_chart.py +54 -0
  146. package/python/vendor/openpyxl/chart/surface_chart.py +119 -0
  147. package/python/vendor/openpyxl/chart/text.py +78 -0
  148. package/python/vendor/openpyxl/chart/title.py +76 -0
  149. package/python/vendor/openpyxl/chart/trendline.py +98 -0
  150. package/python/vendor/openpyxl/chart/updown_bars.py +31 -0
  151. package/python/vendor/openpyxl/chartsheet/__init__.py +3 -0
  152. package/python/vendor/openpyxl/chartsheet/chartsheet.py +107 -0
  153. package/python/vendor/openpyxl/chartsheet/custom.py +61 -0
  154. package/python/vendor/openpyxl/chartsheet/properties.py +28 -0
  155. package/python/vendor/openpyxl/chartsheet/protection.py +41 -0
  156. package/python/vendor/openpyxl/chartsheet/publish.py +58 -0
  157. package/python/vendor/openpyxl/chartsheet/relation.py +97 -0
  158. package/python/vendor/openpyxl/chartsheet/views.py +51 -0
  159. package/python/vendor/openpyxl/comments/__init__.py +4 -0
  160. package/python/vendor/openpyxl/comments/author.py +21 -0
  161. package/python/vendor/openpyxl/comments/comment_sheet.py +211 -0
  162. package/python/vendor/openpyxl/comments/comments.py +62 -0
  163. package/python/vendor/openpyxl/comments/shape_writer.py +112 -0
  164. package/python/vendor/openpyxl/compat/__init__.py +54 -0
  165. package/python/vendor/openpyxl/compat/abc.py +8 -0
  166. package/python/vendor/openpyxl/compat/numbers.py +43 -0
  167. package/python/vendor/openpyxl/compat/product.py +17 -0
  168. package/python/vendor/openpyxl/compat/singleton.py +40 -0
  169. package/python/vendor/openpyxl/compat/strings.py +25 -0
  170. package/python/vendor/openpyxl/descriptors/__init__.py +58 -0
  171. package/python/vendor/openpyxl/descriptors/base.py +272 -0
  172. package/python/vendor/openpyxl/descriptors/container.py +41 -0
  173. package/python/vendor/openpyxl/descriptors/excel.py +112 -0
  174. package/python/vendor/openpyxl/descriptors/namespace.py +12 -0
  175. package/python/vendor/openpyxl/descriptors/nested.py +129 -0
  176. package/python/vendor/openpyxl/descriptors/sequence.py +136 -0
  177. package/python/vendor/openpyxl/descriptors/serialisable.py +240 -0
  178. package/python/vendor/openpyxl/descriptors/slots.py +18 -0
  179. package/python/vendor/openpyxl/drawing/__init__.py +4 -0
  180. package/python/vendor/openpyxl/drawing/colors.py +435 -0
  181. package/python/vendor/openpyxl/drawing/connector.py +144 -0
  182. package/python/vendor/openpyxl/drawing/drawing.py +92 -0
  183. package/python/vendor/openpyxl/drawing/effect.py +407 -0
  184. package/python/vendor/openpyxl/drawing/fill.py +425 -0
  185. package/python/vendor/openpyxl/drawing/geometry.py +584 -0
  186. package/python/vendor/openpyxl/drawing/graphic.py +177 -0
  187. package/python/vendor/openpyxl/drawing/image.py +65 -0
  188. package/python/vendor/openpyxl/drawing/line.py +144 -0
  189. package/python/vendor/openpyxl/drawing/picture.py +144 -0
  190. package/python/vendor/openpyxl/drawing/properties.py +174 -0
  191. package/python/vendor/openpyxl/drawing/relation.py +17 -0
  192. package/python/vendor/openpyxl/drawing/spreadsheet_drawing.py +382 -0
  193. package/python/vendor/openpyxl/drawing/text.py +717 -0
  194. package/python/vendor/openpyxl/drawing/xdr.py +33 -0
  195. package/python/vendor/openpyxl/formatting/__init__.py +3 -0
  196. package/python/vendor/openpyxl/formatting/formatting.py +114 -0
  197. package/python/vendor/openpyxl/formatting/rule.py +291 -0
  198. package/python/vendor/openpyxl/formula/__init__.py +3 -0
  199. package/python/vendor/openpyxl/formula/tokenizer.py +446 -0
  200. package/python/vendor/openpyxl/formula/translate.py +166 -0
  201. package/python/vendor/openpyxl/packaging/__init__.py +3 -0
  202. package/python/vendor/openpyxl/packaging/core.py +115 -0
  203. package/python/vendor/openpyxl/packaging/custom.py +289 -0
  204. package/python/vendor/openpyxl/packaging/extended.py +137 -0
  205. package/python/vendor/openpyxl/packaging/interface.py +56 -0
  206. package/python/vendor/openpyxl/packaging/manifest.py +194 -0
  207. package/python/vendor/openpyxl/packaging/relationship.py +158 -0
  208. package/python/vendor/openpyxl/packaging/workbook.py +185 -0
  209. package/python/vendor/openpyxl/pivot/__init__.py +1 -0
  210. package/python/vendor/openpyxl/pivot/cache.py +965 -0
  211. package/python/vendor/openpyxl/pivot/fields.py +326 -0
  212. package/python/vendor/openpyxl/pivot/record.py +111 -0
  213. package/python/vendor/openpyxl/pivot/table.py +1261 -0
  214. package/python/vendor/openpyxl/reader/__init__.py +1 -0
  215. package/python/vendor/openpyxl/reader/drawings.py +71 -0
  216. package/python/vendor/openpyxl/reader/excel.py +349 -0
  217. package/python/vendor/openpyxl/reader/strings.py +44 -0
  218. package/python/vendor/openpyxl/reader/workbook.py +133 -0
  219. package/python/vendor/openpyxl/styles/__init__.py +11 -0
  220. package/python/vendor/openpyxl/styles/alignment.py +62 -0
  221. package/python/vendor/openpyxl/styles/borders.py +103 -0
  222. package/python/vendor/openpyxl/styles/builtins.py +1397 -0
  223. package/python/vendor/openpyxl/styles/cell_style.py +206 -0
  224. package/python/vendor/openpyxl/styles/colors.py +172 -0
  225. package/python/vendor/openpyxl/styles/differential.py +95 -0
  226. package/python/vendor/openpyxl/styles/fills.py +224 -0
  227. package/python/vendor/openpyxl/styles/fonts.py +113 -0
  228. package/python/vendor/openpyxl/styles/named_styles.py +282 -0
  229. package/python/vendor/openpyxl/styles/numbers.py +200 -0
  230. package/python/vendor/openpyxl/styles/protection.py +17 -0
  231. package/python/vendor/openpyxl/styles/proxy.py +62 -0
  232. package/python/vendor/openpyxl/styles/styleable.py +151 -0
  233. package/python/vendor/openpyxl/styles/stylesheet.py +274 -0
  234. package/python/vendor/openpyxl/styles/table.py +94 -0
  235. package/python/vendor/openpyxl/utils/__init__.py +17 -0
  236. package/python/vendor/openpyxl/utils/bound_dictionary.py +26 -0
  237. package/python/vendor/openpyxl/utils/cell.py +240 -0
  238. package/python/vendor/openpyxl/utils/dataframe.py +87 -0
  239. package/python/vendor/openpyxl/utils/datetime.py +140 -0
  240. package/python/vendor/openpyxl/utils/escape.py +43 -0
  241. package/python/vendor/openpyxl/utils/exceptions.py +34 -0
  242. package/python/vendor/openpyxl/utils/formulas.py +24 -0
  243. package/python/vendor/openpyxl/utils/indexed_list.py +49 -0
  244. package/python/vendor/openpyxl/utils/inference.py +60 -0
  245. package/python/vendor/openpyxl/utils/protection.py +22 -0
  246. package/python/vendor/openpyxl/utils/units.py +108 -0
  247. package/python/vendor/openpyxl/workbook/__init__.py +4 -0
  248. package/python/vendor/openpyxl/workbook/_writer.py +197 -0
  249. package/python/vendor/openpyxl/workbook/child.py +166 -0
  250. package/python/vendor/openpyxl/workbook/defined_name.py +189 -0
  251. package/python/vendor/openpyxl/workbook/external_link/__init__.py +3 -0
  252. package/python/vendor/openpyxl/workbook/external_link/external.py +190 -0
  253. package/python/vendor/openpyxl/workbook/external_reference.py +18 -0
  254. package/python/vendor/openpyxl/workbook/function_group.py +36 -0
  255. package/python/vendor/openpyxl/workbook/properties.py +151 -0
  256. package/python/vendor/openpyxl/workbook/protection.py +163 -0
  257. package/python/vendor/openpyxl/workbook/smart_tags.py +56 -0
  258. package/python/vendor/openpyxl/workbook/views.py +155 -0
  259. package/python/vendor/openpyxl/workbook/web.py +98 -0
  260. package/python/vendor/openpyxl/workbook/workbook.py +438 -0
  261. package/python/vendor/openpyxl/worksheet/__init__.py +1 -0
  262. package/python/vendor/openpyxl/worksheet/_read_only.py +190 -0
  263. package/python/vendor/openpyxl/worksheet/_reader.py +472 -0
  264. package/python/vendor/openpyxl/worksheet/_write_only.py +160 -0
  265. package/python/vendor/openpyxl/worksheet/_writer.py +390 -0
  266. package/python/vendor/openpyxl/worksheet/cell_range.py +512 -0
  267. package/python/vendor/openpyxl/worksheet/cell_watch.py +34 -0
  268. package/python/vendor/openpyxl/worksheet/controls.py +107 -0
  269. package/python/vendor/openpyxl/worksheet/copier.py +70 -0
  270. package/python/vendor/openpyxl/worksheet/custom.py +35 -0
  271. package/python/vendor/openpyxl/worksheet/datavalidation.py +202 -0
  272. package/python/vendor/openpyxl/worksheet/dimensions.py +306 -0
  273. package/python/vendor/openpyxl/worksheet/drawing.py +14 -0
  274. package/python/vendor/openpyxl/worksheet/errors.py +93 -0
  275. package/python/vendor/openpyxl/worksheet/filters.py +486 -0
  276. package/python/vendor/openpyxl/worksheet/formula.py +51 -0
  277. package/python/vendor/openpyxl/worksheet/header_footer.py +270 -0
  278. package/python/vendor/openpyxl/worksheet/hyperlink.py +46 -0
  279. package/python/vendor/openpyxl/worksheet/merge.py +141 -0
  280. package/python/vendor/openpyxl/worksheet/ole.py +133 -0
  281. package/python/vendor/openpyxl/worksheet/page.py +174 -0
  282. package/python/vendor/openpyxl/worksheet/pagebreak.py +94 -0
  283. package/python/vendor/openpyxl/worksheet/picture.py +8 -0
  284. package/python/vendor/openpyxl/worksheet/print_settings.py +184 -0
  285. package/python/vendor/openpyxl/worksheet/properties.py +97 -0
  286. package/python/vendor/openpyxl/worksheet/protection.py +120 -0
  287. package/python/vendor/openpyxl/worksheet/related.py +17 -0
  288. package/python/vendor/openpyxl/worksheet/scenario.py +105 -0
  289. package/python/vendor/openpyxl/worksheet/smart_tag.py +78 -0
  290. package/python/vendor/openpyxl/worksheet/table.py +385 -0
  291. package/python/vendor/openpyxl/worksheet/views.py +155 -0
  292. package/python/vendor/openpyxl/worksheet/worksheet.py +907 -0
  293. package/python/vendor/openpyxl/writer/__init__.py +1 -0
  294. package/python/vendor/openpyxl/writer/excel.py +295 -0
  295. package/python/vendor/openpyxl/writer/theme.py +291 -0
  296. package/python/vendor/openpyxl/xml/__init__.py +42 -0
  297. package/python/vendor/openpyxl/xml/constants.py +129 -0
  298. package/python/vendor/openpyxl/xml/functions.py +87 -0
  299. package/watchlist/package.json +1 -1
@@ -0,0 +1,144 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ Typed,
6
+ Bool,
7
+ Integer,
8
+ String,
9
+ Alias,
10
+ )
11
+ from openpyxl.descriptors.excel import ExtensionList as OfficeArtExtensionList
12
+ from openpyxl.chart.shapes import GraphicalProperties
13
+ from openpyxl.chart.text import RichText
14
+
15
+ from .properties import (
16
+ NonVisualDrawingProps,
17
+ NonVisualDrawingShapeProps,
18
+ )
19
+ from .geometry import ShapeStyle
20
+
21
+ class Connection(Serialisable):
22
+
23
+ id = Integer()
24
+ idx = Integer()
25
+
26
+ def __init__(self,
27
+ id=None,
28
+ idx=None,
29
+ ):
30
+ self.id = id
31
+ self.idx = idx
32
+
33
+
34
+ class ConnectorLocking(Serialisable):
35
+
36
+ extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
37
+
38
+ def __init__(self,
39
+ extLst=None,
40
+ ):
41
+ self.extLst = extLst
42
+
43
+
44
+ class NonVisualConnectorProperties(Serialisable):
45
+
46
+ cxnSpLocks = Typed(expected_type=ConnectorLocking, allow_none=True)
47
+ stCxn = Typed(expected_type=Connection, allow_none=True)
48
+ endCxn = Typed(expected_type=Connection, allow_none=True)
49
+ extLst = Typed(expected_type=OfficeArtExtensionList, allow_none=True)
50
+
51
+ def __init__(self,
52
+ cxnSpLocks=None,
53
+ stCxn=None,
54
+ endCxn=None,
55
+ extLst=None,
56
+ ):
57
+ self.cxnSpLocks = cxnSpLocks
58
+ self.stCxn = stCxn
59
+ self.endCxn = endCxn
60
+ self.extLst = extLst
61
+
62
+
63
+ class ConnectorNonVisual(Serialisable):
64
+
65
+ cNvPr = Typed(expected_type=NonVisualDrawingProps, )
66
+ cNvCxnSpPr = Typed(expected_type=NonVisualConnectorProperties, )
67
+
68
+ __elements__ = ("cNvPr", "cNvCxnSpPr",)
69
+
70
+ def __init__(self,
71
+ cNvPr=None,
72
+ cNvCxnSpPr=None,
73
+ ):
74
+ self.cNvPr = cNvPr
75
+ self.cNvCxnSpPr = cNvCxnSpPr
76
+
77
+
78
+ class ConnectorShape(Serialisable):
79
+
80
+ tagname = "cxnSp"
81
+
82
+ nvCxnSpPr = Typed(expected_type=ConnectorNonVisual)
83
+ spPr = Typed(expected_type=GraphicalProperties)
84
+ style = Typed(expected_type=ShapeStyle, allow_none=True)
85
+ macro = String(allow_none=True)
86
+ fPublished = Bool(allow_none=True)
87
+
88
+ def __init__(self,
89
+ nvCxnSpPr=None,
90
+ spPr=None,
91
+ style=None,
92
+ macro=None,
93
+ fPublished=None,
94
+ ):
95
+ self.nvCxnSpPr = nvCxnSpPr
96
+ self.spPr = spPr
97
+ self.style = style
98
+ self.macro = macro
99
+ self.fPublished = fPublished
100
+
101
+
102
+ class ShapeMeta(Serialisable):
103
+
104
+ tagname = "nvSpPr"
105
+
106
+ cNvPr = Typed(expected_type=NonVisualDrawingProps)
107
+ cNvSpPr = Typed(expected_type=NonVisualDrawingShapeProps)
108
+
109
+ def __init__(self, cNvPr=None, cNvSpPr=None):
110
+ self.cNvPr = cNvPr
111
+ self.cNvSpPr = cNvSpPr
112
+
113
+
114
+ class Shape(Serialisable):
115
+
116
+ macro = String(allow_none=True)
117
+ textlink = String(allow_none=True)
118
+ fPublished = Bool(allow_none=True)
119
+ fLocksText = Bool(allow_none=True)
120
+ nvSpPr = Typed(expected_type=ShapeMeta, allow_none=True)
121
+ meta = Alias("nvSpPr")
122
+ spPr = Typed(expected_type=GraphicalProperties)
123
+ graphicalProperties = Alias("spPr")
124
+ style = Typed(expected_type=ShapeStyle, allow_none=True)
125
+ txBody = Typed(expected_type=RichText, allow_none=True)
126
+
127
+ def __init__(self,
128
+ macro=None,
129
+ textlink=None,
130
+ fPublished=None,
131
+ fLocksText=None,
132
+ nvSpPr=None,
133
+ spPr=None,
134
+ style=None,
135
+ txBody=None,
136
+ ):
137
+ self.macro = macro
138
+ self.textlink = textlink
139
+ self.fPublished = fPublished
140
+ self.fLocksText = fLocksText
141
+ self.nvSpPr = nvSpPr
142
+ self.spPr = spPr
143
+ self.style = style
144
+ self.txBody = txBody
@@ -0,0 +1,92 @@
1
+
2
+ # Copyright (c) 2010-2024 openpyxl
3
+
4
+ import math
5
+
6
+ from openpyxl.utils.units import pixels_to_EMU
7
+
8
+
9
+ class Drawing:
10
+ """ a drawing object - eg container for shapes or charts
11
+ we assume user specifies dimensions in pixels; units are
12
+ converted to EMU in the drawing part
13
+ """
14
+
15
+ count = 0
16
+
17
+ def __init__(self):
18
+
19
+ self.name = ''
20
+ self.description = ''
21
+ self.coordinates = ((1, 2), (16, 8))
22
+ self.left = 0
23
+ self.top = 0
24
+ self._width = 21 # default in px
25
+ self._height = 192 #default in px
26
+ self.resize_proportional = False
27
+ self.rotation = 0
28
+ self.anchortype = "absolute"
29
+ self.anchorcol = 0 # left cell
30
+ self.anchorrow = 0 # top row
31
+
32
+
33
+ @property
34
+ def width(self):
35
+ return self._width
36
+
37
+
38
+ @width.setter
39
+ def width(self, w):
40
+ if self.resize_proportional and w:
41
+ ratio = self._height / self._width
42
+ self._height = round(ratio * w)
43
+ self._width = w
44
+
45
+
46
+ @property
47
+ def height(self):
48
+ return self._height
49
+
50
+
51
+ @height.setter
52
+ def height(self, h):
53
+ if self.resize_proportional and h:
54
+ ratio = self._width / self._height
55
+ self._width = round(ratio * h)
56
+ self._height = h
57
+
58
+
59
+ def set_dimension(self, w=0, h=0):
60
+
61
+ xratio = w / self._width
62
+ yratio = h / self._height
63
+
64
+ if self.resize_proportional and w and h:
65
+ if (xratio * self._height) < h:
66
+ self._height = math.ceil(xratio * self._height)
67
+ self._width = w
68
+ else:
69
+ self._width = math.ceil(yratio * self._width)
70
+ self._height = h
71
+
72
+
73
+ @property
74
+ def anchor(self):
75
+ from .spreadsheet_drawing import (
76
+ OneCellAnchor,
77
+ TwoCellAnchor,
78
+ AbsoluteAnchor)
79
+ if self.anchortype == "absolute":
80
+ anchor = AbsoluteAnchor()
81
+ anchor.pos.x = pixels_to_EMU(self.left)
82
+ anchor.pos.y = pixels_to_EMU(self.top)
83
+
84
+ elif self.anchortype == "oneCell":
85
+ anchor = OneCellAnchor()
86
+ anchor._from.col = self.anchorcol
87
+ anchor._from.row = self.anchorrow
88
+
89
+ anchor.ext.width = pixels_to_EMU(self._width)
90
+ anchor.ext.height = pixels_to_EMU(self._height)
91
+
92
+ return anchor
@@ -0,0 +1,407 @@
1
+ # Copyright (c) 2010-2024 openpyxl
2
+
3
+ from openpyxl.descriptors.serialisable import Serialisable
4
+ from openpyxl.descriptors import (
5
+ Typed,
6
+ String,
7
+ Set,
8
+ Bool,
9
+ Integer,
10
+ Float,
11
+ )
12
+
13
+ from .colors import ColorChoice
14
+
15
+
16
+ class TintEffect(Serialisable):
17
+
18
+ tagname = "tint"
19
+
20
+ hue = Integer()
21
+ amt = Integer()
22
+
23
+ def __init__(self,
24
+ hue=0,
25
+ amt=0,
26
+ ):
27
+ self.hue = hue
28
+ self.amt = amt
29
+
30
+
31
+ class LuminanceEffect(Serialisable):
32
+
33
+ tagname = "lum"
34
+
35
+ bright = Integer() #Pct ?
36
+ contrast = Integer() #Pct#
37
+
38
+ def __init__(self,
39
+ bright=0,
40
+ contrast=0,
41
+ ):
42
+ self.bright = bright
43
+ self.contrast = contrast
44
+
45
+
46
+ class HSLEffect(Serialisable):
47
+
48
+ hue = Integer()
49
+ sat = Integer()
50
+ lum = Integer()
51
+
52
+ def __init__(self,
53
+ hue=None,
54
+ sat=None,
55
+ lum=None,
56
+ ):
57
+ self.hue = hue
58
+ self.sat = sat
59
+ self.lum = lum
60
+
61
+
62
+ class GrayscaleEffect(Serialisable):
63
+
64
+ tagname = "grayscl"
65
+
66
+
67
+ class FillOverlayEffect(Serialisable):
68
+
69
+ blend = Set(values=(['over', 'mult', 'screen', 'darken', 'lighten']))
70
+
71
+ def __init__(self,
72
+ blend=None,
73
+ ):
74
+ self.blend = blend
75
+
76
+
77
+ class DuotoneEffect(Serialisable):
78
+
79
+ pass
80
+
81
+ class ColorReplaceEffect(Serialisable):
82
+
83
+ pass
84
+
85
+ class Color(Serialisable):
86
+
87
+ pass
88
+
89
+ class ColorChangeEffect(Serialisable):
90
+
91
+ useA = Bool(allow_none=True)
92
+ clrFrom = Typed(expected_type=Color, )
93
+ clrTo = Typed(expected_type=Color, )
94
+
95
+ def __init__(self,
96
+ useA=None,
97
+ clrFrom=None,
98
+ clrTo=None,
99
+ ):
100
+ self.useA = useA
101
+ self.clrFrom = clrFrom
102
+ self.clrTo = clrTo
103
+
104
+
105
+ class BlurEffect(Serialisable):
106
+
107
+ rad = Float()
108
+ grow = Bool(allow_none=True)
109
+
110
+ def __init__(self,
111
+ rad=None,
112
+ grow=None,
113
+ ):
114
+ self.rad = rad
115
+ self.grow = grow
116
+
117
+
118
+ class BiLevelEffect(Serialisable):
119
+
120
+ thresh = Integer()
121
+
122
+ def __init__(self,
123
+ thresh=None,
124
+ ):
125
+ self.thresh = thresh
126
+
127
+
128
+ class AlphaReplaceEffect(Serialisable):
129
+
130
+ a = Integer()
131
+
132
+ def __init__(self,
133
+ a=None,
134
+ ):
135
+ self.a = a
136
+
137
+
138
+ class AlphaModulateFixedEffect(Serialisable):
139
+
140
+ amt = Integer()
141
+
142
+ def __init__(self,
143
+ amt=None,
144
+ ):
145
+ self.amt = amt
146
+
147
+
148
+ class EffectContainer(Serialisable):
149
+
150
+ type = Set(values=(['sib', 'tree']))
151
+ name = String(allow_none=True)
152
+
153
+ def __init__(self,
154
+ type=None,
155
+ name=None,
156
+ ):
157
+ self.type = type
158
+ self.name = name
159
+
160
+
161
+ class AlphaModulateEffect(Serialisable):
162
+
163
+ cont = Typed(expected_type=EffectContainer, )
164
+
165
+ def __init__(self,
166
+ cont=None,
167
+ ):
168
+ self.cont = cont
169
+
170
+
171
+ class AlphaInverseEffect(Serialisable):
172
+
173
+ pass
174
+
175
+ class AlphaFloorEffect(Serialisable):
176
+
177
+ pass
178
+
179
+ class AlphaCeilingEffect(Serialisable):
180
+
181
+ pass
182
+
183
+ class AlphaBiLevelEffect(Serialisable):
184
+
185
+ thresh = Integer()
186
+
187
+ def __init__(self,
188
+ thresh=None,
189
+ ):
190
+ self.thresh = thresh
191
+
192
+
193
+ class GlowEffect(ColorChoice):
194
+
195
+ rad = Float()
196
+ # uses element group EG_ColorChoice
197
+ scrgbClr = ColorChoice.scrgbClr
198
+ srgbClr = ColorChoice.srgbClr
199
+ hslClr = ColorChoice.hslClr
200
+ sysClr = ColorChoice.sysClr
201
+ schemeClr = ColorChoice.schemeClr
202
+ prstClr = ColorChoice.prstClr
203
+
204
+ __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr')
205
+
206
+ def __init__(self,
207
+ rad=None,
208
+ **kw
209
+ ):
210
+ self.rad = rad
211
+ super().__init__(**kw)
212
+
213
+
214
+ class InnerShadowEffect(ColorChoice):
215
+
216
+ blurRad = Float()
217
+ dist = Float()
218
+ dir = Integer()
219
+ # uses element group EG_ColorChoice
220
+ scrgbClr = ColorChoice.scrgbClr
221
+ srgbClr = ColorChoice.srgbClr
222
+ hslClr = ColorChoice.hslClr
223
+ sysClr = ColorChoice.sysClr
224
+ schemeClr = ColorChoice.schemeClr
225
+ prstClr = ColorChoice.prstClr
226
+
227
+ __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr')
228
+
229
+ def __init__(self,
230
+ blurRad=None,
231
+ dist=None,
232
+ dir=None,
233
+ **kw
234
+ ):
235
+ self.blurRad = blurRad
236
+ self.dist = dist
237
+ self.dir = dir
238
+ super().__init__(**kw)
239
+
240
+
241
+ class OuterShadow(ColorChoice):
242
+
243
+ tagname = "outerShdw"
244
+
245
+ blurRad = Float(allow_none=True)
246
+ dist = Float(allow_none=True)
247
+ dir = Integer(allow_none=True)
248
+ sx = Integer(allow_none=True)
249
+ sy = Integer(allow_none=True)
250
+ kx = Integer(allow_none=True)
251
+ ky = Integer(allow_none=True)
252
+ algn = Set(values=['tl', 't', 'tr', 'l', 'ctr', 'r', 'bl', 'b', 'br'])
253
+ rotWithShape = Bool(allow_none=True)
254
+ # uses element group EG_ColorChoice
255
+ scrgbClr = ColorChoice.scrgbClr
256
+ srgbClr = ColorChoice.srgbClr
257
+ hslClr = ColorChoice.hslClr
258
+ sysClr = ColorChoice.sysClr
259
+ schemeClr = ColorChoice.schemeClr
260
+ prstClr = ColorChoice.prstClr
261
+
262
+ __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr')
263
+
264
+ def __init__(self,
265
+ blurRad=None,
266
+ dist=None,
267
+ dir=None,
268
+ sx=None,
269
+ sy=None,
270
+ kx=None,
271
+ ky=None,
272
+ algn=None,
273
+ rotWithShape=None,
274
+ **kw
275
+ ):
276
+ self.blurRad = blurRad
277
+ self.dist = dist
278
+ self.dir = dir
279
+ self.sx = sx
280
+ self.sy = sy
281
+ self.kx = kx
282
+ self.ky = ky
283
+ self.algn = algn
284
+ self.rotWithShape = rotWithShape
285
+ super().__init__(**kw)
286
+
287
+
288
+ class PresetShadowEffect(ColorChoice):
289
+
290
+ prst = Set(values=(['shdw1', 'shdw2', 'shdw3', 'shdw4', 'shdw5', 'shdw6',
291
+ 'shdw7', 'shdw8', 'shdw9', 'shdw10', 'shdw11', 'shdw12', 'shdw13',
292
+ 'shdw14', 'shdw15', 'shdw16', 'shdw17', 'shdw18', 'shdw19', 'shdw20']))
293
+ dist = Float()
294
+ dir = Integer()
295
+ # uses element group EG_ColorChoice
296
+ scrgbClr = ColorChoice.scrgbClr
297
+ srgbClr = ColorChoice.srgbClr
298
+ hslClr = ColorChoice.hslClr
299
+ sysClr = ColorChoice.sysClr
300
+ schemeClr = ColorChoice.schemeClr
301
+ prstClr = ColorChoice.prstClr
302
+
303
+ __elements__ = ('scrgbClr', 'srgbClr', 'hslClr', 'sysClr', 'schemeClr', 'prstClr')
304
+
305
+ def __init__(self,
306
+ prst=None,
307
+ dist=None,
308
+ dir=None,
309
+ **kw
310
+ ):
311
+ self.prst = prst
312
+ self.dist = dist
313
+ self.dir = dir
314
+ super().__init__(**kw)
315
+
316
+
317
+ class ReflectionEffect(Serialisable):
318
+
319
+ blurRad = Float()
320
+ stA = Integer()
321
+ stPos = Integer()
322
+ endA = Integer()
323
+ endPos = Integer()
324
+ dist = Float()
325
+ dir = Integer()
326
+ fadeDir = Integer()
327
+ sx = Integer()
328
+ sy = Integer()
329
+ kx = Integer()
330
+ ky = Integer()
331
+ algn = Set(values=(['tl', 't', 'tr', 'l', 'ctr', 'r', 'bl', 'b', 'br']))
332
+ rotWithShape = Bool(allow_none=True)
333
+
334
+ def __init__(self,
335
+ blurRad=None,
336
+ stA=None,
337
+ stPos=None,
338
+ endA=None,
339
+ endPos=None,
340
+ dist=None,
341
+ dir=None,
342
+ fadeDir=None,
343
+ sx=None,
344
+ sy=None,
345
+ kx=None,
346
+ ky=None,
347
+ algn=None,
348
+ rotWithShape=None,
349
+ ):
350
+ self.blurRad = blurRad
351
+ self.stA = stA
352
+ self.stPos = stPos
353
+ self.endA = endA
354
+ self.endPos = endPos
355
+ self.dist = dist
356
+ self.dir = dir
357
+ self.fadeDir = fadeDir
358
+ self.sx = sx
359
+ self.sy = sy
360
+ self.kx = kx
361
+ self.ky = ky
362
+ self.algn = algn
363
+ self.rotWithShape = rotWithShape
364
+
365
+
366
+ class SoftEdgesEffect(Serialisable):
367
+
368
+ rad = Float()
369
+
370
+ def __init__(self,
371
+ rad=None,
372
+ ):
373
+ self.rad = rad
374
+
375
+
376
+ class EffectList(Serialisable):
377
+
378
+ blur = Typed(expected_type=BlurEffect, allow_none=True)
379
+ fillOverlay = Typed(expected_type=FillOverlayEffect, allow_none=True)
380
+ glow = Typed(expected_type=GlowEffect, allow_none=True)
381
+ innerShdw = Typed(expected_type=InnerShadowEffect, allow_none=True)
382
+ outerShdw = Typed(expected_type=OuterShadow, allow_none=True)
383
+ prstShdw = Typed(expected_type=PresetShadowEffect, allow_none=True)
384
+ reflection = Typed(expected_type=ReflectionEffect, allow_none=True)
385
+ softEdge = Typed(expected_type=SoftEdgesEffect, allow_none=True)
386
+
387
+ __elements__ = ('blur', 'fillOverlay', 'glow', 'innerShdw', 'outerShdw',
388
+ 'prstShdw', 'reflection', 'softEdge')
389
+
390
+ def __init__(self,
391
+ blur=None,
392
+ fillOverlay=None,
393
+ glow=None,
394
+ innerShdw=None,
395
+ outerShdw=None,
396
+ prstShdw=None,
397
+ reflection=None,
398
+ softEdge=None,
399
+ ):
400
+ self.blur = blur
401
+ self.fillOverlay = fillOverlay
402
+ self.glow = glow
403
+ self.innerShdw = innerShdw
404
+ self.outerShdw = outerShdw
405
+ self.prstShdw = prstShdw
406
+ self.reflection = reflection
407
+ self.softEdge = softEdge