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. An Hour of JavaScript: variables, loops, functions, and callbacks
  9. JavaScript in the Browser: using the language in its native habitat
  10. Using HTMX: letting the htmx library do the hard work
  11. Database Migration: managing database schema changes
  12. Permissions: representing and checking who can do what
  13. Authentication: checking the user's identity
  14. Encryption: keeping secrets safe
  15. Testing in the Browser: using Selenium to test the user interface
  16. Dynamic Graphics: drawing pictures with SVG.js
  17. A Graphical User Interface: handling interactivity in the browser
  18. Accessibility: because everyone should be comfortable
  19. Internationalization: because everyone should be welcome
  20. Logging and Auditing: keeping of track of what's happened
  21. Session: persistent sessions and JWT
  22. FastHTML: using a framework
  23. Designing a Workflow: thinking before coding

Appendices

  1. HTML and CSS
  2. Certificates
  3. License
  4. Code of Conduct
  5. Contributing
  6. Bibliography
  7. Glossary

Technologies

Package Purpose
Alpine.js dynamic HTML
Beautiful Soup HTML manipulation
deno JavaScript
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