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 AGPL 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.1.tar.gz (28.4 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.1-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scratch3_analyzer-1.1.1.tar.gz
  • Upload date:
  • Size: 28.4 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.1.tar.gz
Algorithm Hash digest
SHA256 24f0e940458f6531a1d64f779bf57af8ee4ae22889e1f3431192a160af4d22c7
MD5 7747b27a8ad1ffdc9ab47e87048340df
BLAKE2b-256 fa2bd4e1f905ae1562f19587f507ee7aa4d083beaaeb712e89fd91bf4deb9493

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for scratch3_analyzer-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f71927384983d45cf00e86706d6d1e3fa813563c1e95e945cab77489b5d0bd81
MD5 80e1a68c6d3be920d3fcaa17f12674d0
BLAKE2b-256 4e15624aa307c85e6d8a163d0de080d2a3223c9fda8e5625eaa5993e30576ede

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