@v587d/capital-generation 2.28.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.
- package/CHANGELOG.md +59 -0
- package/README.md +5 -4
- package/THIRD_PARTY_NOTICES.md +16 -0
- package/automation/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- package/lib/collector-runtime.js +56 -1
- package/lib/data-collector/catalog-taxonomy.d.ts +1 -1
- package/lib/data-collector/catalog-taxonomy.js +33 -0
- package/lib/data-collector/tools.js +7 -7
- package/lib/host-version.d.ts +9 -0
- package/lib/host-version.js +57 -0
- package/lib/python-runtime/errors.d.ts +1 -1
- package/lib/python-runtime/errors.js +2 -0
- package/lib/python-runtime/manager.d.ts +28 -1
- package/lib/python-runtime/manager.js +141 -5
- package/lib/python-runtime/probe.d.ts +24 -0
- package/lib/python-runtime/probe.js +66 -50
- package/lib/runtime-entry.js +8 -0
- package/lib/sources/csindex-http.d.ts +4 -0
- package/lib/sources/csindex-http.js +233 -0
- package/lib/sources/eastmoney-http.js +1504 -1
- package/lib/sources/fuyao-rest.js +168 -8
- package/lib/sources/official-http.d.ts +4 -0
- package/lib/sources/official-http.js +477 -0
- package/lib/sources/python-remote.d.ts +25 -0
- package/lib/sources/python-remote.js +461 -0
- package/lib/sources/sina-http.d.ts +2 -0
- package/lib/sources/sina-http.js +484 -0
- package/lib/sources/tencent-http.js +23 -8
- package/lib/sources/ths-http.d.ts +2 -0
- package/lib/sources/ths-http.js +514 -0
- package/lib/time/tools.js +19 -0
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/sources.d.ts +7 -0
- package/lib/web-retriever/sources.js +46 -21
- package/lib/web-retriever/throttle.d.ts +8 -0
- package/lib/web-retriever/throttle.js +13 -0
- package/lib/web-retriever/tools.js +1 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +6 -3
- package/preset/capital-generation/agent.patch.yml +7 -5
- package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +16 -16
- package/python/scripts/baostock_stock_basic.py +129 -0
- package/python/scripts/baostock_valuation_history.py +141 -0
- package/python/scripts/pbc_social_financing.py +291 -0
- package/python/vendor/baostock/LICENSE +19 -0
- package/python/vendor/baostock/__init__.py +42 -0
- package/python/vendor/baostock/common/__init__.py +0 -0
- package/python/vendor/baostock/common/contants.py +189 -0
- package/python/vendor/baostock/common/context.py +4 -0
- package/python/vendor/baostock/corpreport/__init__.py +0 -0
- package/python/vendor/baostock/corpreport/corp_performance.py +202 -0
- package/python/vendor/baostock/data/__init__.py +0 -0
- package/python/vendor/baostock/data/messageheader.py +17 -0
- package/python/vendor/baostock/data/msg.py +21 -0
- package/python/vendor/baostock/data/resultset.py +200 -0
- package/python/vendor/baostock/demo/__init__.py +0 -0
- package/python/vendor/baostock/demo/demo_A_stock_5mk-data.py +34 -0
- package/python/vendor/baostock/demo/demo_A_stock_k_data.py +36 -0
- package/python/vendor/baostock/demo/demo_AllStock.py +27 -0
- package/python/vendor/baostock/demo/demo_Balance_data.py +22 -0
- package/python/vendor/baostock/demo/demo_CashFlow_data.py +22 -0
- package/python/vendor/baostock/demo/demo_Dividend_data.py +35 -0
- package/python/vendor/baostock/demo/demo_Dupont_data.py +25 -0
- package/python/vendor/baostock/demo/demo_Forecast_report.py +24 -0
- package/python/vendor/baostock/demo/demo_Growth_data.py +22 -0
- package/python/vendor/baostock/demo/demo_Index_k_data.py +39 -0
- package/python/vendor/baostock/demo/demo_Operation_data.py +22 -0
- package/python/vendor/baostock/demo/demo_PerformanceExpress_report.py +25 -0
- package/python/vendor/baostock/demo/demo_Profit_data.py +22 -0
- package/python/vendor/baostock/demo/demo_TradeDates.py +27 -0
- package/python/vendor/baostock/demo/demo_adjust_factor_data.py +23 -0
- package/python/vendor/baostock/demo/demo_assignDayData.py +23 -0
- package/python/vendor/baostock/demo/demo_daily_adjust_factor_data.py +28 -0
- package/python/vendor/baostock/demo/demo_daily_k_4_AStock.py +28 -0
- package/python/vendor/baostock/demo/demo_daily_k_4_ETF.py +28 -0
- package/python/vendor/baostock/demo/demo_depositRate_data.py +26 -0
- package/python/vendor/baostock/demo/demo_hs300_stocks.py +26 -0
- package/python/vendor/baostock/demo/demo_loanRate_data.py +26 -0
- package/python/vendor/baostock/demo/demo_moneySupplyDataMonth_data.py +26 -0
- package/python/vendor/baostock/demo/demo_moneySupplyDataYear_data.py +26 -0
- package/python/vendor/baostock/demo/demo_requiredReserveRatio_data.py +26 -0
- package/python/vendor/baostock/demo/demo_set_API_key.py +37 -0
- package/python/vendor/baostock/demo/demo_stockBasic_data.py +27 -0
- package/python/vendor/baostock/demo/demo_stock_Valuation_indicator_data.py +34 -0
- package/python/vendor/baostock/demo/demo_stock_industry.py +26 -0
- package/python/vendor/baostock/demo/demo_sz50stocks.py +26 -0
- package/python/vendor/baostock/demo/demo_zz500_stock.py +26 -0
- package/python/vendor/baostock/evaluation/__init__.py +0 -0
- package/python/vendor/baostock/evaluation/season_index.py +758 -0
- package/python/vendor/baostock/login/__init__.py +0 -0
- package/python/vendor/baostock/login/loginout.py +230 -0
- package/python/vendor/baostock/macroscopic/__init__.py +0 -0
- package/python/vendor/baostock/macroscopic/economic_data.py +723 -0
- package/python/vendor/baostock/metadata/__init__.py +0 -0
- package/python/vendor/baostock/metadata/stock_metadata.py +207 -0
- package/python/vendor/baostock/security/__init__.py +0 -0
- package/python/vendor/baostock/security/history.py +265 -0
- package/python/vendor/baostock/security/sectorinfo.py +1024 -0
- package/python/vendor/baostock/util/__init__.py +0 -0
- package/python/vendor/baostock/util/socketutil.py +97 -0
- package/python/vendor/baostock/util/stringutil.py +83 -0
- package/python/vendor/et_xmlfile/LICENSE +23 -0
- package/python/vendor/et_xmlfile/LICENSE.python +298 -0
- package/python/vendor/et_xmlfile/__init__.py +8 -0
- package/python/vendor/et_xmlfile/incremental_tree.py +917 -0
- package/python/vendor/et_xmlfile/xmlfile.py +158 -0
- package/python/vendor/openpyxl/LICENSE +23 -0
- package/python/vendor/openpyxl/__init__.py +19 -0
- package/python/vendor/openpyxl/_constants.py +13 -0
- package/python/vendor/openpyxl/cell/__init__.py +4 -0
- package/python/vendor/openpyxl/cell/_writer.py +136 -0
- package/python/vendor/openpyxl/cell/cell.py +332 -0
- package/python/vendor/openpyxl/cell/read_only.py +136 -0
- package/python/vendor/openpyxl/cell/rich_text.py +202 -0
- package/python/vendor/openpyxl/cell/text.py +184 -0
- package/python/vendor/openpyxl/chart/_3d.py +105 -0
- package/python/vendor/openpyxl/chart/__init__.py +19 -0
- package/python/vendor/openpyxl/chart/_chart.py +199 -0
- package/python/vendor/openpyxl/chart/area_chart.py +106 -0
- package/python/vendor/openpyxl/chart/axis.py +401 -0
- package/python/vendor/openpyxl/chart/bar_chart.py +144 -0
- package/python/vendor/openpyxl/chart/bubble_chart.py +67 -0
- package/python/vendor/openpyxl/chart/chartspace.py +195 -0
- package/python/vendor/openpyxl/chart/data_source.py +246 -0
- package/python/vendor/openpyxl/chart/descriptors.py +43 -0
- package/python/vendor/openpyxl/chart/error_bar.py +62 -0
- package/python/vendor/openpyxl/chart/label.py +127 -0
- package/python/vendor/openpyxl/chart/layout.py +74 -0
- package/python/vendor/openpyxl/chart/legend.py +75 -0
- package/python/vendor/openpyxl/chart/line_chart.py +129 -0
- package/python/vendor/openpyxl/chart/marker.py +90 -0
- package/python/vendor/openpyxl/chart/picture.py +35 -0
- package/python/vendor/openpyxl/chart/pie_chart.py +177 -0
- package/python/vendor/openpyxl/chart/pivot.py +65 -0
- package/python/vendor/openpyxl/chart/plotarea.py +162 -0
- package/python/vendor/openpyxl/chart/print_settings.py +57 -0
- package/python/vendor/openpyxl/chart/radar_chart.py +55 -0
- package/python/vendor/openpyxl/chart/reader.py +32 -0
- package/python/vendor/openpyxl/chart/reference.py +124 -0
- package/python/vendor/openpyxl/chart/scatter_chart.py +53 -0
- package/python/vendor/openpyxl/chart/series.py +197 -0
- package/python/vendor/openpyxl/chart/series_factory.py +41 -0
- package/python/vendor/openpyxl/chart/shapes.py +89 -0
- package/python/vendor/openpyxl/chart/stock_chart.py +54 -0
- package/python/vendor/openpyxl/chart/surface_chart.py +119 -0
- package/python/vendor/openpyxl/chart/text.py +78 -0
- package/python/vendor/openpyxl/chart/title.py +76 -0
- package/python/vendor/openpyxl/chart/trendline.py +98 -0
- package/python/vendor/openpyxl/chart/updown_bars.py +31 -0
- package/python/vendor/openpyxl/chartsheet/__init__.py +3 -0
- package/python/vendor/openpyxl/chartsheet/chartsheet.py +107 -0
- package/python/vendor/openpyxl/chartsheet/custom.py +61 -0
- package/python/vendor/openpyxl/chartsheet/properties.py +28 -0
- package/python/vendor/openpyxl/chartsheet/protection.py +41 -0
- package/python/vendor/openpyxl/chartsheet/publish.py +58 -0
- package/python/vendor/openpyxl/chartsheet/relation.py +97 -0
- package/python/vendor/openpyxl/chartsheet/views.py +51 -0
- package/python/vendor/openpyxl/comments/__init__.py +4 -0
- package/python/vendor/openpyxl/comments/author.py +21 -0
- package/python/vendor/openpyxl/comments/comment_sheet.py +211 -0
- package/python/vendor/openpyxl/comments/comments.py +62 -0
- package/python/vendor/openpyxl/comments/shape_writer.py +112 -0
- package/python/vendor/openpyxl/compat/__init__.py +54 -0
- package/python/vendor/openpyxl/compat/abc.py +8 -0
- package/python/vendor/openpyxl/compat/numbers.py +43 -0
- package/python/vendor/openpyxl/compat/product.py +17 -0
- package/python/vendor/openpyxl/compat/singleton.py +40 -0
- package/python/vendor/openpyxl/compat/strings.py +25 -0
- package/python/vendor/openpyxl/descriptors/__init__.py +58 -0
- package/python/vendor/openpyxl/descriptors/base.py +272 -0
- package/python/vendor/openpyxl/descriptors/container.py +41 -0
- package/python/vendor/openpyxl/descriptors/excel.py +112 -0
- package/python/vendor/openpyxl/descriptors/namespace.py +12 -0
- package/python/vendor/openpyxl/descriptors/nested.py +129 -0
- package/python/vendor/openpyxl/descriptors/sequence.py +136 -0
- package/python/vendor/openpyxl/descriptors/serialisable.py +240 -0
- package/python/vendor/openpyxl/descriptors/slots.py +18 -0
- package/python/vendor/openpyxl/drawing/__init__.py +4 -0
- package/python/vendor/openpyxl/drawing/colors.py +435 -0
- package/python/vendor/openpyxl/drawing/connector.py +144 -0
- package/python/vendor/openpyxl/drawing/drawing.py +92 -0
- package/python/vendor/openpyxl/drawing/effect.py +407 -0
- package/python/vendor/openpyxl/drawing/fill.py +425 -0
- package/python/vendor/openpyxl/drawing/geometry.py +584 -0
- package/python/vendor/openpyxl/drawing/graphic.py +177 -0
- package/python/vendor/openpyxl/drawing/image.py +65 -0
- package/python/vendor/openpyxl/drawing/line.py +144 -0
- package/python/vendor/openpyxl/drawing/picture.py +144 -0
- package/python/vendor/openpyxl/drawing/properties.py +174 -0
- package/python/vendor/openpyxl/drawing/relation.py +17 -0
- package/python/vendor/openpyxl/drawing/spreadsheet_drawing.py +382 -0
- package/python/vendor/openpyxl/drawing/text.py +717 -0
- package/python/vendor/openpyxl/drawing/xdr.py +33 -0
- package/python/vendor/openpyxl/formatting/__init__.py +3 -0
- package/python/vendor/openpyxl/formatting/formatting.py +114 -0
- package/python/vendor/openpyxl/formatting/rule.py +291 -0
- package/python/vendor/openpyxl/formula/__init__.py +3 -0
- package/python/vendor/openpyxl/formula/tokenizer.py +446 -0
- package/python/vendor/openpyxl/formula/translate.py +166 -0
- package/python/vendor/openpyxl/packaging/__init__.py +3 -0
- package/python/vendor/openpyxl/packaging/core.py +115 -0
- package/python/vendor/openpyxl/packaging/custom.py +289 -0
- package/python/vendor/openpyxl/packaging/extended.py +137 -0
- package/python/vendor/openpyxl/packaging/interface.py +56 -0
- package/python/vendor/openpyxl/packaging/manifest.py +194 -0
- package/python/vendor/openpyxl/packaging/relationship.py +158 -0
- package/python/vendor/openpyxl/packaging/workbook.py +185 -0
- package/python/vendor/openpyxl/pivot/__init__.py +1 -0
- package/python/vendor/openpyxl/pivot/cache.py +965 -0
- package/python/vendor/openpyxl/pivot/fields.py +326 -0
- package/python/vendor/openpyxl/pivot/record.py +111 -0
- package/python/vendor/openpyxl/pivot/table.py +1261 -0
- package/python/vendor/openpyxl/reader/__init__.py +1 -0
- package/python/vendor/openpyxl/reader/drawings.py +71 -0
- package/python/vendor/openpyxl/reader/excel.py +349 -0
- package/python/vendor/openpyxl/reader/strings.py +44 -0
- package/python/vendor/openpyxl/reader/workbook.py +133 -0
- package/python/vendor/openpyxl/styles/__init__.py +11 -0
- package/python/vendor/openpyxl/styles/alignment.py +62 -0
- package/python/vendor/openpyxl/styles/borders.py +103 -0
- package/python/vendor/openpyxl/styles/builtins.py +1397 -0
- package/python/vendor/openpyxl/styles/cell_style.py +206 -0
- package/python/vendor/openpyxl/styles/colors.py +172 -0
- package/python/vendor/openpyxl/styles/differential.py +95 -0
- package/python/vendor/openpyxl/styles/fills.py +224 -0
- package/python/vendor/openpyxl/styles/fonts.py +113 -0
- package/python/vendor/openpyxl/styles/named_styles.py +282 -0
- package/python/vendor/openpyxl/styles/numbers.py +200 -0
- package/python/vendor/openpyxl/styles/protection.py +17 -0
- package/python/vendor/openpyxl/styles/proxy.py +62 -0
- package/python/vendor/openpyxl/styles/styleable.py +151 -0
- package/python/vendor/openpyxl/styles/stylesheet.py +274 -0
- package/python/vendor/openpyxl/styles/table.py +94 -0
- package/python/vendor/openpyxl/utils/__init__.py +17 -0
- package/python/vendor/openpyxl/utils/bound_dictionary.py +26 -0
- package/python/vendor/openpyxl/utils/cell.py +240 -0
- package/python/vendor/openpyxl/utils/dataframe.py +87 -0
- package/python/vendor/openpyxl/utils/datetime.py +140 -0
- package/python/vendor/openpyxl/utils/escape.py +43 -0
- package/python/vendor/openpyxl/utils/exceptions.py +34 -0
- package/python/vendor/openpyxl/utils/formulas.py +24 -0
- package/python/vendor/openpyxl/utils/indexed_list.py +49 -0
- package/python/vendor/openpyxl/utils/inference.py +60 -0
- package/python/vendor/openpyxl/utils/protection.py +22 -0
- package/python/vendor/openpyxl/utils/units.py +108 -0
- package/python/vendor/openpyxl/workbook/__init__.py +4 -0
- package/python/vendor/openpyxl/workbook/_writer.py +197 -0
- package/python/vendor/openpyxl/workbook/child.py +166 -0
- package/python/vendor/openpyxl/workbook/defined_name.py +189 -0
- package/python/vendor/openpyxl/workbook/external_link/__init__.py +3 -0
- package/python/vendor/openpyxl/workbook/external_link/external.py +190 -0
- package/python/vendor/openpyxl/workbook/external_reference.py +18 -0
- package/python/vendor/openpyxl/workbook/function_group.py +36 -0
- package/python/vendor/openpyxl/workbook/properties.py +151 -0
- package/python/vendor/openpyxl/workbook/protection.py +163 -0
- package/python/vendor/openpyxl/workbook/smart_tags.py +56 -0
- package/python/vendor/openpyxl/workbook/views.py +155 -0
- package/python/vendor/openpyxl/workbook/web.py +98 -0
- package/python/vendor/openpyxl/workbook/workbook.py +438 -0
- package/python/vendor/openpyxl/worksheet/__init__.py +1 -0
- package/python/vendor/openpyxl/worksheet/_read_only.py +190 -0
- package/python/vendor/openpyxl/worksheet/_reader.py +472 -0
- package/python/vendor/openpyxl/worksheet/_write_only.py +160 -0
- package/python/vendor/openpyxl/worksheet/_writer.py +390 -0
- package/python/vendor/openpyxl/worksheet/cell_range.py +512 -0
- package/python/vendor/openpyxl/worksheet/cell_watch.py +34 -0
- package/python/vendor/openpyxl/worksheet/controls.py +107 -0
- package/python/vendor/openpyxl/worksheet/copier.py +70 -0
- package/python/vendor/openpyxl/worksheet/custom.py +35 -0
- package/python/vendor/openpyxl/worksheet/datavalidation.py +202 -0
- package/python/vendor/openpyxl/worksheet/dimensions.py +306 -0
- package/python/vendor/openpyxl/worksheet/drawing.py +14 -0
- package/python/vendor/openpyxl/worksheet/errors.py +93 -0
- package/python/vendor/openpyxl/worksheet/filters.py +486 -0
- package/python/vendor/openpyxl/worksheet/formula.py +51 -0
- package/python/vendor/openpyxl/worksheet/header_footer.py +270 -0
- package/python/vendor/openpyxl/worksheet/hyperlink.py +46 -0
- package/python/vendor/openpyxl/worksheet/merge.py +141 -0
- package/python/vendor/openpyxl/worksheet/ole.py +133 -0
- package/python/vendor/openpyxl/worksheet/page.py +174 -0
- package/python/vendor/openpyxl/worksheet/pagebreak.py +94 -0
- package/python/vendor/openpyxl/worksheet/picture.py +8 -0
- package/python/vendor/openpyxl/worksheet/print_settings.py +184 -0
- package/python/vendor/openpyxl/worksheet/properties.py +97 -0
- package/python/vendor/openpyxl/worksheet/protection.py +120 -0
- package/python/vendor/openpyxl/worksheet/related.py +17 -0
- package/python/vendor/openpyxl/worksheet/scenario.py +105 -0
- package/python/vendor/openpyxl/worksheet/smart_tag.py +78 -0
- package/python/vendor/openpyxl/worksheet/table.py +385 -0
- package/python/vendor/openpyxl/worksheet/views.py +155 -0
- package/python/vendor/openpyxl/worksheet/worksheet.py +907 -0
- package/python/vendor/openpyxl/writer/__init__.py +1 -0
- package/python/vendor/openpyxl/writer/excel.py +295 -0
- package/python/vendor/openpyxl/writer/theme.py +291 -0
- package/python/vendor/openpyxl/xml/__init__.py +42 -0
- package/python/vendor/openpyxl/xml/constants.py +129 -0
- package/python/vendor/openpyxl/xml/functions.py +87 -0
- package/watchlist/package.json +1 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
"""Constants for fixed paths in a file and xml namespace urls."""
|
|
5
|
+
|
|
6
|
+
MIN_ROW = 0
|
|
7
|
+
MIN_COLUMN = 0
|
|
8
|
+
MAX_COLUMN = 16384
|
|
9
|
+
MAX_ROW = 1048576
|
|
10
|
+
|
|
11
|
+
# constants
|
|
12
|
+
PACKAGE_PROPS = 'docProps'
|
|
13
|
+
PACKAGE_XL = 'xl'
|
|
14
|
+
PACKAGE_RELS = '_rels'
|
|
15
|
+
PACKAGE_THEME = PACKAGE_XL + '/' + 'theme'
|
|
16
|
+
PACKAGE_WORKSHEETS = PACKAGE_XL + '/' + 'worksheets'
|
|
17
|
+
PACKAGE_CHARTSHEETS = PACKAGE_XL + '/' + 'chartsheets'
|
|
18
|
+
PACKAGE_DRAWINGS = PACKAGE_XL + '/' + 'drawings'
|
|
19
|
+
PACKAGE_CHARTS = PACKAGE_XL + '/' + 'charts'
|
|
20
|
+
PACKAGE_IMAGES = PACKAGE_XL + '/' + 'media'
|
|
21
|
+
PACKAGE_WORKSHEET_RELS = PACKAGE_WORKSHEETS + '/' + '_rels'
|
|
22
|
+
PACKAGE_CHARTSHEETS_RELS = PACKAGE_CHARTSHEETS + '/' + '_rels'
|
|
23
|
+
PACKAGE_PIVOT_TABLE = PACKAGE_XL + '/' + 'pivotTables'
|
|
24
|
+
PACKAGE_PIVOT_CACHE = PACKAGE_XL + '/' + 'pivotCache'
|
|
25
|
+
|
|
26
|
+
ARC_CONTENT_TYPES = '[Content_Types].xml'
|
|
27
|
+
ARC_ROOT_RELS = PACKAGE_RELS + '/.rels'
|
|
28
|
+
ARC_WORKBOOK_RELS = PACKAGE_XL + '/' + PACKAGE_RELS + '/workbook.xml.rels'
|
|
29
|
+
ARC_CORE = PACKAGE_PROPS + '/core.xml'
|
|
30
|
+
ARC_APP = PACKAGE_PROPS + '/app.xml'
|
|
31
|
+
ARC_CUSTOM = PACKAGE_PROPS + '/custom.xml'
|
|
32
|
+
ARC_WORKBOOK = PACKAGE_XL + '/workbook.xml'
|
|
33
|
+
ARC_STYLE = PACKAGE_XL + '/styles.xml'
|
|
34
|
+
ARC_THEME = PACKAGE_THEME + '/theme1.xml'
|
|
35
|
+
ARC_SHARED_STRINGS = PACKAGE_XL + '/sharedStrings.xml'
|
|
36
|
+
ARC_CUSTOM_UI = 'customUI/customUI.xml'
|
|
37
|
+
|
|
38
|
+
## namespaces
|
|
39
|
+
# XML
|
|
40
|
+
XML_NS = "http://www.w3.org/XML/1998/namespace"
|
|
41
|
+
# Dublin Core
|
|
42
|
+
DCORE_NS = 'http://purl.org/dc/elements/1.1/'
|
|
43
|
+
DCTERMS_NS = 'http://purl.org/dc/terms/'
|
|
44
|
+
DCTERMS_PREFIX = 'dcterms'
|
|
45
|
+
|
|
46
|
+
# Document
|
|
47
|
+
DOC_NS = "http://schemas.openxmlformats.org/officeDocument/2006/"
|
|
48
|
+
REL_NS = DOC_NS + "relationships"
|
|
49
|
+
COMMENTS_NS = REL_NS + "/comments"
|
|
50
|
+
IMAGE_NS = REL_NS + "/image"
|
|
51
|
+
VML_NS = REL_NS + "/vmlDrawing"
|
|
52
|
+
VTYPES_NS = DOC_NS + 'docPropsVTypes'
|
|
53
|
+
XPROPS_NS = DOC_NS + 'extended-properties'
|
|
54
|
+
CUSTPROPS_NS = DOC_NS + 'custom-properties'
|
|
55
|
+
EXTERNAL_LINK_NS = REL_NS + "/externalLink"
|
|
56
|
+
|
|
57
|
+
# CustomDocumentProperty FMTID:
|
|
58
|
+
CPROPS_FMTID = "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}"
|
|
59
|
+
|
|
60
|
+
# Package
|
|
61
|
+
PKG_NS = "http://schemas.openxmlformats.org/package/2006/"
|
|
62
|
+
PKG_REL_NS = PKG_NS + "relationships"
|
|
63
|
+
COREPROPS_NS = PKG_NS + 'metadata/core-properties'
|
|
64
|
+
CONTYPES_NS = PKG_NS + 'content-types'
|
|
65
|
+
|
|
66
|
+
XSI_NS = 'http://www.w3.org/2001/XMLSchema-instance'
|
|
67
|
+
XML_NS = 'http://www.w3.org/XML/1998/namespace'
|
|
68
|
+
SHEET_MAIN_NS = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main'
|
|
69
|
+
|
|
70
|
+
# Drawing
|
|
71
|
+
CHART_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart"
|
|
72
|
+
DRAWING_NS = "http://schemas.openxmlformats.org/drawingml/2006/main"
|
|
73
|
+
SHEET_DRAWING_NS = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
|
|
74
|
+
CHART_DRAWING_NS = "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing"
|
|
75
|
+
|
|
76
|
+
CUSTOMUI_NS = 'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility'
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
NAMESPACES = {
|
|
80
|
+
'cp': COREPROPS_NS,
|
|
81
|
+
'dc': DCORE_NS,
|
|
82
|
+
DCTERMS_PREFIX: DCTERMS_NS,
|
|
83
|
+
'dcmitype': 'http://purl.org/dc/dcmitype/',
|
|
84
|
+
'xsi': XSI_NS,
|
|
85
|
+
'vt': VTYPES_NS,
|
|
86
|
+
'xml': XML_NS,
|
|
87
|
+
'main': SHEET_MAIN_NS,
|
|
88
|
+
'cust': CUSTPROPS_NS,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
## Mime types
|
|
92
|
+
WORKBOOK_MACRO = "application/vnd.ms-excel.%s.macroEnabled.main+xml"
|
|
93
|
+
WORKBOOK = "application/vnd.openxmlformats-officedocument.spreadsheetml.%s.main+xml"
|
|
94
|
+
SPREADSHEET = "application/vnd.openxmlformats-officedocument.spreadsheetml.%s+xml"
|
|
95
|
+
SHARED_STRINGS = SPREADSHEET % "sharedStrings"
|
|
96
|
+
EXTERNAL_LINK = SPREADSHEET % "externalLink"
|
|
97
|
+
WORKSHEET_TYPE = SPREADSHEET % "worksheet"
|
|
98
|
+
COMMENTS_TYPE = SPREADSHEET % "comments"
|
|
99
|
+
STYLES_TYPE = SPREADSHEET % "styles"
|
|
100
|
+
CHARTSHEET_TYPE = SPREADSHEET % "chartsheet"
|
|
101
|
+
DRAWING_TYPE = "application/vnd.openxmlformats-officedocument.drawing+xml"
|
|
102
|
+
CHART_TYPE = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"
|
|
103
|
+
CHARTSHAPE_TYPE = "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml"
|
|
104
|
+
THEME_TYPE = "application/vnd.openxmlformats-officedocument.theme+xml"
|
|
105
|
+
CPROPS_TYPE = "application/vnd.openxmlformats-officedocument.custom-properties+xml"
|
|
106
|
+
XLTM = WORKBOOK_MACRO % 'template'
|
|
107
|
+
XLSM = WORKBOOK_MACRO % 'sheet'
|
|
108
|
+
XLTX = WORKBOOK % 'template'
|
|
109
|
+
XLSX = WORKBOOK % 'sheet'
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# Extensions to the specification
|
|
113
|
+
|
|
114
|
+
EXT_TYPES = {
|
|
115
|
+
'{78C0D931-6437-407D-A8EE-F0AAD7539E65}': 'Conditional Formatting',
|
|
116
|
+
'{CCE6A557-97BC-4B89-ADB6-D9C93CAAB3DF}': 'Data Validation',
|
|
117
|
+
'{05C60535-1F16-4FD2-B633-F4F36F0B64E0}': 'Sparkline Group',
|
|
118
|
+
'{A8765BA9-456A-4DAB-B4F3-ACF838C121DE}': 'Slicer List',
|
|
119
|
+
'{FC87AEE6-9EDD-4A0A-B7FB-166176984837}': 'Protected Range',
|
|
120
|
+
'{01252117-D84E-4E92-8308-4BE1C098FCBB}': 'Ignored Error',
|
|
121
|
+
'{F7C9EE02-42E1-4005-9D12-6889AFFD525C}': 'Web Extension',
|
|
122
|
+
'{3A4CF648-6AED-40f4-86FF-DC5316D8AED3}': 'Slicer List',
|
|
123
|
+
'{7E03D99C-DC04-49d9-9315-930204A7B6E9}': 'Timeline Ref',
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
# Objects related to macros that we preserve
|
|
127
|
+
CTRL = "application/vnd.ms-excel.controlproperties+xml"
|
|
128
|
+
ACTIVEX = "application/vnd.ms-office.activeX+xml"
|
|
129
|
+
VBA = "application/vnd.ms-office.vbaProject"
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Copyright (c) 2010-2024 openpyxl
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
XML compatibility functions
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Python stdlib imports
|
|
8
|
+
import re
|
|
9
|
+
from functools import partial
|
|
10
|
+
|
|
11
|
+
from openpyxl import DEFUSEDXML, LXML
|
|
12
|
+
|
|
13
|
+
if LXML is True:
|
|
14
|
+
from lxml.etree import (
|
|
15
|
+
Element,
|
|
16
|
+
SubElement,
|
|
17
|
+
register_namespace,
|
|
18
|
+
QName,
|
|
19
|
+
xmlfile,
|
|
20
|
+
XMLParser,
|
|
21
|
+
)
|
|
22
|
+
from lxml.etree import fromstring, tostring
|
|
23
|
+
# do not resolve entities
|
|
24
|
+
safe_parser = XMLParser(resolve_entities=False)
|
|
25
|
+
fromstring = partial(fromstring, parser=safe_parser)
|
|
26
|
+
|
|
27
|
+
else:
|
|
28
|
+
from xml.etree.ElementTree import (
|
|
29
|
+
Element,
|
|
30
|
+
SubElement,
|
|
31
|
+
fromstring,
|
|
32
|
+
tostring,
|
|
33
|
+
QName,
|
|
34
|
+
register_namespace
|
|
35
|
+
)
|
|
36
|
+
from et_xmlfile import xmlfile
|
|
37
|
+
if DEFUSEDXML is True:
|
|
38
|
+
from defusedxml.ElementTree import fromstring
|
|
39
|
+
|
|
40
|
+
from xml.etree.ElementTree import iterparse
|
|
41
|
+
if DEFUSEDXML is True:
|
|
42
|
+
from defusedxml.ElementTree import iterparse
|
|
43
|
+
|
|
44
|
+
from openpyxl.xml.constants import (
|
|
45
|
+
CHART_NS,
|
|
46
|
+
DRAWING_NS,
|
|
47
|
+
SHEET_DRAWING_NS,
|
|
48
|
+
CHART_DRAWING_NS,
|
|
49
|
+
SHEET_MAIN_NS,
|
|
50
|
+
REL_NS,
|
|
51
|
+
VTYPES_NS,
|
|
52
|
+
COREPROPS_NS,
|
|
53
|
+
CUSTPROPS_NS,
|
|
54
|
+
DCTERMS_NS,
|
|
55
|
+
DCTERMS_PREFIX,
|
|
56
|
+
XML_NS
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
register_namespace(DCTERMS_PREFIX, DCTERMS_NS)
|
|
60
|
+
register_namespace('dcmitype', 'http://purl.org/dc/dcmitype/')
|
|
61
|
+
register_namespace('cp', COREPROPS_NS)
|
|
62
|
+
register_namespace('c', CHART_NS)
|
|
63
|
+
register_namespace('a', DRAWING_NS)
|
|
64
|
+
register_namespace('s', SHEET_MAIN_NS)
|
|
65
|
+
register_namespace('r', REL_NS)
|
|
66
|
+
register_namespace('vt', VTYPES_NS)
|
|
67
|
+
register_namespace('xdr', SHEET_DRAWING_NS)
|
|
68
|
+
register_namespace('cdr', CHART_DRAWING_NS)
|
|
69
|
+
register_namespace('xml', XML_NS)
|
|
70
|
+
register_namespace('cust', CUSTPROPS_NS)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
tostring = partial(tostring, encoding="utf-8")
|
|
74
|
+
|
|
75
|
+
NS_REGEX = re.compile("({(?P<namespace>.*)})?(?P<localname>.*)")
|
|
76
|
+
|
|
77
|
+
def localname(node):
|
|
78
|
+
if callable(node.tag):
|
|
79
|
+
return "comment"
|
|
80
|
+
m = NS_REGEX.match(node.tag)
|
|
81
|
+
return m.group('localname')
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def whitespace(node):
|
|
85
|
+
stripped = node.text.strip()
|
|
86
|
+
if stripped and node.text != stripped:
|
|
87
|
+
node.set("{%s}space" % XML_NS, "preserve")
|
package/watchlist/package.json
CHANGED