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. HTTP: how browsers and server talk to each other
  3. A Server: building a server with Flask
  4. Using a Database: getting data from SQLite using PyPika
  5. Testing the Server: testing the server with pytest
  6. Serving HTML: generating HTML with Jinja templates
  7. Using Forms: sending data to a server
  8. JavaScript in the Browser: using the language in its native habitat
  9. Using HTMX: letting the htmx library do the hard work
  10. Database Migration: managing database schema changes
  11. Permissions: representing and checking who can do what
  12. Authentication: checking the user's identity
  13. Encryption: keeping secrets safe
  14. Testing in the Browser: using Selenium to test the user interface
  15. Dynamic Graphics: drawing pictures with SVG.js
  16. A Graphical User Interface: handling interactivity in the browser
  17. Accessibility: because everyone should be comfortable
  18. Internationalization: because everyone should be welcome
  19. Logging and Auditing: keeping of track of what's happened
  20. Session: persistent sessions and JWT
  21. Caching: speeding things up
  22. Designing a Workflow: thinking before coding

Appendices

  1. HTML and CSS
  2. An Hour of JavaScript
  3. FastHTML
  4. Certificates
  5. License
  6. Code of Conduct
  7. Contributing
  8. Bibliography
  9. 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