project_block_stacks Table

Overview

Each row in this table represents the textual representation of a code block associated a sprite used in the most recent version of a project shared on the Scratch website at the point of data collection. The code is presented in both a human-readable form, and in the raw format as it is stored in the Squeak programming language (used to create this version of Scratch).

This table only includes block stacks that are intended to be executed. In Scratch, the execution of code is triggered by a "hat" block that determines when the stack gets executed. For example, the execution of the blocks in the image shown below is triggered by the "hat" block "when [green flag]".

The stacks of blocks that are not intended to be executed, i.e. those without a "hat" block on top are in the project_block_stacks_disconnected table.

This table includes text input directly from users. Due to technological error, data corruption, and intentional action by users, this table includes invalid UTF-8 data. For completeness sake, we have included these data. Using the find_fix_invalid_encoding_in_json.py program included in the example scripts to decode the JSON data, we found that there were 171,827 rows with text encoding issues.

Description of Fields

This dataset includes 13,219,765 observations. Each row of this dataset corresponds a stack of blocks associated with a sprite in a project.

Variable Type Description
project_id integer Unique identifier for the project (see the projects table).
sprite_id integer Internal identifier for the sprite within the project (see the project_sprites table) where the blocks are placed.
stack_squeak character Code dump as it is stored internally in Squeak.
stack_human_readable character Code dump in a more human readable format.

Omitted Observations

We omit 4,925,149 observations because they refer to observations in older, non-public, versions of projects that were replaced on the site. Additionally, we omit 3,538,087 observations from projects which are not included in our projects table (e.g., they were removed from the site by their creators).

Download Datasets

These data are access restricted. Details on gaining access are provided in the "Permission to Use Datasets" section of the overview page.