Registry / web-framework / apysc
library4.12.0pypypi✓ verified 84d ago

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.

pip install apysc
INSTALL
IMPORT
SIG · APYSC
A
apysc
web-frameworkpythonv4.12.0
Install
3.1s avg
Import
4146ms
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.12.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 4.308s · 41.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.1s · import 3.984s · 42MB
39MB installed
● package 39MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Stage
from apysc import Stage
from apysc.display import Stage
Stage is at top-level, not under display.
Sprite
from apysc import Sprite
from apysc.display import Sprite
Sprite has been moved to top-level; old import may fail.
Rectangle
from apysc import Rectangle
from apysc.geom import Rectangle
Geometric shapes are now in top-level.

Creates a basic stage with a blue rectangle and saves as HTML.

from apysc import Stage, Sprite, Rectangle stage = Stage( stage_width=200, stage_height=200, background_color='#333', stage_elem_id='stage' ) sprite = Sprite(stage=stage) sprite.graphics.begin_fill(color='#0af') rect = sprite.graphics.draw_rect(x=50, y=50, width=100, height=100) stage.save_as_html(file_path='output.html')
Debug
Known issues
breakingIn v4.x, many classes (e.g., Sprite, Rectangle) were moved from subpackages to top-level apysc.
fix
Update imports: from apysc import Sprite instead of from apysc.display import Sprite.
affects: >=4.0.0,<5.0.0
breakingThe Stage constructor now requires explicit keyword arguments; old positional arguments may fail.
fix
Use named arguments: Stage(stage_width=..., stage_height=...).
affects: >=3.0.0,<4.0.0
gotchaHTML output has CSS class names that may conflict with existing page styles.
fix
Use stage_elem_id to prefix IDs or embed in an iframe.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'apysc'
apysc is not installed.
fix
Run: pip install apysc
ImportError: cannot import name 'Sprite' from 'apysc'
Old import path used (e.g., from apysc.display import Sprite) which no longer exists in v4.
fix
Use: from apysc import Sprite
TypeError: __init__() got multiple values for argument 'stage_width'
Passing positional arguments to Stage constructor instead of keyword arguments.
fix
Use keyword arguments: Stage(stage_width=..., stage_height=..., ...)
Upgrade
Version history
4.12.0latest on PyPI · released Aug 11, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
apysc — pip install apysc · libregistry