100% found this document useful (1 vote)
5 views

Flask Blueprints 1st Edition Joel Perras instant download

The document provides information about the book 'Flask Blueprints' by Joël Perras, which focuses on developing web applications using the Flask microframework. It covers various topics including setting up virtual environments, application structure, and building specific applications like a code snippet sharing app and a recipe sharing app. The book is designed for web developers looking to learn and adapt Flask for their specific application needs.

Uploaded by

ketllylahave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5 views

Flask Blueprints 1st Edition Joel Perras instant download

The document provides information about the book 'Flask Blueprints' by Joël Perras, which focuses on developing web applications using the Flask microframework. It covers various topics including setting up virtual environments, application structure, and building specific applications like a code snippet sharing app and a recipe sharing app. The book is designed for web developers looking to learn and adapt Flask for their specific application needs.

Uploaded by

ketllylahave
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

Flask Blueprints 1st Edition Joel Perras pdf

download

https://ebookname.com/product/flask-blueprints-1st-edition-joel-
perras/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Node js Blueprints Tsonev

https://ebookname.com/product/node-js-blueprints-tsonev/

Elasticsearch Blueprints 1st Edition Vineeth Mohan

https://ebookname.com/product/elasticsearch-blueprints-1st-
edition-vineeth-mohan/

Arduino Android Blueprints 1st Edition Schwartz

https://ebookname.com/product/arduino-android-blueprints-1st-
edition-schwartz/

Democracy and the Rule of Law in Classical Athens


Essays on Law Society and Politics Edward M. Harris

https://ebookname.com/product/democracy-and-the-rule-of-law-in-
classical-athens-essays-on-law-society-and-politics-edward-m-
harris/
Portugal 18th ed Edition Darwin Porter

https://ebookname.com/product/portugal-18th-ed-edition-darwin-
porter/

Introduction to Biomedical Engineering 2nd ed Edition


John Enderle

https://ebookname.com/product/introduction-to-biomedical-
engineering-2nd-ed-edition-john-enderle/

The Knowing Organization How Organizations Use


Information to Construct Meaning Create Knowledge and
Make Decisions 2nd Edition Chun Wei Choo

https://ebookname.com/product/the-knowing-organization-how-
organizations-use-information-to-construct-meaning-create-
knowledge-and-make-decisions-2nd-edition-chun-wei-choo/

Inuksuit silent messengers of the Arctic 1st pbk. ed


Edition Hallendy

https://ebookname.com/product/inuksuit-silent-messengers-of-the-
arctic-1st-pbk-ed-edition-hallendy/

Fate and Free Will A Defense of Theological Determinism


Heath White

https://ebookname.com/product/fate-and-free-will-a-defense-of-
theological-determinism-heath-white/
Renewables Information 2004 Edition Oecd

https://ebookname.com/product/renewables-
information-2004-edition-oecd/
Flask Blueprints

Dive into the world of the Flask microframework to


develop an array of web applications

Joël Perras

BIRMINGHAM - MUMBAI
Flask Blueprints

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: November 2015

Production reference: 1251115

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78439-478-3

www.packtpub.com
Credits

Author Project Coordinator


Joël Perras Sanjeet Rao

Reviewers Proofreader
Shalabh Aggarwal Safis Editing
Christoph Heer
Andreas Porevopoulos Indexer
Monica Ajmera Mehta

Commissioning Editor
Julian Ursell Graphics
Disha Haria

Acquisition Editor
Meeta Rajani Production Coordinator
Nilesh R. Mohite

Content Development Editor


Shweta Pant Cover Work
Nilesh R. Mohite

Technical Editor
Bharat Patil

Copy Editor
Tasneem Fatehi
About the Author

Joël Perras has been professionally involved in technology and computing


for over 12 years. He got his start in the world of programming by attempting
to teach himself Java at the tender age of 13 and got his first job at a small web
development firm a few years later writing Java Server Pages. The first site he
built is still running.

While studying physics and mathematics at McGill University in Montréal,


he helped set up a Tier II analysis centre for the Worldwide LHC Computing
Grid, which cemented his interest in distributed systems architecture and high
performance computing.

Currently, his days are spent building infrastructure and Python applications with
the incredible people at Fictive Kin, writing open source code, and trying to lift
heavy weights over his head on a regular basis.

I'd like to thank Sara for her infinite patience throughout the
process of writing this lengthy technical manual and my coworkers
at Fictive Kin for dealing with my particularly bad sense of humor
on a daily basis.
About the Reviewers

Shalabh Aggarwal has several years of experience in developing business systems


and web applications for small-to-medium scale industries. He started his career
working on Python, and although he works on multiple technologies, he remains
a Python developer at heart. He is passionate about open source technologies and
writes highly readable and quality code.

Shalabh is also active in voluntary training for engineering students on


nonconventional and open source topics. When not working with full-time
assignments, he acts as a consultant for start-ups on leveraging different
technologies. He is pursuing his master's degree in business from IIT Delhi.

I would like to thank my family, my mother, and my sister for


putting up with me during my long writing and research sessions. I
would also like to thank my friends and colleagues who encouraged
me and kept the momentum going. I would like to thank Armin
Ronacher for developing this wonderful web framework.

Christoph Heer is a passionate Python developer based in Germany. He likes to


develop web applications and also tools and systems for infrastructure optimization,
management, and monitoring. He is proud to be a part of the great Python
community and wishes to have more time for open source contribution.
Andreas Porevopoulos has loved computers and programming since he was in
high school and over the years he has developed many apps in different languages
and systems, but Python was always his favorite. He has been working as a Full
Stack Python developer for the last 7 years and has completed lots of projects in
Django and Flask. He believes that these two frameworks are among the best for web
app development.

The agile practices that he uses for all his developing/deploying needs are Git,
Ansible, Vagrant, and Docker.
www.PacktPub.com

Support files, eBooks, discount offers, and more


For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at service@packtpub.com for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Table of Contents
Preface v
Chapter 1: Starting on the Right Foot – Using Virtualenv 1
Setuptools and pip 2
Avoiding dependency hell, the Python way 5
Working with virtualenv 6
Creating a new virtual environment 6
Activating and deactivating virtual environments 7
Adding packages to an existing environment 7
Uninstalling packages from an existing environment 8
Simplifying common operations – using the virtualenvwrapper tool 8
Summary 10
Chapter 2: Small to Big – Growing the Flask Application Structure 11
Your first Flask application structure 11
From module to package 13
From package to blueprint 17
Our first blueprint 18
Summary 20
Chapter 3: Snap – the Code Snippet Sharing Application 21
Getting started 22
Flask-SQLAlchemy 22
Configuring Flask-SQLAlchemy 23
SQLAlchemy basics 24
Snap data models 29
Flask-Login and Flask-Bcrypt for authentication 31
Flask-WTF – form validation and rendering 32
Hashing user passwords 37
Configure an application SECRET_KEY 39
Hook up the blueprint 40
Let's run this thing 40
[i]
Table of Contents

The data model for snaps 41


Better defaults with content-sensitive default functions 44
Snap view handlers 44
Summary 50
Chapter 4: Socializer – the Testable Timeline 51
Starting off 51
Application factories 52
The application context 53
Instantiating an app object 55
Unit and functional testing 55
Social features – friends and followers 58
Functional and integration testing 66
Publish/subscribe events with Blinker 70
Signals from Flask and extensions 71
Creating custom signals 72
Graceful handling of exceptions 75
Functional testing 81
Your newsfeed 85
Summary 88
Chapter 5: Shutterbug, the Photo Stream API 91
Starting off 91
The application factory 92
Interlude – Werkzeug 93
Simple APIs with Flask-RESTful 94
Improved password handling with hybrid attributes 98
API authentication 100
Authentication protocols 101
Getting users 104
Creating new users 106
API testing 108
Interlude – Werkzeug middlewares 112
Back to Shutterbug – uploading photos 114
Testing the photo uploads 117
Fetching the user's photos 119
Summary 120
Chapter 6: Hublot – Flask CLI Tools 121
Starting off 122
The manage.py file 126
The built-in default commands 128
The Flask-Script commands across Blueprints 129
Submanagers 130
The required and optional arguments 131

[ ii ]
Table of Contents

Flask extensions – the basics 134


When should an extension be used? 135
Our extension – GitHubber 135
Summary 140
Chapter 7: Dinnerly – Recipe Sharing 141
First OAuth 141
Why use OAuth? 142
Terminology 143
So what's wrong with OAuth 1.0? 146
Three-legged authorization 146
Setting up the application 147
Declaring our models 149
Handling OAuth in our views 153
Creating recipes 159
Posting recipes to Twitter and Facebook 161
SQLAlchemy events 161
Finding common friends 164
Interlude – database migrations 166
Alembic 167
Summary 171
Index 173

[ iii ]
Preface
The setting is familiar enough: you're a web developer who has worked with a
few programming languages, frameworks and environments, and decided to learn
enough Python to make a few toy web applications. Maybe you've already used
some Python web frameworks to build an application or two, and want to explore a
few of the alternative options that you keep hearing about.

This is usually how people come to know about Flask.

As a microframework, Flask is built to help you and then get out of your way.
Taking a very different approach from most other general-purpose web frameworks,
Flask consists of a very small core that handles the processing and normalization
of HTTP and the WSGI specification (via Werkzeug) and provides an exceptionally
good templating language (via Jinja2). The beauty of Flask lies in its intrinsic
extensibility: as it was designed from the start to do very little, it was also designed
to be extended very easily. A pleasant consequence of this is that you are not
beholden to a particular database abstraction layer, authentication protocol, or
caching mechanism.

Learning a new framework is not simply about learning the basic functions and
objects that are provided to you: it's often as important to learn how the framework
can be adapted to help you build the specific requirements of your application.

This book will demonstrate how to develop a series of web application projects with
the Python web microframework, and leverage extensions and external Python
libraries/APIs to extend the development of a variety of larger and more complex
web applications.

[v]
Preface

What this book covers


Chapter 1, Starting on the Right Foot – Using Virtualenv, kicks off our dive into Python
web application development with the basics of using and managing virtual
environments to isolate the application dependencies. We will look at the setup tools,
pip, libraries, and utilities that are used to install and distribute reusable packages of
Python code, and virtualenv, a tool to create isolated environments for the Python-
based software requirements of a project. We will also discuss what these tools
are not able to do, and look at the virtualenvwrapper abstraction to augment the
functionality that virtualenv provides.

Chapter 2, Small to Big – Growing the Flask Application Structure, explores the various
baseline layouts and configurations that you might consider for a Flask application.
The pros and cons of each approach are outlined as we progress from the simplest one-
file application structure to the more complex, multipackage Blueprint architecture.

Chapter 3, Snap – the Code Snippet Sharing Application, builds our first simple
Flask application centered around learning the basics of one of the most popular
relational database abstractions, SQLAlchemy, and several of the most popular Flask
extensions: Flask-Login to handle authenticated user login sessions, Flask-Bcrypt
to ensure that account passwords are stored in a secure manner, and Flask-WTF to
create and process form-based input data.

Chapter 4, Socializer – the Testable Timeline, builds a very simple data model for a
social web application where the main focus is on unit and functional testing using
pytest, the Python testing framework and tools. We will also explore the use of
the application factory pattern, which allows us to instantiate separate versions of
our application for the purposes of simplifying testing. Additionally, the use and
creation of often-omitted (and forgotten) signals, provided by the Blinker library, are
described in detail.

Chapter 5, Shutterbug, the Photo Stream API, builds a skeleton of an application


around a JSON-based API, which is a requirement for any modern web application
these days. One of the many API-based Flask extensions, Flask-RESTful, is used to
prototype the API, where we also delve into simple authentication mechanisms for
stateless systems and even write a few tests along the way. A short detour is made
into the world of Werkzeug, the WSGI toolkit that Flask is built upon, to build a
custom WSGI middleware that allows the seamless handling of URI-based version
numbers for our nascent API.

[ vi ]
Preface

Chapter 6, Hublot – Flask CLI Tools, covers a topic that is often omitted from most web
application framework discussions: command-line tools. The use of Flask-Script is
explained, and several CLI-based tools are created to interact with the data models
of our application. Additionally, we will build our very own custom Flask extension
that wraps an existing Python library to fetch the repository and issue information
from the GitHub API.

Chapter 7, Dinnerly – Recipe Sharing, introduces the somewhat intimidating concept


of the OAuth authorization flow that many large web applications, such as Twitter,
Facebook, and GitHub, implement in order to allow third-party applications to
act on behalf of the account owners without compromising basic account security
credentials. A barebones data model is constructed for a recipe-sharing application
that allows the so-called social sign in and the ability to cross-post the data from our
application to the feeds or streams of the services that a user has connected. Finally,
we will introduce the concept of database migrations using Alembic, which allow
you to synchronize your SQLAlchemy model metadata with the schemas of the
underlying relational database tables in a reliable manner.

What you need for this book


To work through most of the examples in this book, all you need is your favorite text
editor or IDE, access to the Internet (to install the various Flask extensions, not to
mention Flask itself), a relational database (one of SQLite, MySQL, or PostgreSQL),
a browser, and some familiarity with the command line. Care has been taken to
indicate when additional packages or libraries are required to complete the examples
in each chapter.

Who this book is for


This book was created for the new Python developers who wish to dive into the
world of web application development, or for the seasoned Python web application
professional who is interested in learning about Flask and the extension-based
ecosystem behind it. To get the most out of each chapter, you should have a solid
understanding of the Python programming language, a basic knowledge of relational
database systems, and fluency with the command line.

Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.

[ vii ]
Preface

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"This will create a blank app1 environment and activate it. You should see an (app1)
tag in your shell prompt."

A block of code is set as follows:


[default]
<div>{{ form.password.label }}: {{ form.password }}</div>
{% if form.password.errors %}
<ul class="errors">{% for error in form.password.errors %}<li>{{
error }}</li>{% endfor %}</ul>
{% endif %}

<div><input type="submit" value="Sign up!"></div>


</form>

{% endblock %}

When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
from application.users.views import users
app.register_blueprint(users, url_prefix='/users')

from application.posts.views import posts


app.register_blueprint(posts, url_prefix='/posts')

# …

Any command-line input or output is written as follows:


$ source ~/envs/testing/bin/activate
(testing)$ pip uninstall numpy

New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: "Then it
asserts that the Sign up! button text appears in the returned HTML".

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

[ viii ]
Preface

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for us
to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to feedback@packtpub.com,


and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the example code


You can download the example code files for all Packt books you have purchased
from your account at http://www.packtpub.com. If you purchased this book
elsewhere, you can visit http://www.packtpub.com/support and register to have
the files e-mailed directly to you.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do
happen. If you find a mistake in one of our books—maybe a mistake in the text or the
code—we would be grateful if you would report this to us. By doing so, you can save
other readers from frustration and help us improve subsequent versions of this book.
If you find any errata, please report them by visiting http://www.packtpub.com/
submit-errata, selecting your book, clicking on the errata submission form link,
and entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list
of existing errata, under the Errata section of that title. Any existing errata can be
viewed by selecting your title from http://www.packtpub.com/support.

[ ix ]
Preface

Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected pirated


material.

We appreciate your help in protecting our authors, and our ability to bring you
valuable content.

Questions
You can contact us at questions@packtpub.com if you are having a problem with
any aspect of the book, and we will do our best to address it.

[x]
Starting on the Right
Foot – Using Virtualenv
One of the great difficulties in modern software development is that of dependency
management. Generally, a dependency of a software project consists of a library or
component that is required for the project to function correctly. In the case of a Flask
application (and more generally, that of a Python application), most dependencies
are comprised of specially organized and annotated source files. Once created,
these packages of source files may then be included in other projects and so forth.
For some, this chain of dependencies can become an unmanageable mess, where
the slightest alteration to any of the libraries in the chain can cause a cascade of
incompatibilities that would bring further development to a screeching halt. In
the Python world, as you may know already, the fundamental unit of a reusable
set of source files is that of a Python module (a file that contains definitions and
statements). Once you've created a module on your local filesystem and ensured
that it is in your system's PYTHONPATH, including it in a newly created project
is as simple as specifying the import, which is as follows:
import the_custom_module

Where the_custom_module.py is a file that exists somewhere in $PYTHONPATH of


the system executing the program.

The $PYTHONPATH can include paths to the compressed


archives (.zip folders) in addition to the normal file paths.

[1]
Starting on the Right Foot – Using Virtualenv

This is not where the story ends, of course. While modules littering your local
filesystem might be convenient at first, what happens when you want to share some
of the code that you've written for others? Usually, this would entail emailing/
Dropboxing the files in question, however, this is obviously a very cumbersome
and error-prone solution. Thankfully, this is a problem that has been considered
and some progress has been made in alleviating the common issues. The most
significant of these advances is the subject of this chapter, and how the following
techniques for creating reusable, isolated packages of code can be leveraged to ease
the development of a Flask application:

• Python packaging with pip and setuptools


• Encapsulation of virtual environments with virtualenv

The solution presented by the various Python packaging paradigms/libraries is far


from perfect; one sure way to start an argument with a passionate Python developer
is to proclaim that the packaging problem has been solved! We still have a long way to
go for that but headway is being made in incremental steps with improvements to
setuptools and various other libraries used in building, maintaining, and distributing
a reusable Python code.

In this chapter, when we refer to a package, what we will actually be talking about
would be succinctly described as a distribution—a bundle of software to be installed
from a remote source—and not a collection of modules in a folder structure that
utilizes the__init__.py convention in order to delineate the folders containing the
modules that we want to be importable.

Setuptools and pip


When a developer wants to make their code more widely available, one of the first
steps will be to create a setuptools-compatible package.

Most of the distributions of a modern Python version will come with setuptools
already installed. If it is not present on your system of choice, then obtaining it is
relatively simple, with additional instructions available on the official documentation:
wget https://bootstrap.pypa.io/ez_setup.py -O - | python

After setuptools is installed, the basic requirement to create a compatible package is


the creation of a setup.py file at the root of your project. The primary content of this
file should be the invocation of a setup() function with a few mandatory (and many
optional) arguments, as follows:
from setuptools import setup

[2]
Chapter 1

setup(
name="My Great Project",
version="0.0.1",
author="Jane Doe",
author_email="jane@example.com",
description= "A brief summary of the project.",
license="BSD",
keywords="example tutorial flask",
url="http://example.com/my-great-project",
packages=['foobar','tests'],
long_description="A much longer project description.",
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
)

Downloading the example code


You can download the example code files from your
account at http://www.packtpub.com for all
the Packt Publishing books you have purchased. If
you purchased this book elsewhere, you can visit
http://www.packtpub.com/support and
register to have the files e-mailed directly to you.

Once the package has been created, most developers will choose to upload
their newly minted package to PyPI—the official source of nearly all Python
packages—using the built-in tools that are provided by setuptools itself. While the
use of this particular public PyPI repository is not a requirement (it's even possible
to set up your own personal package index), most Python developers will expect to
find their packages here.

This brings us to one more essential piece of the puzzle—the pip Python package
installer. If you have Python 2.7.9 or greater installed, then pip will already be
present. Some distributions might have it preinstalled for you or it might be present
in a system-level package. For a Debian-like distribution of Linux, it may be installed
via the following command:
apt-get install python-pip

[3]
Starting on the Right Foot – Using Virtualenv

Similarly, other Linux-based distributions will have their own recommended


package managers. If you'd rather obtain the source and install it manually, it is a
simple matter of fetching a file and running it using the Python interpreter:
$ curl -o get-pip.py https://bootstrap.pypa.io/get-pip.py
$ python get-pip.py

Pip is a tool for installing Python packages (and is itself a Python package). While it
is not the only player in the game, pip is by far the most widely used.

The predecessor to pip is easy_install, which has largely


been replaced in the Python community by the former. The
easy_install module suffered some relatively major
problems, such as allowing partially completed installations,
the inability to uninstall a package without requiring the user
to manually delete the related .egg files, and console output
that contained the useful success and error messages that
allowed the developer to determine the best course of action in
case something went wrong.

One can invoke pip in the command line to install, say, a scientific computing
package on the local filesystem:
$ pip install numpy

The preceding command will query the default PyPI index for a package named
numpy and download the latest version to a special place in your system, usually /
usr/local/lib/pythonX.Y/site-packages (X and Y are the major/minor versions
of the Python version that pip points to). This operation may require root privileges
and would thus require sudo or similar actions to allow it to be completed.

One of the many benefits of virtual environments, which we will explore shortly,
is that they generally avoid the privilege escalation requirement that can plague
system-level changes to installed packages.

Once this operation is completed successfully, you now have the ability to import
the numpy package into new modules and use any and all of the functionalities that
it exposes:
import numpy

x = numpy.array([1, 2, 3])
sum = numpy.sum(x)
print sum # prints 6

[4]
Chapter 1

Once we have this package (or any other, for that matter) installed, there's nothing
stopping us from fetching additional packages in the usual way. Moreover, we can
install multiple packages at the same time by providing their names as additional
arguments to the install command:
$ pip install scipy pandas # etc.

Avoiding dependency hell, the Python way


New developers might be tempted to install every interesting package that they
come across. In doing so, they might realize that this quickly degrades into a
Kafkaesque situation where previously installed packages may cease to function and
newly installed packages may behave unpredictably, if they manage to get installed
successfully at all. The problem with the preceding approach, as some of you may
have guessed, is that of conflicting package dependencies. Say for example, we have
package A installed; it depends on version 1 of package Q and version 1 of package
R. Package B depends on version 2 of package R (where versions 1 and 2 are not API-
compatible). Pip will happily install package B for you, which will upgrade package
R to version 2. This will, at best, make package A completely unusable or, at worst,
make it behave in undocumented and unpredictable ways.

The Python ecosystem has come up with a solution to the basic issues that arise from
what is colloquially referred to as dependency hell. While far from perfect, it allows
developers to sidestep many of the simplest package version dependency conflicts
that can arise in web application development.

The virtualenv tool, of which a similar implementation is now a default module in


Python 3.3 and named venv, is essential to ensure that you minimize your chances
of ending up in dependency hell. The following quote is from the introduction in the
official documentation for virtualenv:

It creates an environment that has its own installation directories, that doesn't
share libraries with other virtualenv environments (and optionally doesn't access
the globally installed libraries either).

[5]
Starting on the Right Foot – Using Virtualenv

More concisely, virtualenv allows you to create isolated environments for each one
of your Python applications (or any Python code).

The virtualenv tool does not, however, help you to


manage the dependencies of the Python C-based extensions.
For example, if you install the lxml package from pip,
it will require that you have the correct libxml2 and
libxslt system libraries and headers (which it will link
against). The virtualenv tool will not help you isolate
these system-level libraries.

Working with virtualenv


First, we need to make sure that we have the virtualenv tool installed in our local
system. This is a simple matter of fetching it from the PyPI repository:
$ pip install virtualenv

For obvious reasons, this package should be installed outside


any virtual environments that may already exist.

Creating a new virtual environment


Creating a new virtual environment is straightforward. The following command will
create a new folder at the specified path that will contain the necessary structure and
scripts, including a full copy of your default Python binary:
$ virtualenv <path/to/env/directory>

If we want to create an environment that lives at ~/envs/testing, we will first


ensure that the parent directory exists and then invoke the following command:
$ mkdir -p ~/envs
$ virtualenv ~/envs/testing

In Python 3.3+, a mostly API-compatible version of the virtualenv tool was added
to the default language packages. The name of the module is venv, however, the
name of the script that allows you to create a virtual environment is pyvenv and can
be invoked in a similar way as the previously discussed virtualenv tool, as follows:
$ mkdir -p ~/envs
$ pyvenv ~/envs/testing

[6]
Another Random Document on
Scribd Without Any Related Topics
‘Free Labour’ (i. e. dared to prohibit soul-murder on the part of the
rich, and self-slaughter on that of the poor!), or any dictum of our
grave law authorities from Fortescue—to Eldon: for from the
borough of Hell I wish to have no representatives.” Henry Crabb
Robinson’s Diary, ii. 93-95.
[167] James Maitland, 1759-1839, eighth Earl of Lauderdale,
belonged to the party of Charles James Fox, and, like Coleridge,
opposed the first war with France, which began in 1793. In the
ministry of “All the Talents” he held the Great Seal of Scotland.
Coleridge calls him plebeian because he inherited the peerage from
a remote connection. He was the author of several treatises on
finance and political economy.
[168] It was, I have been told by an eyewitness, Coleridge’s habit to
take a pinch of snuff, and whilst he was talking to rub it between his
fingers. He wasted so much snuff in the process that the maid
servant had directions to sweep up these literary remains and
replace them in the canister.
[169] A pet name for the Gillmans’ younger son, Henry.
[170] Coleridge was fond of quoting these lines as applicable to
himself.
[171] Washington Allston.
[172] Charles Robert Leslie, historical painter, 1794-1859, was born
of American parents, but studied art in London under Washington
Allston. A pencil sketch, for which Coleridge sat to him in 1820, is in
my possession. Mr. Hamo Thornycroft, R. A., after a careful
inspection of other portraits and engravings of S. T. Coleridge,
modelled the bust which now (thanks to American generosity) finds
its place in Poets’ Corner, mainly in accordance with this sketch.
[173] Letters, Conversations, and Recollections of S. T. Coleridge,
London, 1836, i. 1-3.
[174] The Prospectus of the Lectures on the History of Philosophy
was printed in Allsop’s Letters, etc., as Letter xliv., November 26,
1818, but the announcement of the time and place has been
omitted. A very rare copy of the original prospectus, which has been
placed in my hands by Mrs. Henry Watson, gives the following
details:—
“This course will be comprised in Fourteen Lectures, to commence
on Monday evening, December 7, 1818, at eight o’clock, at the
Crown and Anchor, Strand; and be continued on the following
Mondays, with the intermission of Christmas week—Double Tickets,
admitting a Lady and Gentleman, Three Guineas. Single Tickets, Two
Guineas. Admission to a Single Lecture, Five Shillings. An Historical
and Chronological Guide to the course will be printed.”
A reporter was hired at the expense of Hookham Frere to take down
the lectures in shorthand. A transcript, which I possess, contains
numerous errors and omissions, but is interesting as affording proof
of the conversational style of Coleridge’s lectures. See, for further
account of Lectures of 1819, Samuel Taylor Coleridge, a Narrative,
by J. Dykes Campbell, pp. 238, 239.
[175] Thomas Phillips, R. A., 1770-1845, painted two portraits of
Coleridge, one of which is in the possession of Mr. John Murray, and
was engraved as the frontispiece of the first volume of the Table
Talk; and the other in that of Mr. William Rennell Coleridge, of
Salston, Ottery St. Mary. The late Lord Chief Justice used to say that
the Salston picture was “the best presentation of the outward man.”
No doubt it recalled his great-uncle as he remembered him. It
certainly bears a close resemblance to the portraits of Coleridge’s
brothers, Edward and George, and of other members of the family.
[176] My impression is that this letter was written to Mrs. Aders, the
beautiful and accomplished daughter of the engraver Raphael Smith,
but the address is wanting and I cannot speak with any certainty.
[177] Compare lines 16-20 of The Two Founts:—
“As on the driving cloud the shiny bow,
That gracious thing made up of tears and light.”

The poem as a whole was composed in 1826, and, as I am assured


by Mrs. Henry Watson (on the authority of her grandmother, Mrs.
Gillman), addressed to Mrs. Aders; but the fifth and a preceding
stanza, which Coleridge marked for interpolation, in an annotated
copy of Poetical Works, 1828 (kindly lent me by Mrs. Watson), must
have been written before that date, and were, as I gather from an
insertion in a note-book, originally addressed to Mrs. Gillman.
Poetical Works, p. 196. See, too, for unprinted stanza, Ibid. Editor’s
Note, p. 642.
[178] “To Two Sisters.” Poetical Works, p. 179.
[179] The so-called “Manchester Massacre,” nicknamed Peterloo,
took place August 16, 1819. Towards the middle of October
dangerous riots broke out at North Shields. Cries of “Blood for
blood,” “Manchester over again,” were heard in the streets, and “so
daring have the mob been that they actually threatened to burn or
destroy the ships of war.” Annual Register, October 15-23, 1819.
[180] “Fears in Solitude.” Poetical Works, p. 127.
[181] Mrs. Gillman’s sister.
[182] A collection of casts of antique gems, once, no doubt, the
property of S. T. C., is now in the possession of Alexander Gillman,
Esq., of Sussex Square, Brighton.
[183] Edward Dubois, satirist, 1775-1850, was the author of The
Wreath, a Translation of Boccaccio’s Decameron, 1804, and other
works besides those mentioned in the text. Biographical Dictionary.
[184] A late note-book of the Highgate period contains the following
doggerel:—
To the most veracious Anecdotist and
Small-Talk Man, Thomas Hill, Esq.

Tom Hill who laughs at cares and woes,


As nanci—nili—pili—
What is he like as I suppose?
Why to be sure, a Rose, a Rose.
At least no soul that Tom Hill knows,
Could e’er recall a Li-ly.
S. T. C.

“The first time,” writes Miss Stuart, in a personal remembrance of


Coleridge, headed “A Farewell, 1834,” “I dined in company at my
father’s table, I sat between Coleridge and Mr. Hill (known as ‘Little
Tommy Hill’) of the Adelphi, and Ezekiel then formed the theme of
Coleridge’s eloquence. I well remember his citing the chapter of the
Dead Bones, and his sepulchral voice as he asked, ‘Can these bones
live?’ Then, his observation that nothing in the range of human
thought was more sublime than Ezekiel’s reply, ‘Lord, thou knowest,’
in deepest humility, not presuming to doubt the omnipotence of the
Most High.” Letters from the Lake Poets, p. 322. See, too, Letters
from Hill to Stuart, Ibid. p. 435.
[185] William Elford Leach, 1790-1836, a physician and naturalist,
was at this time Curator of the Natural History Department at the
British Museum.
By Lawrencian, Coleridge means a disciple of the eminent surgeon
William Lawrence, whose “Lectures on the Physiology, Zoölogy, and
Natural History of Man,” which were delivered in 1816, are alluded to
more than once in his “Theory of Life.” “Theory of Life” in
Miscellanies, Æsthetic and Literary, Bohn’s Standard Library, pp. 377,
385.
[186] Included in the Omniana of 1809-1816. Table Talk, etc., Bell &
Sons, 1884, p. 400.
[187] Compare a letter of Coleridge to Allsop, dated October 8,
1822, in which he details “the four griping and grasping sorrows,
each of which seemed to have my very heart in its hands,
compressing or wringing.”
It was the publication of this particular letter, with its thinly-veiled
allusions to Wordsworth, Southey, and to Coleridge’s sons, which not
only excited indignation against Allsop, but moved Southey to write
a letter to Cottle. Letters, Conversation, etc., 1836, ii. 140-146.
[188] Compare “The Wanderer’s Farewell to Two Sisters” (Mrs.
Morgan and Miss Brent), 1807. Miss Brent made her home with her
married sister, Mrs. J. J. Morgan, and during the years 1810-1815,
when Coleridge lived under the Morgans’ roof at Hammersmith, in
London, and in the West of England, he received from these ladies
the most affectionate care and attention, both in sickness and in
health. Poetical Works, pp. 179, 180.
[189] The Reverend Edward Coleridge, 1800-1883, the sixth and
youngest son of Colonel James Coleridge, was for many years a
Master and afterwards a Fellow of Eton. He also held the College
living of Mapledurham near Reading. He corresponded with his
uncle, who was greatly attached to him, on philosophical and
theological questions. It was to him that the “Confessions of an
Enquiring Spirit” were originally addressed in the form of letters.
[190] Colonel Coleridge’s only daughter, Frances Duke, was
afterwards married to the Honourable Mr. Justice Patteson, a Judge
of the Queen’s Bench.
[191]

Like those trim skiffs, unknown of yore


On winding lake, or rivers wide,
That ask no aid of sail or oar,
That fear no spite of wind or tide.
“Youth and Age,” ll. 12-15. Poetical Works, p. 191. A MS. copy of
“Youth and Age” in my possession, of which the probable date is
1822, reads “boats” for “skiffs.”
[192] Sir Alexander Johnston, 1775-1849, a learned orientalist. He
was Advocate General (afterwards Chief Justice) of Ceylon, and had
much to do with the reorganisation of the constitution of the island.
He was one of the founders of the Royal Asiatic Society. Dict. of Nat.
Biog. art. “Johnston, Sir Alexander.”
[193] Gabriele Rossetti, 1783-1854, the father of Dante G. Rossetti,
etc., first visited England as a political exile in 1824. In 1830 he was
appointed Professor of the Italian language at King’s College. He is
best known as a commentator on Dante. He presented Coleridge
with a copy of his work, Dello Spirito Antipapale che Produsse la
Riforma, and some of his verses in MS., which are in my possession.
[194] From the letter of Wordsworth to Lord Lonsdale, of February
5, 1819, it is plain that the translation of three books of the Æneid
had been already completed at that date. Another letter written five
years later, November 3, 1824, implies that the work had been put
aside, and, after a long interval, reattempted. In the mean time a
letter of Coleridge to Mrs. Allsop, of April 8, 1824, tells us that the
three books had been sent to Coleridge and must have remained in
his possession for some time. The MS. of this translation appears to
have been lost, but “one of the books,” Professor Knight tells us, was
printed in the Philological Museum, at Cambridge, in 1832. Life of W.
Wordsworth, ii. 296-303.
[195] Coleridge was at this time (1824) engaged in making a
selection of choice passages from the works of Archbishop Leighton,
which, together with his own comment and corollaries, were
published as Aids to Reflection, in 1825. See Letter CCXXX.
[196] Conversations of Lord Byron, etc., by Captain Medwin.
[197] The frontispiece of the second volume of the Antiquary
represents Dr. Dousterswivel digging for treasure in Misticot’s grave.
The resemblance to Coleridge is, perhaps, not wholly imaginary.
[198] John Taylor Coleridge was editor of the Quarterly Review for
one year, 1825-1826. Southey’s Life and Correspondence, v. 194,
201, 204, 239, etc.; Letters of Robert Southey, iii. 455, 473, 511,
514, etc.
[199] Henry Hart Milman, 1791-1868, afterwards celebrated as
historian and divine (Dean of St. Paul’s, 1849), was, at this time,
distinguished chiefly as a poet. His Fall of Jerusalem was published
in 1820. He was a contributor to the Quarterly Review.
[200] Afterward the wife of Sir George Beaumont, the artist’s son
and successor in the baronetcy.
[201] Almost the same sentence with regard to his address as Royal
Associate occurs in a letter to his nephew, John Taylor Coleridge, of
May 20, 1825. The “Essay on the Prometheus of Æschylus,” which
was printed in Literary Remains, was republished in Coleridge’s
Works, Harper & Brothers, 1853, iv. 344-365. See, also, Brandl’s Life
of Coleridge, p. 361.
[202] The portrait of William Hart Coleridge, Bishop of Barbadoes
and the Leeward Islands, by Thomas Phillips, R. A., is now in the
Hall of Christ Church, Oxford.
[203] A sprig of this myrtle (or was it a sprig of myrtle in a
nosegay?) grew into a plant. At some time after Coleridge’s death it
passed into the hands of the late S. C. Hall, who presented it to the
late Lord Coleridge. It now flourishes, in strong old age, in a
protected nook outside the library at Heath’s Court, Ottery St. Mary.
[204] George Dyer, 1755-1841, best remembered as the author of
The History of the University of Cambridge, and a companion work
on The Privileges of the University of Cambridge, began life as a
Baptist minister, but settled in London as a man of letters in 1792.
As a “brother-Grecian” he was introduced to Coleridge in 1794, in
the early days of pantisocracy, and probably through him became
intimate with Lamb and Southey. He contributed “The Show, an
English Eclogue,” and other poems, to the Annual Anthology of 1799
and 1800. His poetry was a constant source of amused delight to
Lamb and Coleridge. A pencil sketch of Dyer by Matilda Betham is in
the British Museum. Letters of Charles Lamb, i. 125-128 et passim;
Southey’s Life and Correspondence, i. 218 et passim.
[205] George Cattermole, 1800-1868, to whose “peculiar gifts and
powerful genius” Mr. Ruskin has borne testimony, was eminent as an
architectural draughtsman and water-colour painter. With his
marvellous illustrations of “Master Humphrey’s Clock” all the world is
familiar. Dict. of Nat. Biog. art. “George Cattermole.” His brother
Richard was Secretary of the Royal Society of Literature, of which
Coleridge was appointed a Royal Associate in 1825. Copies of this
and of other letters from Coleridge to Cattermole were kindly placed
at my disposal by Mr. James M. Menzies of 24, Carlton Hill, St. John’s
Wood.
[206] Harriet Macklin, Coleridge’s faithful attendant for the last
seven or eight years of his life. On his deathbed he left a solemn
request in writing that his family should make a due
acknowledgment of her services. It was to her that Lamb, when he
visited Highgate after Coleridge’s death, made a present of five
guineas.
[207] Dr. Chalmers represented the visit as having lasted three
hours, and that during that “stricken” period he only got occasional
glimpses of what the prophet “would be at.” His little daughter,
however, was so moved by the “mellifluous flow of discourse” that,
when “the music ceased, her overwrought feelings found relief in
tears.” Samuel Taylor Coleridge, a Narrative, by J. Dykes Campbell,
1894, p. 260, footnote.
[208] A disciple and amanuensis, to whom, it is believed, he dictated
two quarto volumes on “The History of Logic” and “The Elements of
Logic,” which originally belonged to Joseph Henry Green, and are
now in the possession of Mr. C. A. Ward of Chingford Hatch. Samuel
Taylor Coleridge, a Narrative, by J. Dykes Campbell, 1894, pp. 250,
251; Athenæum, July 1, 1893, art. “Coleridge’s Logic.”
[209] Henry Nelson Coleridge, 1798-1843, was the fifth son of
Colonel James Coleridge of Heath’s Court, Ottery St. Mary. His
marriage with the poet’s daughter took place on September 3, 1829.
He was the author of Six Months in the West Indies, 1825, and an
Introduction to the Study of the Greek Poets, 1830. He practised as
a chancery barrister and won distinction in his profession. The later
years of his life were devoted to the reëditing of his uncle’s
published works, and to throwing into a connected shape the literary
as distinguished from the philosophical section of his unpublished
MSS. The Table Talk, the best known of Coleridge’s prose works,
appeared in 1835. Four volumes of Literary Remains, including the
“Lectures on Shakespeare and other Dramatists,” were issued 1836-
1839. The third edition of The Friend, 1837, the Confessions of an
Inquiring Spirit, 1840, and the fifth edition of Aids to Reflection,
1843, followed in succession. The second edition of the Biographia
Literaria, which “he had prepared in part,” was published by his
widow in 1847.
A close study of the original documents which were at my uncle’s
disposal enables me to bear testimony to his editorial skill, to his
insight, his unwearied industry, his faithfulness. Of the charm of his
appearance, and the brilliance of his conversation, I have heard
those who knew him speak with enthusiasm. He died, from an
affection of the spine, in January, 1843.
[210] This lady was for many years governess in the family of Dr.
Crompton of Eaton Hall, near Liverpool. Memoirs and Letters of Sara
Coleridge, London, 1873, i. 8 109-116.
[211] Sir William Rowan Hamilton, 1805-1865, the great
mathematician, was at this time Professor of Astronomy at Dublin.
He was afterwards appointed Astronomer Royal of Ireland. He was,
as is well known, a man of culture and a poet; and it was partly to
ascertain his views on scientific questions, and partly to interest him
in his verses, that Hamilton was anxious to be made known to
Coleridge. He had begun a correspondence with Wordsworth as
early as 1827, and Wordsworth, on the occasion of his tour in
Ireland in 1829, visited Hamilton at the Observatory. Miss Lawrence’s
introduction led to an interview, but a letter which Hamilton wrote to
Coleridge in the spring of 1832 remained unanswered. In a second
letter, dated February 3, 1833, he speaks of a “Lecture on
Astronomy” which he forwards for Coleridge’s acceptance, and also
of “some love-poems to a lady to whom I am shortly to be married.”
The love-poems, eight sonnets, which are smoothly turned and are
charming enough, have survived, but the lecture has disappeared.
The interest of this remarkable letter lies in the double appeal to
Coleridge as a scientific authority and a literary critic. Coleridge’s
reply, if reply there was, would be read with peculiar interest. In a
letter to Mr. Aubrey de Vere, May 28, 1832, he thus records his
impressions of Coleridge: “Coleridge is rather to be considered as a
Faculty than as a Mind; and I did so consider him. I seemed rather
to listen to an oracular voice, to be circumfused in a Divine ὀμφὴ,
than—as in the presence of Wordsworth—to hold commune with an
exalted man.” Life of W. Wordsworth, iii. 157-174, 210, etc.
[212] He is referring to a final effort to give up the use of opium
altogether. It is needless to say that, after a trial of some duration,
the attempt was found to be impracticable. It has been strenuously
denied, as though it had been falsely asserted, that under the
Gillmans’ care Coleridge overcame the habit of taking laudanum in
more or less unusual quantities. Gillman, while he maintains that his
patient in the use of narcotics satisfied the claims of duty, makes no
such statement; and the confessions or outpourings from the later
note-books which are included in the Life point to a different
conclusion. That after his settlement at Highgate, in 1816, the habit
was regulated and brought under control, and that this change for
the better was due to the Gillmans’ care and to his own ever-
renewed efforts to be free, none can gainsay. There was a moral
struggle, and into that “sore agony” it would be presumption to
intrude; but to a moral victory Coleridge laid no claim. And, at the
last, it was “mercy,” not “praise,” for which he pleaded.
[213] The notes on Asgill’s Treatises were printed in the Literary
Remains, Coleridge’s Works, 1853, v. 545-550, and in Notes
Theological and Political, London, 1853, pp. 103-109.
[214] Admirers of Dr. Magee, 1765-1831, who was successively
Bishop of Raphoe, 1819, and Archbishop of Dublin, 1822. He was
the author of Discourses on the Scriptural Doctrines of the
Atonement. He was grandfather of the late Archbishop of York,
better known as Bishop of Peterborough.
[215] I am indebted to Mr. John Henry Steinmetz, a younger brother
of Coleridge’s friend and ardent disciple, for a copy of this letter. It
was addressed, he informs me, to his brother’s friend, the late Mr.
John Peirse Kennard, of Hordle Cliff, Hants, father of the late Sir
John Coleridge Kennard, Bart., M. P. for Salisbury, and of Mr. Adam
Steinmetz Kennard, of Crawley Court Hants, at whose baptism the
poet was present, and to whom he addressed the well-known letter
(Letter CCLX.), “To my Godchild, Adam Steinmetz Kennard.”
[216] See Table Talk, August 14, 1832.
[217] So, too, of Keats. See Table Talk, etc., Bell & Sons. 1884, Talk
for August 14, 1832. Table p. 179.
[218] “The sot would reject the poisoned cup, yet the trembling-
hand with which he raises his daily or hourly draught to his lips has
not left him ignorant that this, too, is altogether a poison.” The
Friend, Essay xiv.; Coleridge’s Works, ii. 100.
[219] The motto of this theme, (January 19, 1794), of which I
possess a transcript in Coleridge’s handwriting, or perhaps the
original copy, is—
Quid fas
Atque nefas tandem incipiunt sentire peractis
Criminibus.

The theme was selected by Boyer for insertion in his Liber Aureus of
school exercises in prose and verse, now in the possession of James
Boyer, Esq., of the Coopers’ Company. The sentence to which
Coleridge alludes ran thus: “As if we were in some great sea-vortex,
every moment we perceive our ruin more clearly, every moment we
are impelled towards it with greater force.”
The essay was printed for the first time in the Illustrated London
News, April 1, 1893.
[220] This letter, which is addressed in Coleridge’s handwriting, “Mrs.
Aders, favoured by H. Gillman,” and endorsed in pencil, “S. T. C.’s
letter for Miss Denman,” refers to the new edition of his poetical
works which Coleridge had begun to see through the press.
Apparently he had intended that the “Epitaph” should be inscribed
on the outline of a headstone, and that this should illustrate, by way
of vignette, the last page of the volume.
[221] Of the exact date of Sterling’s first visit to Highgate there is no
record. It may, however, be taken for granted that his intimacy with
Coleridge began in 1828, when he was in his twenty-third year, and
continued until the autumn of 1833,—perhaps lasted until
Coleridge’s death. Unlike Maurice, and Maurice’s disciple, Kingsley,
Sterling outlived his early enthusiasm for Coleridge and his
acceptance of his teaching. It may be said, indeed, that, thanks to
the genius of his second master, Carlyle, he suggests both the
reaction against and the rejection of Coleridge. Of that rejection
Carlyle, in his Life of Sterling, made himself the mouth-piece. It is
idle to say of that marvellous but disillusioning presentment that it is
untruthful, or exaggerated, or unkind. It is a sketch from the life,
and who can doubt that it is lifelike? But other eyes saw another
Coleridge who held them entranced. To them he was the seer of the
vision beautiful, the “priest of invisible rites behind the veil of the
senses,” and to their ears his voice was of one who brought good
tidings of reconciliation and assurance. Many, too, who cared for
none of these things, were attracted to the man. Like the wedding-
guest in the Ancient Mariner, they stood still. No other, they felt, was
so wise, so loveable. They, too, were eye-witnesses, and their
portraiture has not been outpainted by Carlyle. Apart from any
expression of opinion, it is worth while to note that Carlyle saw
Coleridge for the last time in the spring of 1825, and that the Life of
Sterling was composed more than a quarter of a century later. His
opinion of the man had, indeed, changed but little, as the notes and
letters of 1824-25 clearly testify, but his criticism of the writer was
far less appreciative than it had been in Coleridge’s lifetime. The
following extracts from a letter of Sterling to Gillman, dated
“Hurstmonceaux, October 9, 1834,” are evidence that his feelings
towards Coleridge were at that time those of a reverent disciple:—
“The Inscription [in Highgate Church] will forever be enough to put
to shame the heartless vanity of a thousand such writers as the
Opium Eater. As a portrait, or even as a hint for one, his papers
seem to me worse than useless.
“If it is possible, I will certainly go to Highgate, and wait on Mrs.
Gillman and yourself. I have travelled the road thither with keen and
buoyant expectation, and returned with high and animating
remembrances oftener than any other in England. Hereafter, too, it
will not have lost its charm. There is not only all this world of
recollection, but the dwelling of those who best knew and best loved
his work.” Life of Sterling, 1871, pp. 46-54; Samuel Taylor Coleridge,
a Narrative, by J. Dykes Campbell, pp. 259-261; British Museum,
add. MS. 34,225, f. 194.
[222] The following unpublished lines were addressed by Coleridge
to this young lady, a neighbour, I presume, and friend of the
Gillmans. They must be among the last he ever wrote:—
ELISA.
Translation of Claudian.

Dulcia dona mihi tu mittis semper Elisa!


Sweet gifts to me thou sendest always, Elisa!

Et quicquid mittis, Thura putare decet.


And whatever thou sendest, Sabean odours to think it it behoves
me.

The whole adapted from an epigram of Claudius by substituting


Thura for mella, the original distich being in return for a Present of
Honey.

Imitation.
Sweet Gift! and always doth Eliza send
Sweet Gifts and full of fragrance to her Friend.
Enough for Him to know they come from Her,
Whate’er she sends is Frankincense and Myrrh.

Another on the same subject by S. T. C. himself:—

Semper, Eliza! mihi tu suaveolentia donas:


Nam quicquid donas, te redolere puto.

Literal translation: Always, Eliza! to me things of sweet odour thou


presentest. For whatever thou presentest, I fancy redolent of thyself.

Whate’er thou giv’st, it still is sweet to me,


For still I find it redolent of thee!

[223] Philip Van Artevelde.


[224] Sir Henry Taylor.
*** END OF THE PROJECT GUTENBERG EBOOK LETTERS OF
SAMUEL TAYLOR COLERIDGE, VOL. 2 (OF 2) ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like