  In preparing the way for the Square Kilometre Array and its pathfinders,
there is a pressing need to begin probing the transient sky in a fully robotic
fashion using the current generation of radio telescopes. Effective
exploitation of such surveys requires a largely automated data-reduction
process. This paper introduces an end-to-end automated reduction pipeline,
AMIsurvey, used for calibrating and imaging data from the Arcminute Microkelvin
Imager Large Array. AMIsurvey makes use of several component libraries which
have been packaged separately for open-source release. The most scientifically
significant of these is chimenea, which implements a telescope-agnostic
algorithm for automated imaging of pre-calibrated multi-epoch radio-synthesis
data, of the sort typically acquired for transient surveys or follow-up. The
algorithm aims to improve upon standard imaging pipelines by utilizing
iterative RMS-estimation and automated source-detection to avoid so called
`Clean-bias', and makes use of CASA subroutines for the underlying
image-synthesis operations. At a lower level, AMIsurvey relies upon two
libraries, drive-ami and drive-casa, built to allow use of mature
radio-astronomy software packages from within Python scripts. While targeted at
automated imaging, the drive-casa interface can also be used to automate
interaction with any of the CASA subroutines from a generic Python process.
Additionally, these packages may be of wider technical interest beyond
radio-astronomy, since they demonstrate use of the Python library pexpect to
emulate terminal interaction with an external process. This approach allows for
rapid development of a Python interface to any legacy or externally-maintained
pipeline which accepts command-line input, without requiring alterations to the
original code.
