/ ITC Help System
/ Site map
/ NM Tech homepage
Python Web frontends to database backends
To illustrate how easy it is to build a Web frontend for a
database using Python's universal database interface, here is
an application for biologists.
- The application area is a system of six-letter codes used
to represent bird species (and genera and families and
subspecies). See the link to
A robust bird code system for an explanation of
how bird names are converted to codes.
- The last link on the above page,
`Look up bird names and codes', uses a MySQL database
backend. Try entering codes like AMEROB (for American
Robin) and HARDUC (Harlequin Duck), or scientific
names like Porzana carolina.
- Several major Python modules are involved in this application:
- Two CGI scripts handle the two forms on the page.
abbrlookup.cgi takes care of looking up codes, and
scilookup.cgi handles lookup of scientific names.
- Both these CGI scripts use a common module named
showtaxa.py that provides
a function named htmlTaxon() that displays the complete
classification of a bird in HTML.
hier.py represents the system
of taxonomic ranks (e.g, order, family, genus, species, etc.)
used in the classification. This module is actually just an
interface to a short text file,
ranks, whose format is discussed
documentation links on the
base page for the six-letter code system.
The hier.py module is required by the next module,
txny.py contains the complete
classification of North American birds. To the layers built
on top of it, it looks like a system of persistent objects,
but the persistence is provided by the MySQL layer below.
- The txny.py layer is built on top of my
Python database helper functions.
- The database helper functions are built in turn on top of
Python's universal database applications programming interface
(DBAPI), version 1.0, which is discussed on the
Python database topic guide.
- To get the specific DBAPI that connects to the MySQL
database engine, use:
which supports the DBAPI 1.0 interface.
See also: Examples of applications written in Python
Previous: Some Python database helper functions
to help pages
New Mexico Tech Information Technology and Communications: Help System
To report a problem: File a ticket
Send mail to the User consultant
on duty or call them at 575-835-5437
About New Mexico Tech
John Shipman, email@example.com
Last updated: 2006/12/07 22:36:39 UT