{"id":23273,"library":"apysc","title":"apysc","description":"apysc is a Python frontend library that generates HTML and JavaScript files with an ActionScript 3 (AS3)-like interface. Current version is 4.12.0, with frequent releases.","status":"active","version":"4.12.0","language":"python","source_language":"en","source_url":"https://github.com/simon-ritchie/apysc","tags":["frontend","html","javascript","actionscript","animation","graphics"],"install":[{"cmd":"pip install apysc","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Stage is at top-level, not under display.","wrong":"from apysc.display import Stage","symbol":"Stage","correct":"from apysc import Stage"},{"note":"Sprite has been moved to top-level; old import may fail.","wrong":"from apysc.display import Sprite","symbol":"Sprite","correct":"from apysc import Sprite"},{"note":"Geometric shapes are now in top-level.","wrong":"from apysc.geom import Rectangle","symbol":"Rectangle","correct":"from apysc import Rectangle"}],"quickstart":{"code":"from apysc import Stage, Sprite, Rectangle\n\nstage = Stage(\n    stage_width=200,\n    stage_height=200,\n    background_color='#333',\n    stage_elem_id='stage'\n)\nsprite = Sprite(stage=stage)\nsprite.graphics.begin_fill(color='#0af')\nrect = sprite.graphics.draw_rect(x=50, y=50, width=100, height=100)\nstage.save_as_html(file_path='output.html')\n","lang":"python","description":"Creates a basic stage with a blue rectangle and saves as HTML."},"warnings":[{"fix":"Update imports: from apysc import Sprite instead of from apysc.display import Sprite.","message":"In v4.x, many classes (e.g., Sprite, Rectangle) were moved from subpackages to top-level apysc.","severity":"breaking","affected_versions":">=4.0.0,<5.0.0"},{"fix":"Use named arguments: Stage(stage_width=..., stage_height=...).","message":"The Stage constructor now requires explicit keyword arguments; old positional arguments may fail.","severity":"breaking","affected_versions":">=3.0.0,<4.0.0"},{"fix":"Use stage_elem_id to prefix IDs or embed in an iframe.","message":"HTML output has CSS class names that may conflict with existing page styles.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install apysc","cause":"apysc is not installed.","error":"ModuleNotFoundError: No module named 'apysc'"},{"fix":"Use: from apysc import Sprite","cause":"Old import path used (e.g., from apysc.display import Sprite) which no longer exists in v4.","error":"ImportError: cannot import name 'Sprite' from 'apysc'"},{"fix":"Use keyword arguments: Stage(stage_width=..., stage_height=..., ...)","cause":"Passing positional arguments to Stage constructor instead of keyword arguments.","error":"TypeError: __init__() got multiple values for argument 'stage_width'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}