# openpyxl.packaging.relationship module

class openpyxl.packaging.relationship.Relationship(Id=None, Type=None, type=None, Target=None, TargetMode=None)

  Bases: `Serialisable`

  Represents many kinds of relationships.

  Id

    Values must be of type <class ‘str’>

  Target

    Values must be of type <class ‘str’>

  TargetMode

    Values must be of type <class ‘str’>

  Type

    Values must be of type <class ‘str’>

  id

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

  tagname = 'Relationship'
  target

    Aliases can be used when either the desired attribute name is not allowed or confusing in Python (eg. “type”) or a more descriptive name is desired (eg. “underline” for “u”)

class openpyxl.packaging.relationship.RelationshipList(iterable=(), /)

  Bases: `ElementList`

  append(value)

    Append object to the end of the list.

  expected_type

    alias of `Relationship`

  find(content_type)

    Find relationships by content-type NB. these content-types namespaced objects and different to the MIME-types in the package manifest :-(

  get(key)
  tagname = 'Relationships'
  to_dict()

    Return a dictionary of relations keyed by id

  to_tree()

openpyxl.packaging.relationship.get_dependents(archive, filename)

  Normalise dependency file paths to absolute ones

  Relative paths are relative to parent object

openpyxl.packaging.relationship.get_rel(archive, deps, id=None, cls=None)

  Get related object based on id or rel_type

openpyxl.packaging.relationship.get_rels_path(path)

  Convert relative path to absolutes that can be loaded from a zip archive. The path to be passed in is that of containing object (workbook, worksheet, etc.)