Next / Previous / Contents / Shipman's homepage

4. Module imports

This module is built on top of a sizeable collection of other modules. Here are their imports.
# - - - - -   I m p o r t s

We'll need the standard Python sys module for access to standard I/O streams. We also need os and stat to retrieve file timestamps, datetime for calendar functions, and the standard regular expression library re.
import sys
import os
import stat
import datetime
import re

XML processing is done using the lxml.etree package. We call this module et here.
from lxml import etree as et

Because the module manipulates GPS waypoints, we next import a part of the author's mapping package, See the documentation, A Python mapping package.
import terrapos

The next module is a vital part of the bird records system: the taxonomy module. See the documentation: A system for representing bird taxonomy. Module is the main taxonomy module. Module contains auxiliary functions for handling general bird identifications including species pairs and hybrids.
import xnomo3
import abbr as abbrModule

Rather than use string constants for the names of the XML elements and attributes in the birdnotes.rnc schema, we use a script named pyrang to extract those names and write a file named containing declarations of symbolic names for each one. For more information, see the documentation for pyrang. See also the generated actual file.
import rnc