File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11
11
Provides an API for manipulating Open Packaging Convention (OPC) packages.
12
12
"""
13
13
14
+ from opc .constants import RELATIONSHIP_TYPE as RT
14
15
from opc .oxml import CT_Relationships
15
16
from opc .packuri import PACKAGE_URI
16
17
from opc .pkgreader import PackageReader
@@ -27,6 +28,17 @@ def __init__(self):
27
28
super (OpcPackage , self ).__init__ ()
28
29
self ._rels = RelationshipCollection (PACKAGE_URI .baseURI )
29
30
31
+ @property
32
+ def main_document (self ):
33
+ """
34
+ Return a reference to the main document part for this package.
35
+ Examples include a document part for a WordprocessingML package, a
36
+ presentation part for a PresentationML package, or a workbook part
37
+ for a SpreadsheetML package.
38
+ """
39
+ rel = self ._rels .get_rel_of_type (RT .OFFICE_DOCUMENT )
40
+ return rel .target_part
41
+
30
42
@staticmethod
31
43
def open (pkg_file ):
32
44
"""
You can’t perform that action at this time.
0 commit comments