(normally) - in two flavors. Used only to prioritize high-traffic pages for dev work, iff JS and tracker enabled. The former/defunct training site's id: ga('create', 'UA-52578333-1', 'auto'). The book site's id, now used for all: ga('create', 'UA-52579036-1', 'auto'). JS is also used if enabled for thumbspage galleries, Top buttons, TOCs, etc. Jun-2019: tell Google Analytics to anonymize IP address on receipt for privacy. More: https://developers.google.com/analytics/devguides/collection/analyticsjs/. Oct-2022: install a GA4 tag (i.e., script) alongside the prior UA tag. UA tags will stop collecting data in 2023. It's okay to use both until the cutover (and Google advises doing so), but the UA tag will be pointless after that and should be removed. This handles genhtml-insert clients; others get tags by running insert-analytics.py in package-publishing scripts. Also per Google: "In Google Analytics 4, IP anonymization is not necessary since IP addresses are not logged or stored". Let's hope so... --> pixindex - Photos Page+Zipfile

pixindex — Make/Upload Photos Page+Zipfile

This small Python 3.X program generates an HTML page to view a folder of images — inline in the page, by links in the page, and by an automatically created and linked zipfile of the photos — and then transfers the photos and generated zipfile and HTML page to a site folder by FTP.

This program's page is relatively basic; its HTML can be enhanced arbitrarily by editing the script, and the newer thumbspage program is a more complete gallery solution. Still, this is a prime example of the sorts of tactical roles that Python excels at, in addition to its larger-scale strategic roles.

Resources

See the main script's docstring and other items below for usage details.

Code and docs:

Examples:

Download

Use the following to fetch pixindex, or view its unzipped content.

This program was last changed: April 2015.

For a related and more-comprehensive tool that generates image galleries with thumbnails and viewers, see thumbspage. For code that unzips a zipfile, see this page. For more code examples, see the programs page.



[Home page] Books Code Blog Python Author Train Find ©M.Lutz