Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# Copyright (c) 2010-2020 openpyxl 

2 

3 

4"""Constants for fixed paths in a file and xml namespace urls.""" 

5 

6MIN_ROW = 0 

7MIN_COLUMN = 0 

8MAX_COLUMN = 16384 

9MAX_ROW = 1048576 

10 

11# constants 

12PACKAGE_PROPS = 'docProps' 

13PACKAGE_XL = 'xl' 

14PACKAGE_RELS = '_rels' 

15PACKAGE_THEME = PACKAGE_XL + '/' + 'theme' 

16PACKAGE_WORKSHEETS = PACKAGE_XL + '/' + 'worksheets' 

17PACKAGE_CHARTSHEETS = PACKAGE_XL + '/' + 'chartsheets' 

18PACKAGE_DRAWINGS = PACKAGE_XL + '/' + 'drawings' 

19PACKAGE_CHARTS = PACKAGE_XL + '/' + 'charts' 

20PACKAGE_IMAGES = PACKAGE_XL + '/' + 'media' 

21PACKAGE_WORKSHEET_RELS = PACKAGE_WORKSHEETS + '/' + '_rels' 

22PACKAGE_CHARTSHEETS_RELS = PACKAGE_CHARTSHEETS + '/' + '_rels' 

23PACKAGE_PIVOT_TABLE = PACKAGE_XL + '/' + 'pivotTables' 

24PACKAGE_PIVOT_CACHE = PACKAGE_XL + '/' + 'pivotCache' 

25 

26ARC_CONTENT_TYPES = '[Content_Types].xml' 

27ARC_ROOT_RELS = PACKAGE_RELS + '/.rels' 

28ARC_WORKBOOK_RELS = PACKAGE_XL + '/' + PACKAGE_RELS + '/workbook.xml.rels' 

29ARC_CORE = PACKAGE_PROPS + '/core.xml' 

30ARC_APP = PACKAGE_PROPS + '/app.xml' 

31ARC_WORKBOOK = PACKAGE_XL + '/workbook.xml' 

32ARC_STYLE = PACKAGE_XL + '/styles.xml' 

33ARC_THEME = PACKAGE_THEME + '/theme1.xml' 

34ARC_SHARED_STRINGS = PACKAGE_XL + '/sharedStrings.xml' 

35ARC_CUSTOM_UI = 'customUI/customUI.xml' 

36 

37## namespaces 

38# XML 

39XML_NS = "http://www.w3.org/XML/1998/namespace" 

40# Dublin Core 

41DCORE_NS = 'http://purl.org/dc/elements/1.1/' 

42DCTERMS_NS = 'http://purl.org/dc/terms/' 

43DCTERMS_PREFIX = 'dcterms' 

44 

45# Document 

46DOC_NS = "http://schemas.openxmlformats.org/officeDocument/2006/" 

47REL_NS = DOC_NS + "relationships" 

48COMMENTS_NS = REL_NS + "/comments" 

49IMAGE_NS = REL_NS + "/image" 

50VML_NS = REL_NS + "/vmlDrawing" 

51VTYPES_NS = DOC_NS + 'docPropsVTypes' 

52XPROPS_NS = DOC_NS + 'extended-properties' 

53EXTERNAL_LINK_NS = REL_NS + "/externalLink" 

54 

55# Package 

56PKG_NS = "http://schemas.openxmlformats.org/package/2006/" 

57PKG_REL_NS = PKG_NS + "relationships" 

58COREPROPS_NS = PKG_NS + 'metadata/core-properties' 

59CONTYPES_NS = PKG_NS + 'content-types' 

60 

61XSI_NS = 'http://www.w3.org/2001/XMLSchema-instance' 

62XML_NS = 'http://www.w3.org/XML/1998/namespace' 

63SHEET_MAIN_NS = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main' 

64 

65# Drawing 

66CHART_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart" 

67DRAWING_NS = "http://schemas.openxmlformats.org/drawingml/2006/main" 

68SHEET_DRAWING_NS = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" 

69CHART_DRAWING_NS = "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" 

70 

71CUSTOMUI_NS = 'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility' 

72 

73 

74NAMESPACES = { 

75 'cp': COREPROPS_NS, 

76 'dc': DCORE_NS, 

77 DCTERMS_PREFIX: DCTERMS_NS, 

78 'dcmitype': 'http://purl.org/dc/dcmitype/', 

79 'xsi': XSI_NS, 

80 'vt': VTYPES_NS, 

81 'xml': XML_NS, 

82 'main': SHEET_MAIN_NS 

83} 

84 

85## Mime types 

86WORKBOOK_MACRO = "application/vnd.ms-excel.%s.macroEnabled.main+xml" 

87WORKBOOK = "application/vnd.openxmlformats-officedocument.spreadsheetml.%s.main+xml" 

88SPREADSHEET = "application/vnd.openxmlformats-officedocument.spreadsheetml.%s+xml" 

89SHARED_STRINGS = SPREADSHEET % "sharedStrings" 

90EXTERNAL_LINK = SPREADSHEET % "externalLink" 

91WORKSHEET_TYPE = SPREADSHEET % "worksheet" 

92COMMENTS_TYPE = SPREADSHEET % "comments" 

93STYLES_TYPE = SPREADSHEET % "styles" 

94CHARTSHEET_TYPE = SPREADSHEET % "chartsheet" 

95DRAWING_TYPE = "application/vnd.openxmlformats-officedocument.drawing+xml" 

96CHART_TYPE = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" 

97CHARTSHAPE_TYPE = "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml" 

98THEME_TYPE = "application/vnd.openxmlformats-officedocument.theme+xml" 

99XLTM = WORKBOOK_MACRO % 'template' 

100XLSM = WORKBOOK_MACRO % 'sheet' 

101XLTX = WORKBOOK % 'template' 

102XLSX = WORKBOOK % 'sheet' 

103 

104 

105# Extensions to the specification 

106 

107EXT_TYPES = { 

108 '{78C0D931-6437-407D-A8EE-F0AAD7539E65}': 'Conditional Formatting', 

109 '{CCE6A557-97BC-4B89-ADB6-D9C93CAAB3DF}': 'Data Validation', 

110 '{05C60535-1F16-4FD2-B633-F4F36F0B64E0}': 'Sparkline Group', 

111 '{A8765BA9-456A-4DAB-B4F3-ACF838C121DE}': 'Slicer List', 

112 '{FC87AEE6-9EDD-4A0A-B7FB-166176984837}': 'Protected Range', 

113 '{01252117-D84E-4E92-8308-4BE1C098FCBB}': 'Ignored Error', 

114 '{F7C9EE02-42E1-4005-9D12-6889AFFD525C}': 'Web Extension', 

115 '{3A4CF648-6AED-40f4-86FF-DC5316D8AED3}': 'Slicer List', 

116 '{7E03D99C-DC04-49d9-9315-930204A7B6E9}': 'Timeline Ref', 

117} 

118 

119# Objects related to macros that we preserve 

120CTRL = "application/vnd.ms-excel.controlproperties+xml" 

121ACTIVEX = "application/vnd.ms-office.activeX+xml" 

122VBA = "application/vnd.ms-office.vbaProject"