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

Method parse

src/packagedcode/pypi.py:1356–1370  ·  view source on GitHub ↗
(cls, location, package_only=False)

Source from the content-addressed store, hash-verified

1354
1355 @classmethod
1356 def parse(cls, location, package_only=False):
1357 with zipfile.ZipFile(location) as zf:
1358 for path in ZipPath(zf).iterdir():
1359 if not path.name.endswith(META_DIR_SUFFIXES):
1360 continue
1361 for metapath in path.iterdir():
1362 if not metapath.name.endswith('METADATA'):
1363 continue
1364
1365 yield parse_metadata(
1366 location=metapath,
1367 datasource_id=cls.datasource_id,
1368 package_type=cls.default_package_type,
1369 package_only=package_only,
1370 )
1371
1372
1373class PypiEggHandler(models.DatafileHandler):

Callers

nothing calls this directly

Calls 1

parse_metadataFunction · 0.85

Tested by

no test coverage detected