Talks - Jeff Glass: Making Your Documentation Interactive with PyScript

Learn how PyScript enables interactive Python documentation with code cells, package support, and WebAssembly compilation. Add live code examples to docs without servers.

Key takeaways
  • PyScript enables running Python code directly in the browser through interactive code cells embedded in documentation
  • Most pure Python packages and standard library features work natively in the browser through WebAssembly compilation
  • Integration options available for popular documentation systems like Sphinx and MkDocs through dedicated extensions
  • Code cells can share state through shared environments or run independently in separate interpreter instances
  • Configurations allow installing packages from PyPI and loading local files into the virtual filesystem
  • Worker threads handle code execution to prevent browser tab freezing
  • Scientific libraries like NumPy, Pandas, and SciKit-Learn are supported through pre-compiled WebAssembly builds
  • Setup tags enable hidden code execution for imports and object initialization
  • Browser limitations affect features like threading, windowing (no TKinter/Curses), and networking
  • Deployment works on static hosts like GitHub Pages or Read the Docs without requiring server infrastructure