I'm trying to learn PyScript. My first project is an accessible org chart. The org chart is deployed using GitHub pages. See the org chart demo to play with test data.
The data used in the org chart is based on names and GitHub handles of cpython contributors. The manager relationships are completely fictitious.
If you want to add your own data, use the add feature. Data is stored in your browser's local storage and never sent to a server.
This project has been a useful learning tool as it uses numerous features of PyScript, including:
- Use of packages, outside of the standard library, that do and don't ship with pyodide
- Packages that ship with pyodide and are used in this project
- bleach
- jinja2
- Other packages used in this project
- thefuzz
- Packages that ship with pyodide and are used in this project
- Using Jinja templates to build the UI
- Using pyodide APIs to search and modify the DOM e.g.,
document.getElementById
,document.querySelectorAll
- Using a JavaScript object from within Python
- Adding event listeners to DOM elements using
pyodide.ffi.wrappers.add_event_listener
- Using the python standard library in the web browser! OMG, how cool is that?