Metadata-Version: 2.3
Name: ScratchExtensionTools
Version: 1.2.2
Summary: Tools to help build Scratch extensions in Python.
License: MIT
Keywords: scratch,extension,builder,pscript
Author: qiufeng
Author-email: appleidqiufeng@outlook.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: pscript (>=0.7,<1.0)
Project-URL: Changelog, https://github.com/qiufengcute/ScratchExtensionTools/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/qiufengcute/ScratchExtensionTools
Project-URL: Repository, https://github.com/qiufengcute/ScratchExtensionTools
Description-Content-Type: text/markdown

# Scratch Extension Tools

A Scratch Extension Tools.
It can help you made Scratch Extension.

## 📦 Installation
```bash
pip install ScratchExtensionTools
```

## 📜 Changelog
See [CHANGELOG.md](https://github.com/qiufengcute/ScratchExtensionTools/blob/main/CHANGELOG.md)


## QuickStart
```Python
from ScratchExtensionTools import ScratchExtensionBuilder

builder = ScratchExtensionBuilder()

def hello_func():
    print("Hello Scratch!")

builder.create_block(
    opcode="say_hello",
    block_type="command",
    text="say hello",
    py_func=hello_func,
    show_in=['sprite']  # Python side argument, exported as `filter` in Scratch JSON
)

js_code = builder.build_extension(
    ext_id="demo",
    ext_name="Demo Extension",
    ext_color="#ffcc00"
)

print(js_code)  # => Scratch JS Extension
```

## ⚠️ Note on filter / showin

In Scratch extension JSON, the property is filter.
But since filter is a Python built-in, this library uses the keyword showin on the Python side.
It will still output filter correctly in the generated Scratch extension JSON.

