|
8 | 8 |
|
9 | 9 | [](https://www.python.org/) |
10 | 10 | [](#) |
11 | | -[](scratchpy_studio.py) |
| 11 | +[](scratchpy_studio.py) |
12 | 12 | [](https://github.com/ZDStudios/scratchpy-studio/actions/workflows/build-apps.yml) |
13 | 13 | [](https://github.com/ZDStudios/scratchpy-studio/releases/latest) |
14 | 14 | [](LICENSE) |
@@ -41,16 +41,60 @@ and hand in. |
41 | 41 |
|
42 | 42 | | | | |
43 | 43 | |---|---| |
44 | | -| 🧩 **135 blocks** | Hat blocks, C-shaped loops, hexagonal booleans, reporter ovals that drop into slots — the real Scratch 3 shapes and colours | |
| 44 | +| 🧩 **148 blocks** | Hat blocks, C-shaped loops, hexagonal booleans, reporter ovals that drop into slots — the real Scratch 3 shapes and colours | |
45 | 45 | | 🐍 **Real Python, live** | The generated source updates as you drag. No hidden interpreter | |
46 | 46 | | ▶️ **It actually runs** | `print`, `input`, errors and a stop button, all wired to the built-in console | |
| 47 | +| 🌐 **Talks to the web out of the box** | GET, POST, headers, JSON, downloads — using `urllib` from the standard library, so there is nothing to install | |
47 | 48 | | 📥 **Import any `.py`** | Turn a program you already have into blocks — loops, functions, try/except, f-strings and all | |
48 | 49 | | 📦 **Every PyPI package** | pip dashboard installs anything and turns it into blocks automatically | |
49 | 50 | | 🤖 **Works with AI** | Built-in MCP server so an assistant can build blocks alongside you | |
50 | 51 | | 🎨 **Looks the part** | Because half the point of Scratch is that it looks inviting | |
51 | 52 |
|
52 | 53 | --- |
53 | 54 |
|
| 55 | +## The internet, with nothing installed |
| 56 | + |
| 57 | +The **Web** category is built in. No `pip install requests`, no venv, no |
| 58 | +waiting — it is `urllib` from the standard library dressed up as blocks. |
| 59 | + |
| 60 | +<div align="center"> |
| 61 | +<img src="docs/screenshot-web.png" width="900" alt="The built-in web blocks"> |
| 62 | +</div> |
| 63 | + |
| 64 | +| Block | What it does | |
| 65 | +|---|---| |
| 66 | +| `text from [url]` | The page or API answer as text | |
| 67 | +| `JSON from [url]` | The answer already turned into records and lists | |
| 68 | +| `send (GET▾) to [url]` | The all-purpose API sender — GET, POST, PUT, PATCH, DELETE, HEAD | |
| 69 | +| `send (POST▾) to [url] with JSON { }` | Send a record as a JSON body | |
| 70 | +| `post form { } to [url]` | The kind of form a web page would send | |
| 71 | +| `send header [name] as [value]` | Set it once; every request after it carries the header — this is where an API key goes | |
| 72 | +| `status code of [url]` · `[url] is working` | 200, 404, or 0 when nothing answers | |
| 73 | +| `download [url] to file [path]` | Save a picture or a file | |
| 74 | +| `[base] with values { }` | Builds `...?q=cats&page=2` safely | |
| 75 | +| `web safe [text]` | Percent-encodes anything for a URL | |
| 76 | + |
| 77 | +A 404 still hands you the body, so you can read the error message an API sends |
| 78 | +back. Only `http://` and `https://` addresses are accepted — a redirect cannot |
| 79 | +be talked into reading a local file. |
| 80 | + |
| 81 | +### Try it before you build it |
| 82 | + |
| 83 | +**Run → Try a web request**, or the button at the top of the Web category: |
| 84 | + |
| 85 | +<div align="center"> |
| 86 | +<img src="docs/screenshot-webtester.png" width="900" alt="The built-in request tester"> |
| 87 | +</div> |
| 88 | + |
| 89 | +Pick a method, paste a URL, add a header, press Send. You get the status code, |
| 90 | +how long it took, and the reply with JSON pretty-printed. **Make a block from |
| 91 | +this** then drops the matching blocks straight into your workspace. |
| 92 | + |
| 93 | +The tester runs the *same* helper functions your blocks compile to, so what you |
| 94 | +test is exactly what your program will do. |
| 95 | + |
| 96 | +--- |
| 97 | + |
54 | 98 | ## Bring your own Python |
55 | 99 |
|
56 | 100 | Press **Import .py** and pick any file. The whole program becomes blocks. |
@@ -238,7 +282,7 @@ writes a tidy module with a `main()` and an `if __name__ == "__main__":` guard. |
238 | 282 | python scratchpy_studio.py --selftest |
239 | 283 | ``` |
240 | 284 |
|
241 | | -Builds the entire interface head-lessly, then **compiles every one of the 135 |
| 285 | +Builds the entire interface head-lessly, then **compiles every one of the 148 |
242 | 286 | blocks**, checks the block definitions are well formed, round-trips a project |
243 | 287 | through save and load, exercises the Python importer and the MCP server, and |
244 | 288 | finally runs the generated example program and checks its output. |
|
0 commit comments