Return an |OpcPackage| instance loaded with the contents of `pkg_file`.
(cls, pkg_file: str | IO[bytes])
| 122 | |
| 123 | @classmethod |
| 124 | def open(cls, pkg_file: str | IO[bytes]) -> Self: |
| 125 | """Return an |OpcPackage| instance loaded with the contents of `pkg_file`.""" |
| 126 | pkg_reader = PackageReader.from_file(pkg_file) |
| 127 | package = cls() |
| 128 | Unmarshaller.unmarshal(pkg_reader, package, PartFactory) |
| 129 | return package |
| 130 | |
| 131 | def part_related_by(self, reltype: str) -> Part: |
| 132 | """Return part to which this package has a relationship of `reltype`. |