The Webonomicon

An Introduction to Web Programming for the Cautious and Weary

Advent 354 by Danielle Navarro

This tutorial is a short introduction to web programming using modern tools and practices for data scientists who are comfortable using Python but have never built interactive websites before. All of the material is available under open licenses, and contributions through our GitHub repository are welcome. All contributors are required to respect our Code of Conduct.

Please note: this tutorial is still being outlined. Most sections will have additional examples (and much more explanation) before learners encounter it. Suggestions and help are greatly appreciated.

Learner Persona

Syllabus

  1. Introduction: what we will learn, how to set up, and the data we will use
  2. HTML and CSS
  3. An Hour of JavaScript
  4. JavaScript in the Browser: using the language in its native habitat
  5. HTTP: how browsers and server talk to each other
  6. A Server: building a server with Flask
  7. Using a Database: getting data from SQLite using PyPika
  8. Testing the Server: testing the server with pytest
  9. Serving HTML: generating HTML with Jinja templates
  10. Using Forms: sending data to a server
  11. Using HTMX: letting the htmx library do the hard work
  12. Database Migration: managing database schema changes
  13. Authentication: checking the user's identity
  14. Testing in the Browser: using Selenium to test the user interface
  15. Encryption: keeping secrets safe
  16. Uploading Files: multi-step interactions
  17. Permissions: representing and checking who can do what
  18. Accessibility: because everyone should be comfortable
  19. A Graphical User Interface: handling interactivity in the browser
  20. Dynamic Graphics: drawing pictures with SVG.js
  21. Internationalization: because everyone should be welcome
  22. Sessions: persistent sessions and JWT
  23. Logging and Auditing: keeping of track of what's happened
  24. Caching: speeding things up

Appendices

  1. Designing a Workflow
  2. FastHTML
  3. Certificates
  4. License
  5. Code of Conduct
  6. Contributing
  7. Bibliography
  8. Glossary

Technologies

Package Purpose
Alpine.js dynamic HTML
Beautiful Soup HTML manipulation
deno JavaScript
FastHTML web framework
Flask web server
Frappe Charts charts
html5validator validation
htmx interaction
httpx HTTP
Jinja2 HTML templating
Polars tabular data
PrettyTable formatting
PyPika query builder
pytest testing
Selenium testing
SQLite database
SVG.js graphics