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

Method parse

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

Source from the content-addressed store, hash-verified

1381
1382 @classmethod
1383 def parse(cls, location, package_only=False):
1384 with zipfile.ZipFile(location) as zf:
1385 for path in ZipPath(zf).iterdir():
1386 if not path.name.endswith(META_DIR_SUFFIXES):
1387 continue
1388
1389 for metapath in path.iterdir():
1390 if not metapath.name.endswith('PKG-INFO'):
1391 continue
1392
1393 yield parse_metadata(
1394 location=metapath,
1395 datasource_id=cls.datasource_id,
1396 package_type=cls.default_package_type,
1397 package_only=package_only,
1398 )
1399
1400# FIXME: this is NOT used
1401class PypiSdistArchiveHandler(models.DatafileHandler):

Callers

nothing calls this directly

Calls 1

parse_metadataFunction · 0.85

Tested by

no test coverage detected