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

Method from_file

etc/scripts/gen_pypi_simple.py:160–168  ·  view source on GitHub ↗
(cls, name, index_dir, archive_file)

Source from the content-addressed store, hash-verified

158
159 @classmethod
160 def from_file(cls, name, index_dir, archive_file):
161 with open(archive_file, "rb") as f:
162 checksum = hashlib.sha256(f.read()).hexdigest()
163 return cls(
164 name=name,
165 index_dir=index_dir,
166 archive_file=archive_file,
167 checksum=checksum,
168 )
169
170 def simple_index_entry(self, base_url):
171 return (

Callers 1

build_pypi_indexFunction · 0.45

Calls 2

hexdigestMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected