Skip to main content

A comprehensive Python library to extract, analyze, and export detailed statistics from Scratch 3.0 (.sb3) project files.

Project description

A comprehensive Python library to extract, analyze, and export detailed statistics from Scratch 3.0 (.sb3) project files.

PyPI Version Python Versions License

Features

  • Extract and analyze Scratch 3.0 project files (.sb3)

  • Analyze sprites, blocks, variables, lists, costumes, sounds, and events

  • Calculate project complexity scores

  • Export analysis results to Excel with multiple sheets

  • Batch process multiple .sb3 files

  • Command-line interface for easy use

  • Graphical user interface (GUI) for intuitive interaction

  • Python API for programmatic access

Installation

Install from PyPI:

pip install scratch3_analyzer

Requirements

  • Python 3.7 or higher

  • pandas >= 1.3.0

  • openpyxl >= 3.0.0

For GUI functionality (optional): * tkinter (usually included with Python on Windows and macOS)

Quick Start

Using Python API

from scratch3_analyzer import Scratch3Analyzer

# Create analyzer instance
analyzer = Scratch3Analyzer()

# Analyze a single .sb3 file
result = analyzer.analyze_file(
    sb3_path="my_project.sb3",
    output_excel="analysis_results.xlsx"  # Optional: export to Excel
)

# Print some statistics
print(f"Total blocks: {result['complexity']['total_blocks']}")
print(f"Total sprites: {result['complexity']['total_sprites']}")
print(f"Complexity score: {result['complexity']['complexity_score']}")

Using Command Line

# Analyze a single file
scratch3-analyzer analyze my_project.sb3 --output results.xlsx

# Analyze all files in a directory
scratch3-analyzer batch ./projects --output summary.xlsx

# Show version
scratch3-analyzer --version

# Show help
scratch3-analyzer --help

Graphical User Interface (GUI)

Starting from version 1.1.0, Scratch3 Analyzer includes a graphical user interface.

Launch GUI:

scratch3-analyzer --gui

GUI Features:

* Single file analysis: Select and analyze individual .sb3 files
* Batch processing: Analyze all .sb3 files in a directory
* Recursive search: Option to search subdirectories for .sb3 files
* Excel export: Export results to Excel with customizable output path
* Progress tracking: Real-time progress display during analysis
* Results display: View analysis results directly in the application

Development

# Clone the repository
git clone https://github.com/jzm3/scratch3_analyzer.git
cd scratch3_analyzer

# Install in development mode
pip install -e .

Building and Publishing

# Build package
python -m build

# Upload to PyPI
python -m twine upload dist/*

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository

  2. Create a feature branch: git checkout -b feature/amazing-feature

  3. Commit your changes: git commit -m 'Add amazing feature'

  4. Push to the branch: git push origin feature/amazing-feature

  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

jzm (939370014@qq.com)

Project Home

Changelog

Version 1.1.0 (2024-01-08)

Added

  • Added graphical user interface (GUI) with tkinter

  • New --gui command-line option to launch the GUI

  • GUI features include file selection, batch processing, and results display

  • Progress tracking during analysis

  • Recursive directory search option in GUI

Changed

  • Updated CLI to support GUI mode

  • Enhanced user experience with better error messages

Fixed

  • Improved error handling in file extraction

  • Fixed compatibility issues with different Python versions

Version 1.0.1 (2024-01-08)

Added

  • Added comprehensive documentation

  • Improved README with detailed examples

  • Enhanced API documentation

Changed

  • Updated README format to reStructuredText (RST)

  • Enhanced command-line help messages

Fixed

  • Fixed documentation formatting

  • Improved compatibility with different Python versions

Version 1.0.0 (2024-01-07)

Added

  • Initial release of Scratch3 Analyzer

  • Core functionality for analyzing Scratch 3.0 (.sb3) files

  • Support for extracting sprites, blocks, variables, lists, costumes, sounds, and events

  • Excel export functionality with multiple sheets

  • Command-line interface

  • Batch processing of multiple .sb3 files

  • Project complexity scoring system

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scratch3_analyzer-1.1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scratch3_analyzer-1.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file scratch3_analyzer-1.1.0.tar.gz.

File metadata

  • Download URL: scratch3_analyzer-1.1.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for scratch3_analyzer-1.1.0.tar.gz
Algorithm Hash digest
SHA256 07bde04e5852ab44e0525bacb908ed8c5cac7c13cb5f4c2cb8c223cf0d07430a
MD5 9a4224421fab15caa9601c89ee097281
BLAKE2b-256 216d7026c703697fcdab8e8ee0900fd08d9b7d8c5400d21aa3715ba84bb6581f

See more details on using hashes here.

File details

Details for the file scratch3_analyzer-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scratch3_analyzer-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 398db7c16fb43483f9d71dc22dee40639cc8e1412a58449e546f8b2e51333bbb
MD5 1e8ca0d29b9b4585a8fd6a4a7019005f
BLAKE2b-256 b82d58c6a0b00f6daf378cd30c084a4512f935bf5848696962700c3744385afd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page