{"id":28261,"library":"spreadmagic","title":"SpreadMagic","description":"SpreadMagic is a Python package that provides a magic command for Jupyter and Google Colab to execute Python code in code cells using PyScript within an iframe, enabling interactive spreadsheet-like outputs. Current version 2.6.1, actively maintained.","status":"active","version":"2.6.1","language":"python","source_language":"en","source_url":"https://github.com/uniras/SpreadMagic","tags":["jupyter","magic","pyscript","spreadsheet","colab"],"install":[{"cmd":"pip install spreadmagic","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for magic command integration with Jupyter/Colab","package":"ipython","optional":false},{"reason":"Used to execute Python in iframe via Pyodide","package":"pyscript","optional":false}],"imports":[{"note":"Importing the module directly does not register the magic command; use the correct import and then run load_spreadmagic()","wrong":"import spreadmagic","symbol":"load_spreadmagic","correct":"from spreadmagic import load_spreadmagic"},{"note":"After loading, use %%spread as cell magic; no direct import for the magic itself","wrong":"","symbol":"%%spread","correct":"load_spreadmagic()"}],"quickstart":{"code":"from spreadmagic import load_spreadmagic\nload_spreadmagic()\n%%spread\nimport pandas as pd\ndf = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})\ndf","lang":"python","description":"Load the magic command and use %%spread to display a DataFrame as an interactive spreadsheet in Jupyter/Colab."},"warnings":[{"fix":"Use in a Jupyter environment only.","message":"The %%spread magic only works in Jupyter Notebook, JupyterLab, or Google Colab. It will not work in standard Python scripts or IDEs like VS Code (unless using a Jupyter extension).","severity":"gotcha","affected_versions":"all"},{"fix":"Change to 'from spreadmagic import load_spreadmagic' then call 'load_spreadmagic()'.","message":"The previous import pattern 'import spreadmagic' or 'from spreadmagic import spread' no longer works. The correct function is load_spreadmagic().","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Keep output size reasonable; for plots, consider using traditional Jupyter output instead.","message":"The iframe may not render correctly if the output is too large or contains certain libraries (e.g., matplotlib) due to PyScript limitations.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from spreadmagic import load_spreadmagic' then 'load_spreadmagic()'.","cause":"Using old import pattern like 'import spreadmagic' instead of correct import from module.","error":"NameError: name 'load_spreadmagic' is not defined"},{"fix":"Run 'from spreadmagic import load_spreadmagic' then 'load_spreadmagic()' before using %%spread.","cause":"Load function not called or called incorrectly before using the magic.","error":"UsageError: Cell magic `%%spread` not found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}