MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / to_dict

Method to_dict

src/packagedcode/models.py:880–888  ·  view source on GitHub ↗
(self, with_details=True, **kwargs)

Source from the content-addressed store, hash-verified

878 setattr(self, purl_field, getattr(package_data, purl_field))
879
880 def to_dict(self, with_details=True, **kwargs):
881 mapping = super().to_dict(with_details=with_details, **kwargs)
882 if not with_details:
883 # these are not used in the Package subclass
884 mapping.pop('file_references', None)
885 mapping.pop('dependencies', None)
886 mapping.pop('datasource_id', None)
887
888 return mapping
889
890 @classmethod
891 def from_dict(cls, mapping):

Calls 2

to_dictMethod · 0.45
popMethod · 0.45