MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / from_sb3

Method from_sb3

scratchattach/editor/project.py:207–218  ·  view source on GitHub ↗

Load a project from an .sb3 file/bytes/file path

(cls, data: str | bytes | TextIOWrapper | BinaryIO, load_assets: bool = True, _name: Optional[str] = None)

Source from the content-addressed store, hash-verified

205
206 @classmethod
207 def from_sb3(cls, data: str | bytes | TextIOWrapper | BinaryIO, load_assets: bool = True, _name: Optional[str] = None):
208 """
209 Load a project from an .sb3 file/bytes/file path
210 """
211 _name, asset_data, json_str = cls.load_json(data, load_assets, _name)
212 data = json.loads(json_str)
213
214 project = cls.from_json(data)
215 project.name = _name
216 project.asset_data = asset_data
217
218 return project
219
220 @staticmethod
221 @deprecated("Use get_project(id).body() instead")

Callers 2

connect_pb_from_fileMethod · 0.80
test_projectFunction · 0.80

Calls 2

load_jsonMethod · 0.45
from_jsonMethod · 0.45

Tested by 1

test_projectFunction · 0.64