ÿØÿà JFIF ÿþ >CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality
ÿÛ C
Server IP : 172.67.171.101 / Your IP : 216.73.216.123 Web Server : Apache System : Linux server1.morocco-tours.com 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : zagoradraa ( 1005) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/python-docs-2.7.5/html/library/ |
Upload File : |
| Current File : /usr/share/doc/python-docs-2.7.5/html/library/sqlite3.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>11.13. sqlite3 — DB-API 2.0 interface for SQLite databases — Python 2.7.5 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2.7.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Python 2.7.5 documentation"
href="../_static/opensearch.xml"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="copyright" title="Copyright" href="../copyright.html" />
<link rel="top" title="Python 2.7.5 documentation" href="../index.html" />
<link rel="up" title="11. Data Persistence" href="persistence.html" />
<link rel="next" title="12. Data Compression and Archiving" href="archiving.html" />
<link rel="prev" title="11.12. dumbdbm — Portable DBM implementation" href="dumbdbm.html" />
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
<script type="text/javascript" src="../_static/copybutton.js"></script>
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="archiving.html" title="12. Data Compression and Archiving"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="dumbdbm.html" title="11.12. dumbdbm — Portable DBM implementation"
accesskey="P">previous</a> |</li>
<li><img src="../_static/py.png" alt=""
style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="http://www.python.org/">Python</a> »</li>
<li>
<a href="../index.html">Python 2.7.5 documentation</a> »
</li>
<li><a href="index.html" >The Python Standard Library</a> »</li>
<li><a href="persistence.html" accesskey="U">11. Data Persistence</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-sqlite3">
<span id="sqlite3-db-api-2-0-interface-for-sqlite-databases"></span><h1>11.13. <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> — DB-API 2.0 interface for SQLite databases<a class="headerlink" href="#module-sqlite3" title="Permalink to this headline">¶</a></h1>
<p class="versionadded">
<span class="versionmodified">New in version 2.5.</span></p>
<p>SQLite is a C library that provides a lightweight disk-based database that
doesn’t require a separate server process and allows accessing the database
using a nonstandard variant of the SQL query language. Some applications can use
SQLite for internal data storage. It’s also possible to prototype an
application using SQLite and then port the code to a larger database such as
PostgreSQL or Oracle.</p>
<p>The sqlite3 module was written by Gerhard Häring. It provides a SQL interface
compliant with the DB-API 2.0 specification described by <span class="target" id="index-0"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-0249"><strong>PEP 249</strong></a>.</p>
<p>To use the module, you must first create a <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> object that
represents the database. Here the data will be stored in the
<tt class="file docutils literal"><span class="pre">example.db</span></tt> file:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">conn</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'example.db'</span><span class="p">)</span>
</pre></div>
</div>
<p>You can also supply the special name <tt class="docutils literal"><span class="pre">:memory:</span></tt> to create a database in RAM.</p>
<p>Once you have a <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a>, you can create a <a class="reference internal" href="#sqlite3.Cursor" title="sqlite3.Cursor"><tt class="xref py py-class docutils literal"><span class="pre">Cursor</span></tt></a> object
and call its <a class="reference internal" href="#sqlite3.Cursor.execute" title="sqlite3.Cursor.execute"><tt class="xref py py-meth docutils literal"><span class="pre">execute()</span></tt></a> method to perform SQL commands:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">c</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="c"># Create table</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'''CREATE TABLE stocks</span>
<span class="s"> (date text, trans text, symbol text, qty real, price real)'''</span><span class="p">)</span>
<span class="c"># Insert a row of data</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"INSERT INTO stocks VALUES ('2006-01-05','BUY','RHAT',100,35.14)"</span><span class="p">)</span>
<span class="c"># Save (commit) the changes</span>
<span class="n">conn</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span>
<span class="c"># We can also close the connection if we are done with it.</span>
<span class="c"># Just be sure any changes have been committed or they will be lost.</span>
<span class="n">conn</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
<p>The data you’ve saved is persistent and is available in subsequent sessions:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">conn</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'example.db'</span><span class="p">)</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
</pre></div>
</div>
<p>Usually your SQL operations will need to use values from Python variables. You
shouldn’t assemble your query using Python’s string operations because doing so
is insecure; it makes your program vulnerable to an SQL injection attack
(see <a class="reference external" href="http://xkcd.com/327/">http://xkcd.com/327/</a> for humorous example of what can go wrong).</p>
<p>Instead, use the DB-API’s parameter substitution. Put <tt class="docutils literal"><span class="pre">?</span></tt> as a placeholder
wherever you want to use a value, and then provide a tuple of values as the
second argument to the cursor’s <a class="reference internal" href="#sqlite3.Cursor.execute" title="sqlite3.Cursor.execute"><tt class="xref py py-meth docutils literal"><span class="pre">execute()</span></tt></a> method. (Other database
modules may use a different placeholder, such as <tt class="docutils literal"><span class="pre">%s</span></tt> or <tt class="docutils literal"><span class="pre">:1</span></tt>.) For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Never do this -- insecure!</span>
<span class="n">symbol</span> <span class="o">=</span> <span class="s">'RHAT'</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"SELECT * FROM stocks WHERE symbol = '</span><span class="si">%s</span><span class="s">'"</span> <span class="o">%</span> <span class="n">symbol</span><span class="p">)</span>
<span class="c"># Do this instead</span>
<span class="n">t</span> <span class="o">=</span> <span class="p">(</span><span class="s">'RHAT'</span><span class="p">,)</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'SELECT * FROM stocks WHERE symbol=?'</span><span class="p">,</span> <span class="n">t</span><span class="p">)</span>
<span class="k">print</span> <span class="n">c</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="c"># Larger example that inserts many records at a time</span>
<span class="n">purchases</span> <span class="o">=</span> <span class="p">[(</span><span class="s">'2006-03-28'</span><span class="p">,</span> <span class="s">'BUY'</span><span class="p">,</span> <span class="s">'IBM'</span><span class="p">,</span> <span class="mi">1000</span><span class="p">,</span> <span class="mf">45.00</span><span class="p">),</span>
<span class="p">(</span><span class="s">'2006-04-05'</span><span class="p">,</span> <span class="s">'BUY'</span><span class="p">,</span> <span class="s">'MSFT'</span><span class="p">,</span> <span class="mi">1000</span><span class="p">,</span> <span class="mf">72.00</span><span class="p">),</span>
<span class="p">(</span><span class="s">'2006-04-06'</span><span class="p">,</span> <span class="s">'SELL'</span><span class="p">,</span> <span class="s">'IBM'</span><span class="p">,</span> <span class="mi">500</span><span class="p">,</span> <span class="mf">53.00</span><span class="p">),</span>
<span class="p">]</span>
<span class="n">c</span><span class="o">.</span><span class="n">executemany</span><span class="p">(</span><span class="s">'INSERT INTO stocks VALUES (?,?,?,?,?)'</span><span class="p">,</span> <span class="n">purchases</span><span class="p">)</span>
</pre></div>
</div>
<p>To retrieve data after executing a SELECT statement, you can either treat the
cursor as an <a class="reference internal" href="../glossary.html#term-iterator"><em class="xref std std-term">iterator</em></a>, call the cursor’s <a class="reference internal" href="#sqlite3.Cursor.fetchone" title="sqlite3.Cursor.fetchone"><tt class="xref py py-meth docutils literal"><span class="pre">fetchone()</span></tt></a> method to
retrieve a single matching row, or call <a class="reference internal" href="#sqlite3.Cursor.fetchall" title="sqlite3.Cursor.fetchall"><tt class="xref py py-meth docutils literal"><span class="pre">fetchall()</span></tt></a> to get a list of the
matching rows.</p>
<p>This example uses the iterator form:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'SELECT * FROM stocks ORDER BY price'</span><span class="p">):</span>
<span class="go"> print row</span>
<span class="go">(u'2006-01-05', u'BUY', u'RHAT', 100, 35.14)</span>
<span class="go">(u'2006-03-28', u'BUY', u'IBM', 1000, 45.0)</span>
<span class="go">(u'2006-04-06', u'SELL', u'IBM', 500, 53.0)</span>
<span class="go">(u'2006-04-05', u'BUY', u'MSFT', 1000, 72.0)</span>
</pre></div>
</div>
<div class="admonition-see-also admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt><a class="reference external" href="http://code.google.com/p/pysqlite/">http://code.google.com/p/pysqlite/</a></dt>
<dd>The pysqlite web page – sqlite3 is developed externally under the name
“pysqlite”.</dd>
<dt><a class="reference external" href="http://www.sqlite.org">http://www.sqlite.org</a></dt>
<dd>The SQLite web page; the documentation describes the syntax and the
available data types for the supported SQL dialect.</dd>
<dt><a class="reference external" href="http://www.w3schools.com/sql/">http://www.w3schools.com/sql/</a></dt>
<dd>Tutorial, reference and examples for learning SQL syntax.</dd>
<dt><span class="target" id="index-1"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-0249"><strong>PEP 249</strong></a> - Database API Specification 2.0</dt>
<dd>PEP written by Marc-André Lemburg.</dd>
</dl>
</div>
<div class="section" id="module-functions-and-constants">
<span id="sqlite3-module-contents"></span><h2>11.13.1. Module functions and constants<a class="headerlink" href="#module-functions-and-constants" title="Permalink to this headline">¶</a></h2>
<dl class="data">
<dt id="sqlite3.version">
<tt class="descclassname">sqlite3.</tt><tt class="descname">version</tt><a class="headerlink" href="#sqlite3.version" title="Permalink to this definition">¶</a></dt>
<dd><p>The version number of this module, as a string. This is not the version of
the SQLite library.</p>
</dd></dl>
<dl class="data">
<dt id="sqlite3.version_info">
<tt class="descclassname">sqlite3.</tt><tt class="descname">version_info</tt><a class="headerlink" href="#sqlite3.version_info" title="Permalink to this definition">¶</a></dt>
<dd><p>The version number of this module, as a tuple of integers. This is not the
version of the SQLite library.</p>
</dd></dl>
<dl class="data">
<dt id="sqlite3.sqlite_version">
<tt class="descclassname">sqlite3.</tt><tt class="descname">sqlite_version</tt><a class="headerlink" href="#sqlite3.sqlite_version" title="Permalink to this definition">¶</a></dt>
<dd><p>The version number of the run-time SQLite library, as a string.</p>
</dd></dl>
<dl class="data">
<dt id="sqlite3.sqlite_version_info">
<tt class="descclassname">sqlite3.</tt><tt class="descname">sqlite_version_info</tt><a class="headerlink" href="#sqlite3.sqlite_version_info" title="Permalink to this definition">¶</a></dt>
<dd><p>The version number of the run-time SQLite library, as a tuple of integers.</p>
</dd></dl>
<dl class="data">
<dt id="sqlite3.PARSE_DECLTYPES">
<tt class="descclassname">sqlite3.</tt><tt class="descname">PARSE_DECLTYPES</tt><a class="headerlink" href="#sqlite3.PARSE_DECLTYPES" title="Permalink to this definition">¶</a></dt>
<dd><p>This constant is meant to be used with the <em>detect_types</em> parameter of the
<a class="reference internal" href="#sqlite3.connect" title="sqlite3.connect"><tt class="xref py py-func docutils literal"><span class="pre">connect()</span></tt></a> function.</p>
<p>Setting it makes the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module parse the declared type for each
column it returns. It will parse out the first word of the declared type,
i. e. for “integer primary key”, it will parse out “integer”, or for
“number(10)” it will parse out “number”. Then for that column, it will look
into the converters dictionary and use the converter function registered for
that type there.</p>
</dd></dl>
<dl class="data">
<dt id="sqlite3.PARSE_COLNAMES">
<tt class="descclassname">sqlite3.</tt><tt class="descname">PARSE_COLNAMES</tt><a class="headerlink" href="#sqlite3.PARSE_COLNAMES" title="Permalink to this definition">¶</a></dt>
<dd><p>This constant is meant to be used with the <em>detect_types</em> parameter of the
<a class="reference internal" href="#sqlite3.connect" title="sqlite3.connect"><tt class="xref py py-func docutils literal"><span class="pre">connect()</span></tt></a> function.</p>
<p>Setting this makes the SQLite interface parse the column name for each column it
returns. It will look for a string formed [mytype] in there, and then decide
that ‘mytype’ is the type of the column. It will try to find an entry of
‘mytype’ in the converters dictionary and then use the converter function found
there to return the value. The column name found in <a class="reference internal" href="#sqlite3.Cursor.description" title="sqlite3.Cursor.description"><tt class="xref py py-attr docutils literal"><span class="pre">Cursor.description</span></tt></a>
is only the first word of the column name, i. e. if you use something like
<tt class="docutils literal"><span class="pre">'as</span> <span class="pre">"x</span> <span class="pre">[datetime]"'</span></tt> in your SQL, then we will parse out everything until the
first blank for the column name: the column name would simply be “x”.</p>
</dd></dl>
<dl class="function">
<dt id="sqlite3.connect">
<tt class="descclassname">sqlite3.</tt><tt class="descname">connect</tt><big>(</big><em>database</em><span class="optional">[</span>, <em>timeout</em>, <em>detect_types</em>, <em>isolation_level</em>, <em>check_same_thread</em>, <em>factory</em>, <em>cached_statements</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#sqlite3.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Opens a connection to the SQLite database file <em>database</em>. You can use
<tt class="docutils literal"><span class="pre">":memory:"</span></tt> to open a database connection to a database that resides in RAM
instead of on disk.</p>
<p>When a database is accessed by multiple connections, and one of the processes
modifies the database, the SQLite database is locked until that transaction is
committed. The <em>timeout</em> parameter specifies how long the connection should wait
for the lock to go away until raising an exception. The default for the timeout
parameter is 5.0 (five seconds).</p>
<p>For the <em>isolation_level</em> parameter, please see the
<a class="reference internal" href="#sqlite3.Connection.isolation_level" title="sqlite3.Connection.isolation_level"><tt class="xref py py-attr docutils literal"><span class="pre">Connection.isolation_level</span></tt></a> property of <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> objects.</p>
<p>SQLite natively supports only the types TEXT, INTEGER, FLOAT, BLOB and NULL. If
you want to use other types you must add support for them yourself. The
<em>detect_types</em> parameter and the using custom <strong>converters</strong> registered with the
module-level <a class="reference internal" href="#sqlite3.register_converter" title="sqlite3.register_converter"><tt class="xref py py-func docutils literal"><span class="pre">register_converter()</span></tt></a> function allow you to easily do that.</p>
<p><em>detect_types</em> defaults to 0 (i. e. off, no type detection), you can set it to
any combination of <a class="reference internal" href="#sqlite3.PARSE_DECLTYPES" title="sqlite3.PARSE_DECLTYPES"><tt class="xref py py-const docutils literal"><span class="pre">PARSE_DECLTYPES</span></tt></a> and <a class="reference internal" href="#sqlite3.PARSE_COLNAMES" title="sqlite3.PARSE_COLNAMES"><tt class="xref py py-const docutils literal"><span class="pre">PARSE_COLNAMES</span></tt></a> to turn
type detection on.</p>
<p>By default, the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module uses its <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> class for the
connect call. You can, however, subclass the <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> class and make
<a class="reference internal" href="#sqlite3.connect" title="sqlite3.connect"><tt class="xref py py-func docutils literal"><span class="pre">connect()</span></tt></a> use your class instead by providing your class for the <em>factory</em>
parameter.</p>
<p>Consult the section <a class="reference internal" href="#sqlite3-types"><em>SQLite and Python types</em></a> of this manual for details.</p>
<p>The <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module internally uses a statement cache to avoid SQL parsing
overhead. If you want to explicitly set the number of statements that are cached
for the connection, you can set the <em>cached_statements</em> parameter. The currently
implemented default is to cache 100 statements.</p>
</dd></dl>
<dl class="function">
<dt id="sqlite3.register_converter">
<tt class="descclassname">sqlite3.</tt><tt class="descname">register_converter</tt><big>(</big><em>typename</em>, <em>callable</em><big>)</big><a class="headerlink" href="#sqlite3.register_converter" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a callable to convert a bytestring from the database into a custom
Python type. The callable will be invoked for all database values that are of
the type <em>typename</em>. Confer the parameter <em>detect_types</em> of the <a class="reference internal" href="#sqlite3.connect" title="sqlite3.connect"><tt class="xref py py-func docutils literal"><span class="pre">connect()</span></tt></a>
function for how the type detection works. Note that the case of <em>typename</em> and
the name of the type in your query must match!</p>
</dd></dl>
<dl class="function">
<dt id="sqlite3.register_adapter">
<tt class="descclassname">sqlite3.</tt><tt class="descname">register_adapter</tt><big>(</big><em>type</em>, <em>callable</em><big>)</big><a class="headerlink" href="#sqlite3.register_adapter" title="Permalink to this definition">¶</a></dt>
<dd><p>Registers a callable to convert the custom Python type <em>type</em> into one of
SQLite’s supported types. The callable <em>callable</em> accepts as single parameter
the Python value, and must return a value of the following types: int, long,
float, str (UTF-8 encoded), unicode or buffer.</p>
</dd></dl>
<dl class="function">
<dt id="sqlite3.complete_statement">
<tt class="descclassname">sqlite3.</tt><tt class="descname">complete_statement</tt><big>(</big><em>sql</em><big>)</big><a class="headerlink" href="#sqlite3.complete_statement" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <a class="reference internal" href="constants.html#True" title="True"><tt class="xref py py-const docutils literal"><span class="pre">True</span></tt></a> if the string <em>sql</em> contains one or more complete SQL
statements terminated by semicolons. It does not verify that the SQL is
syntactically correct, only that there are no unclosed string literals and the
statement is terminated by a semicolon.</p>
<p>This can be used to build a shell for SQLite, as in the following example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># A minimal SQLite shell for experiments</span>
<span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">isolation_level</span> <span class="o">=</span> <span class="bp">None</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="nb">buffer</span> <span class="o">=</span> <span class="s">""</span>
<span class="k">print</span> <span class="s">"Enter your SQL commands to execute in sqlite3."</span>
<span class="k">print</span> <span class="s">"Enter a blank line to exit."</span>
<span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
<span class="n">line</span> <span class="o">=</span> <span class="nb">raw_input</span><span class="p">()</span>
<span class="k">if</span> <span class="n">line</span> <span class="o">==</span> <span class="s">""</span><span class="p">:</span>
<span class="k">break</span>
<span class="nb">buffer</span> <span class="o">+=</span> <span class="n">line</span>
<span class="k">if</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">complete_statement</span><span class="p">(</span><span class="nb">buffer</span><span class="p">):</span>
<span class="k">try</span><span class="p">:</span>
<span class="nb">buffer</span> <span class="o">=</span> <span class="nb">buffer</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="nb">buffer</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">buffer</span><span class="o">.</span><span class="n">lstrip</span><span class="p">()</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">"SELECT"</span><span class="p">):</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchall</span><span class="p">()</span>
<span class="k">except</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">Error</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"An error occurred:"</span><span class="p">,</span> <span class="n">e</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="nb">buffer</span> <span class="o">=</span> <span class="s">""</span>
<span class="n">con</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="sqlite3.enable_callback_tracebacks">
<tt class="descclassname">sqlite3.</tt><tt class="descname">enable_callback_tracebacks</tt><big>(</big><em>flag</em><big>)</big><a class="headerlink" href="#sqlite3.enable_callback_tracebacks" title="Permalink to this definition">¶</a></dt>
<dd><p>By default you will not get any tracebacks in user-defined functions,
aggregates, converters, authorizer callbacks etc. If you want to debug them, you
can call this function with <em>flag</em> as True. Afterwards, you will get tracebacks
from callbacks on <tt class="docutils literal"><span class="pre">sys.stderr</span></tt>. Use <a class="reference internal" href="constants.html#False" title="False"><tt class="xref py py-const docutils literal"><span class="pre">False</span></tt></a> to disable the feature
again.</p>
</dd></dl>
</div>
<div class="section" id="connection-objects">
<span id="sqlite3-connection-objects"></span><h2>11.13.2. Connection Objects<a class="headerlink" href="#connection-objects" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="sqlite3.Connection">
<em class="property">class </em><tt class="descclassname">sqlite3.</tt><tt class="descname">Connection</tt><a class="headerlink" href="#sqlite3.Connection" title="Permalink to this definition">¶</a></dt>
<dd><p>A SQLite database connection has the following attributes and methods:</p>
<dl class="attribute">
<dt id="sqlite3.Connection.isolation_level">
<tt class="descname">isolation_level</tt><a class="headerlink" href="#sqlite3.Connection.isolation_level" title="Permalink to this definition">¶</a></dt>
<dd><p>Get or set the current isolation level. <a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a> for autocommit mode or
one of “DEFERRED”, “IMMEDIATE” or “EXCLUSIVE”. See section
<a class="reference internal" href="#sqlite3-controlling-transactions"><em>Controlling Transactions</em></a> for a more detailed explanation.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.cursor">
<tt class="descname">cursor</tt><big>(</big><span class="optional">[</span><em>cursorClass</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#sqlite3.Connection.cursor" title="Permalink to this definition">¶</a></dt>
<dd><p>The cursor method accepts a single optional parameter <em>cursorClass</em>. If
supplied, this must be a custom cursor class that extends
<a class="reference internal" href="#sqlite3.Cursor" title="sqlite3.Cursor"><tt class="xref py py-class docutils literal"><span class="pre">sqlite3.Cursor</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.commit">
<tt class="descname">commit</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Connection.commit" title="Permalink to this definition">¶</a></dt>
<dd><p>This method commits the current transaction. If you don’t call this method,
anything you did since the last call to <tt class="docutils literal"><span class="pre">commit()</span></tt> is not visible from
other database connections. If you wonder why you don’t see the data you’ve
written to the database, please check you didn’t forget to call this method.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.rollback">
<tt class="descname">rollback</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Connection.rollback" title="Permalink to this definition">¶</a></dt>
<dd><p>This method rolls back any changes to the database since the last call to
<a class="reference internal" href="#sqlite3.Connection.commit" title="sqlite3.Connection.commit"><tt class="xref py py-meth docutils literal"><span class="pre">commit()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Connection.close" title="Permalink to this definition">¶</a></dt>
<dd><p>This closes the database connection. Note that this does not automatically
call <a class="reference internal" href="#sqlite3.Connection.commit" title="sqlite3.Connection.commit"><tt class="xref py py-meth docutils literal"><span class="pre">commit()</span></tt></a>. If you just close your database connection without
calling <a class="reference internal" href="#sqlite3.Connection.commit" title="sqlite3.Connection.commit"><tt class="xref py py-meth docutils literal"><span class="pre">commit()</span></tt></a> first, your changes will be lost!</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.execute">
<tt class="descname">execute</tt><big>(</big><em>sql</em><span class="optional">[</span>, <em>parameters</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#sqlite3.Connection.execute" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a nonstandard shortcut that creates an intermediate cursor object by
calling the cursor method, then calls the cursor’s <a class="reference internal" href="#sqlite3.Cursor.execute" title="sqlite3.Cursor.execute"><tt class="xref py py-meth docutils literal"><span class="pre">execute</span></tt></a> method with the parameters given.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.executemany">
<tt class="descname">executemany</tt><big>(</big><em>sql</em><span class="optional">[</span>, <em>parameters</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#sqlite3.Connection.executemany" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a nonstandard shortcut that creates an intermediate cursor object by
calling the cursor method, then calls the cursor’s <a class="reference internal" href="#sqlite3.Cursor.executemany" title="sqlite3.Cursor.executemany"><tt class="xref py py-meth docutils literal"><span class="pre">executemany</span></tt></a> method with the parameters given.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.executescript">
<tt class="descname">executescript</tt><big>(</big><em>sql_script</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.executescript" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a nonstandard shortcut that creates an intermediate cursor object by
calling the cursor method, then calls the cursor’s <a class="reference internal" href="#sqlite3.Cursor.executescript" title="sqlite3.Cursor.executescript"><tt class="xref py py-meth docutils literal"><span class="pre">executescript</span></tt></a> method with the parameters given.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.create_function">
<tt class="descname">create_function</tt><big>(</big><em>name</em>, <em>num_params</em>, <em>func</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.create_function" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a user-defined function that you can later use from within SQL
statements under the function name <em>name</em>. <em>num_params</em> is the number of
parameters the function accepts, and <em>func</em> is a Python callable that is called
as the SQL function.</p>
<p>The function can return any of the types supported by SQLite: unicode, str, int,
long, float, buffer and None.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="kn">import</span> <span class="nn">md5</span>
<span class="k">def</span> <span class="nf">md5sum</span><span class="p">(</span><span class="n">t</span><span class="p">):</span>
<span class="k">return</span> <span class="n">md5</span><span class="o">.</span><span class="n">md5</span><span class="p">(</span><span class="n">t</span><span class="p">)</span><span class="o">.</span><span class="n">hexdigest</span><span class="p">()</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">create_function</span><span class="p">(</span><span class="s">"md5"</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">md5sum</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select md5(?)"</span><span class="p">,</span> <span class="p">(</span><span class="s">"foo"</span><span class="p">,))</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.create_aggregate">
<tt class="descname">create_aggregate</tt><big>(</big><em>name</em>, <em>num_params</em>, <em>aggregate_class</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.create_aggregate" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a user-defined aggregate function.</p>
<p>The aggregate class must implement a <tt class="docutils literal"><span class="pre">step</span></tt> method, which accepts the number
of parameters <em>num_params</em>, and a <tt class="docutils literal"><span class="pre">finalize</span></tt> method which will return the
final result of the aggregate.</p>
<p>The <tt class="docutils literal"><span class="pre">finalize</span></tt> method can return any of the types supported by SQLite:
unicode, str, int, long, float, buffer and None.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">class</span> <span class="nc">MySum</span><span class="p">:</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">def</span> <span class="nf">step</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="n">value</span>
<span class="k">def</span> <span class="nf">finalize</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">create_aggregate</span><span class="p">(</span><span class="s">"mysum"</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">MySum</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table test(i)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into test(i) values (1)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into test(i) values (2)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select mysum(i) from test"</span><span class="p">)</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.create_collation">
<tt class="descname">create_collation</tt><big>(</big><em>name</em>, <em>callable</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.create_collation" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a collation with the specified <em>name</em> and <em>callable</em>. The callable will
be passed two string arguments. It should return -1 if the first is ordered
lower than the second, 0 if they are ordered equal and 1 if the first is ordered
higher than the second. Note that this controls sorting (ORDER BY in SQL) so
your comparisons don’t affect other SQL operations.</p>
<p>Note that the callable will get its parameters as Python bytestrings, which will
normally be encoded in UTF-8.</p>
<p>The following example shows a custom collation that sorts “the wrong way”:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">def</span> <span class="nf">collate_reverse</span><span class="p">(</span><span class="n">string1</span><span class="p">,</span> <span class="n">string2</span><span class="p">):</span>
<span class="k">return</span> <span class="o">-</span><span class="nb">cmp</span><span class="p">(</span><span class="n">string1</span><span class="p">,</span> <span class="n">string2</span><span class="p">)</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">create_collation</span><span class="p">(</span><span class="s">"reverse"</span><span class="p">,</span> <span class="n">collate_reverse</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table test(x)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">executemany</span><span class="p">(</span><span class="s">"insert into test(x) values (?)"</span><span class="p">,</span> <span class="p">[(</span><span class="s">"a"</span><span class="p">,),</span> <span class="p">(</span><span class="s">"b"</span><span class="p">,)])</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select x from test order by x collate reverse"</span><span class="p">)</span>
<span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">cur</span><span class="p">:</span>
<span class="k">print</span> <span class="n">row</span>
<span class="n">con</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
<p>To remove a collation, call <tt class="docutils literal"><span class="pre">create_collation</span></tt> with None as callable:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">con</span><span class="o">.</span><span class="n">create_collation</span><span class="p">(</span><span class="s">"reverse"</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.interrupt">
<tt class="descname">interrupt</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Connection.interrupt" title="Permalink to this definition">¶</a></dt>
<dd><p>You can call this method from a different thread to abort any queries that might
be executing on the connection. The query will then abort and the caller will
get an exception.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.set_authorizer">
<tt class="descname">set_authorizer</tt><big>(</big><em>authorizer_callback</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.set_authorizer" title="Permalink to this definition">¶</a></dt>
<dd><p>This routine registers a callback. The callback is invoked for each attempt to
access a column of a table in the database. The callback should return
<tt class="xref py py-const docutils literal"><span class="pre">SQLITE_OK</span></tt> if access is allowed, <tt class="xref py py-const docutils literal"><span class="pre">SQLITE_DENY</span></tt> if the entire SQL
statement should be aborted with an error and <tt class="xref py py-const docutils literal"><span class="pre">SQLITE_IGNORE</span></tt> if the
column should be treated as a NULL value. These constants are available in the
<a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module.</p>
<p>The first argument to the callback signifies what kind of operation is to be
authorized. The second and third argument will be arguments or <a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a>
depending on the first argument. The 4th argument is the name of the database
(“main”, “temp”, etc.) if applicable. The 5th argument is the name of the
inner-most trigger or view that is responsible for the access attempt or
<a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a> if this access attempt is directly from input SQL code.</p>
<p>Please consult the SQLite documentation about the possible values for the first
argument and the meaning of the second and third argument depending on the first
one. All necessary constants are available in the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.set_progress_handler">
<tt class="descname">set_progress_handler</tt><big>(</big><em>handler</em>, <em>n</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.set_progress_handler" title="Permalink to this definition">¶</a></dt>
<dd><p>This routine registers a callback. The callback is invoked for every <em>n</em>
instructions of the SQLite virtual machine. This is useful if you want to
get called from SQLite during long-running operations, for example to update
a GUI.</p>
<p>If you want to clear any previously installed progress handler, call the
method with <a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a> for <em>handler</em>.</p>
<p class="versionadded">
<span class="versionmodified">New in version 2.6.</span></p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.enable_load_extension">
<tt class="descname">enable_load_extension</tt><big>(</big><em>enabled</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.enable_load_extension" title="Permalink to this definition">¶</a></dt>
<dd><p>This routine allows/disallows the SQLite engine to load SQLite extensions
from shared libraries. SQLite extensions can define new functions,
aggregates or whole new virtual table implementations. One well-known
extension is the fulltext-search extension distributed with SQLite.</p>
<p>Loadable extensions are disabled by default. See <a class="footnote-reference" href="#f1" id="id1">[1]</a>.</p>
<p class="versionadded">
<span class="versionmodified">New in version 2.7.</span></p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="c"># enable extension loading</span>
<span class="n">con</span><span class="o">.</span><span class="n">enable_load_extension</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
<span class="c"># Load the fulltext search extension</span>
<span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select load_extension('./fts3.so')"</span><span class="p">)</span>
<span class="c"># alternatively you can load the extension using an API call:</span>
<span class="c"># con.load_extension("./fts3.so")</span>
<span class="c"># disable extension laoding again</span>
<span class="n">con</span><span class="o">.</span><span class="n">enable_load_extension</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
<span class="c"># example from SQLite wiki</span>
<span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create virtual table recipe using fts3(name, ingredients)"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">executescript</span><span class="p">(</span><span class="s">"""</span>
<span class="s"> insert into recipe (name, ingredients) values ('broccoli stew', 'broccoli peppers cheese tomatoes');</span>
<span class="s"> insert into recipe (name, ingredients) values ('pumpkin stew', 'pumpkin onions garlic celery');</span>
<span class="s"> insert into recipe (name, ingredients) values ('broccoli pie', 'broccoli cheese onions flour');</span>
<span class="s"> insert into recipe (name, ingredients) values ('pumpkin pie', 'pumpkin sugar flour butter');</span>
<span class="s"> """</span><span class="p">)</span>
<span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select rowid, name, ingredients from recipe where name match 'pie'"</span><span class="p">):</span>
<span class="k">print</span> <span class="n">row</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Connection.load_extension">
<tt class="descname">load_extension</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#sqlite3.Connection.load_extension" title="Permalink to this definition">¶</a></dt>
<dd><p>This routine loads a SQLite extension from a shared library. You have to
enable extension loading with <a class="reference internal" href="#sqlite3.Connection.enable_load_extension" title="sqlite3.Connection.enable_load_extension"><tt class="xref py py-meth docutils literal"><span class="pre">enable_load_extension()</span></tt></a> before you can
use this routine.</p>
<p>Loadable extensions are disabled by default. See <a class="footnote-reference" href="#f1" id="id2">[1]</a>.</p>
<p class="versionadded">
<span class="versionmodified">New in version 2.7.</span></p>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Connection.row_factory">
<tt class="descname">row_factory</tt><a class="headerlink" href="#sqlite3.Connection.row_factory" title="Permalink to this definition">¶</a></dt>
<dd><p>You can change this attribute to a callable that accepts the cursor and the
original row as a tuple and will return the real result row. This way, you can
implement more advanced ways of returning results, such as returning an object
that can also access columns by name.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">def</span> <span class="nf">dict_factory</span><span class="p">(</span><span class="n">cursor</span><span class="p">,</span> <span class="n">row</span><span class="p">):</span>
<span class="n">d</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">idx</span><span class="p">,</span> <span class="n">col</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">cursor</span><span class="o">.</span><span class="n">description</span><span class="p">):</span>
<span class="n">d</span><span class="p">[</span><span class="n">col</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="n">row</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span>
<span class="k">return</span> <span class="n">d</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">row_factory</span> <span class="o">=</span> <span class="n">dict_factory</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select 1 as a"</span><span class="p">)</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="s">"a"</span><span class="p">]</span>
</pre></div>
</div>
<p>If returning a tuple doesn’t suffice and you want name-based access to
columns, you should consider setting <a class="reference internal" href="#sqlite3.Connection.row_factory" title="sqlite3.Connection.row_factory"><tt class="xref py py-attr docutils literal"><span class="pre">row_factory</span></tt></a> to the
highly-optimized <a class="reference internal" href="#sqlite3.Row" title="sqlite3.Row"><tt class="xref py py-class docutils literal"><span class="pre">sqlite3.Row</span></tt></a> type. <a class="reference internal" href="#sqlite3.Row" title="sqlite3.Row"><tt class="xref py py-class docutils literal"><span class="pre">Row</span></tt></a> provides both
index-based and case-insensitive name-based access to columns with almost no
memory overhead. It will probably be better than your own custom
dictionary-based approach or even a db_row based solution.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Connection.text_factory">
<tt class="descname">text_factory</tt><a class="headerlink" href="#sqlite3.Connection.text_factory" title="Permalink to this definition">¶</a></dt>
<dd><p>Using this attribute you can control what objects are returned for the <tt class="docutils literal"><span class="pre">TEXT</span></tt>
data type. By default, this attribute is set to <a class="reference internal" href="functions.html#unicode" title="unicode"><tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt></a> and the
<a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module will return Unicode objects for <tt class="docutils literal"><span class="pre">TEXT</span></tt>. If you want to
return bytestrings instead, you can set it to <a class="reference internal" href="functions.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a>.</p>
<p>For efficiency reasons, there’s also a way to return Unicode objects only for
non-ASCII data, and bytestrings otherwise. To activate it, set this attribute to
<tt class="xref py py-const docutils literal"><span class="pre">sqlite3.OptimizedUnicode</span></tt>.</p>
<p>You can also set it to any other callable that accepts a single bytestring
parameter and returns the resulting object.</p>
<p>See the following example code for illustration:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">AUSTRIA</span> <span class="o">=</span> <span class="s">u"</span><span class="se">\xd6</span><span class="s">sterreich"</span>
<span class="c"># by default, rows are returned as Unicode</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="n">AUSTRIA</span><span class="p">,))</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">assert</span> <span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">AUSTRIA</span>
<span class="c"># but we can make sqlite3 always return bytestrings ...</span>
<span class="n">con</span><span class="o">.</span><span class="n">text_factory</span> <span class="o">=</span> <span class="nb">str</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="n">AUSTRIA</span><span class="p">,))</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">assert</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">str</span>
<span class="c"># the bytestrings will be encoded in UTF-8, unless you stored garbage in the</span>
<span class="c"># database ...</span>
<span class="k">assert</span> <span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">AUSTRIA</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">"utf-8"</span><span class="p">)</span>
<span class="c"># we can also implement a custom text_factory ...</span>
<span class="c"># here we implement one that will ignore Unicode characters that cannot be</span>
<span class="c"># decoded from UTF-8</span>
<span class="n">con</span><span class="o">.</span><span class="n">text_factory</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="nb">unicode</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="s">"utf-8"</span><span class="p">,</span> <span class="s">"ignore"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="s">"this is latin1 and would normally create errors"</span> <span class="o">+</span>
<span class="s">u"</span><span class="se">\xe4\xf6\xfc</span><span class="s">"</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">"latin1"</span><span class="p">),))</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">assert</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">unicode</span>
<span class="c"># sqlite3 offers a built-in optimized text_factory that will return bytestring</span>
<span class="c"># objects, if the data is in ASCII only, and otherwise return unicode objects</span>
<span class="n">con</span><span class="o">.</span><span class="n">text_factory</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">OptimizedUnicode</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="n">AUSTRIA</span><span class="p">,))</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">assert</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">unicode</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="s">"Germany"</span><span class="p">,))</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">assert</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="ow">is</span> <span class="nb">str</span>
</pre></div>
</div>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Connection.total_changes">
<tt class="descname">total_changes</tt><a class="headerlink" href="#sqlite3.Connection.total_changes" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the total number of database rows that have been modified, inserted, or
deleted since the database connection was opened.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Connection.iterdump">
<tt class="descname">iterdump</tt><a class="headerlink" href="#sqlite3.Connection.iterdump" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterator to dump the database in an SQL text format. Useful when
saving an in-memory database for later restoration. This function provides
the same capabilities as the <tt class="kbd docutils literal"><span class="pre">.dump</span></tt> command in the <strong class="program">sqlite3</strong>
shell.</p>
<p class="versionadded">
<span class="versionmodified">New in version 2.6.</span></p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c"># Convert file existing_db.db to SQL dump file dump.sql</span>
<span class="kn">import</span> <span class="nn">sqlite3</span><span class="o">,</span> <span class="nn">os</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">'existing_db.db'</span><span class="p">)</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s">'dump.sql'</span><span class="p">,</span> <span class="s">'w'</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">con</span><span class="o">.</span><span class="n">iterdump</span><span class="p">():</span>
<span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'</span><span class="si">%s</span><span class="se">\n</span><span class="s">'</span> <span class="o">%</span> <span class="n">line</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="cursor-objects">
<span id="sqlite3-cursor-objects"></span><h2>11.13.3. Cursor Objects<a class="headerlink" href="#cursor-objects" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="sqlite3.Cursor">
<em class="property">class </em><tt class="descclassname">sqlite3.</tt><tt class="descname">Cursor</tt><a class="headerlink" href="#sqlite3.Cursor" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#sqlite3.Cursor" title="sqlite3.Cursor"><tt class="xref py py-class docutils literal"><span class="pre">Cursor</span></tt></a> instance has the following attributes and methods.</p>
<dl class="method">
<dt id="sqlite3.Cursor.execute">
<tt class="descname">execute</tt><big>(</big><em>sql</em><span class="optional">[</span>, <em>parameters</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#sqlite3.Cursor.execute" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes an SQL statement. The SQL statement may be parameterized (i. e.
placeholders instead of SQL literals). The <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module supports two
kinds of placeholders: question marks (qmark style) and named placeholders
(named style).</p>
<p>Here’s an example of both styles:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table people (name_last, age)"</span><span class="p">)</span>
<span class="n">who</span> <span class="o">=</span> <span class="s">"Yeltsin"</span>
<span class="n">age</span> <span class="o">=</span> <span class="mi">72</span>
<span class="c"># This is the qmark style:</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into people values (?, ?)"</span><span class="p">,</span> <span class="p">(</span><span class="n">who</span><span class="p">,</span> <span class="n">age</span><span class="p">))</span>
<span class="c"># And this is the named style:</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select * from people where name_last=:who and age=:age"</span><span class="p">,</span> <span class="p">{</span><span class="s">"who"</span><span class="p">:</span> <span class="n">who</span><span class="p">,</span> <span class="s">"age"</span><span class="p">:</span> <span class="n">age</span><span class="p">})</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
</pre></div>
</div>
<p><a class="reference internal" href="#sqlite3.Cursor.execute" title="sqlite3.Cursor.execute"><tt class="xref py py-meth docutils literal"><span class="pre">execute()</span></tt></a> will only execute a single SQL statement. If you try to execute
more than one statement with it, it will raise a Warning. Use
<a class="reference internal" href="#sqlite3.Cursor.executescript" title="sqlite3.Cursor.executescript"><tt class="xref py py-meth docutils literal"><span class="pre">executescript()</span></tt></a> if you want to execute multiple SQL statements with one
call.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Cursor.executemany">
<tt class="descname">executemany</tt><big>(</big><em>sql</em>, <em>seq_of_parameters</em><big>)</big><a class="headerlink" href="#sqlite3.Cursor.executemany" title="Permalink to this definition">¶</a></dt>
<dd><p>Executes an SQL command against all parameter sequences or mappings found in
the sequence <em>sql</em>. The <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module also allows using an
<a class="reference internal" href="../glossary.html#term-iterator"><em class="xref std std-term">iterator</em></a> yielding parameters instead of a sequence.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">class</span> <span class="nc">IterChars</span><span class="p">:</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="nb">ord</span><span class="p">(</span><span class="s">'a'</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span>
<span class="k">def</span> <span class="nf">next</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">></span> <span class="nb">ord</span><span class="p">(</span><span class="s">'z'</span><span class="p">):</span>
<span class="k">raise</span> <span class="ne">StopIteration</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">return</span> <span class="p">(</span><span class="nb">chr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),)</span> <span class="c"># this is a 1-tuple</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table characters(c)"</span><span class="p">)</span>
<span class="n">theIter</span> <span class="o">=</span> <span class="n">IterChars</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">executemany</span><span class="p">(</span><span class="s">"insert into characters(c) values (?)"</span><span class="p">,</span> <span class="n">theIter</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select c from characters"</span><span class="p">)</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchall</span><span class="p">()</span>
</pre></div>
</div>
<p>Here’s a shorter example using a <a class="reference internal" href="../glossary.html#term-generator"><em class="xref std std-term">generator</em></a>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="kn">import</span> <span class="nn">string</span>
<span class="k">def</span> <span class="nf">char_generator</span><span class="p">():</span>
<span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">string</span><span class="o">.</span><span class="n">lowercase</span><span class="p">:</span>
<span class="k">yield</span> <span class="p">(</span><span class="n">c</span><span class="p">,)</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table characters(c)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">executemany</span><span class="p">(</span><span class="s">"insert into characters(c) values (?)"</span><span class="p">,</span> <span class="n">char_generator</span><span class="p">())</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select c from characters"</span><span class="p">)</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchall</span><span class="p">()</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Cursor.executescript">
<tt class="descname">executescript</tt><big>(</big><em>sql_script</em><big>)</big><a class="headerlink" href="#sqlite3.Cursor.executescript" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a nonstandard convenience method for executing multiple SQL statements
at once. It issues a <tt class="docutils literal"><span class="pre">COMMIT</span></tt> statement first, then executes the SQL script it
gets as a parameter.</p>
<p><em>sql_script</em> can be a bytestring or a Unicode string.</p>
<p>Example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">executescript</span><span class="p">(</span><span class="s">"""</span>
<span class="s"> create table person(</span>
<span class="s"> firstname,</span>
<span class="s"> lastname,</span>
<span class="s"> age</span>
<span class="s"> );</span>
<span class="s"> create table book(</span>
<span class="s"> title,</span>
<span class="s"> author,</span>
<span class="s"> published</span>
<span class="s"> );</span>
<span class="s"> insert into book(title, author, published)</span>
<span class="s"> values (</span>
<span class="s"> 'Dirk Gently''s Holistic Detective Agency',</span>
<span class="s"> 'Douglas Adams',</span>
<span class="s"> 1987</span>
<span class="s"> );</span>
<span class="s"> """</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Cursor.fetchone">
<tt class="descname">fetchone</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Cursor.fetchone" title="Permalink to this definition">¶</a></dt>
<dd><p>Fetches the next row of a query result set, returning a single sequence,
or <a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a> when no more data is available.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Cursor.fetchmany">
<tt class="descname">fetchmany</tt><big>(</big><span class="optional">[</span><em>size=cursor.arraysize</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#sqlite3.Cursor.fetchmany" title="Permalink to this definition">¶</a></dt>
<dd><p>Fetches the next set of rows of a query result, returning a list. An empty
list is returned when no more rows are available.</p>
<p>The number of rows to fetch per call is specified by the <em>size</em> parameter.
If it is not given, the cursor’s arraysize determines the number of rows
to be fetched. The method should try to fetch as many rows as indicated by
the size parameter. If this is not possible due to the specified number of
rows not being available, fewer rows may be returned.</p>
<p>Note there are performance considerations involved with the <em>size</em> parameter.
For optimal performance, it is usually best to use the arraysize attribute.
If the <em>size</em> parameter is used, then it is best for it to retain the same
value from one <a class="reference internal" href="#sqlite3.Cursor.fetchmany" title="sqlite3.Cursor.fetchmany"><tt class="xref py py-meth docutils literal"><span class="pre">fetchmany()</span></tt></a> call to the next.</p>
</dd></dl>
<dl class="method">
<dt id="sqlite3.Cursor.fetchall">
<tt class="descname">fetchall</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Cursor.fetchall" title="Permalink to this definition">¶</a></dt>
<dd><p>Fetches all (remaining) rows of a query result, returning a list. Note that
the cursor’s arraysize attribute can affect the performance of this operation.
An empty list is returned when no rows are available.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Cursor.rowcount">
<tt class="descname">rowcount</tt><a class="headerlink" href="#sqlite3.Cursor.rowcount" title="Permalink to this definition">¶</a></dt>
<dd><p>Although the <a class="reference internal" href="#sqlite3.Cursor" title="sqlite3.Cursor"><tt class="xref py py-class docutils literal"><span class="pre">Cursor</span></tt></a> class of the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module implements this
attribute, the database engine’s own support for the determination of “rows
affected”/”rows selected” is quirky.</p>
<p>For <a class="reference internal" href="#sqlite3.Cursor.executemany" title="sqlite3.Cursor.executemany"><tt class="xref py py-meth docutils literal"><span class="pre">executemany()</span></tt></a> statements, the number of modifications are summed up
into <a class="reference internal" href="#sqlite3.Cursor.rowcount" title="sqlite3.Cursor.rowcount"><tt class="xref py py-attr docutils literal"><span class="pre">rowcount</span></tt></a>.</p>
<p>As required by the Python DB API Spec, the <a class="reference internal" href="#sqlite3.Cursor.rowcount" title="sqlite3.Cursor.rowcount"><tt class="xref py py-attr docutils literal"><span class="pre">rowcount</span></tt></a> attribute “is -1 in
case no <tt class="docutils literal"><span class="pre">executeXX()</span></tt> has been performed on the cursor or the rowcount of the
last operation is not determinable by the interface”. This includes <tt class="docutils literal"><span class="pre">SELECT</span></tt>
statements because we cannot determine the number of rows a query produced
until all rows were fetched.</p>
<p>With SQLite versions before 3.6.5, <a class="reference internal" href="#sqlite3.Cursor.rowcount" title="sqlite3.Cursor.rowcount"><tt class="xref py py-attr docutils literal"><span class="pre">rowcount</span></tt></a> is set to 0 if
you make a <tt class="docutils literal"><span class="pre">DELETE</span> <span class="pre">FROM</span> <span class="pre">table</span></tt> without any condition.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Cursor.lastrowid">
<tt class="descname">lastrowid</tt><a class="headerlink" href="#sqlite3.Cursor.lastrowid" title="Permalink to this definition">¶</a></dt>
<dd><p>This read-only attribute provides the rowid of the last modified row. It is
only set if you issued a <tt class="docutils literal"><span class="pre">INSERT</span></tt> statement using the <a class="reference internal" href="#sqlite3.Cursor.execute" title="sqlite3.Cursor.execute"><tt class="xref py py-meth docutils literal"><span class="pre">execute()</span></tt></a>
method. For operations other than <tt class="docutils literal"><span class="pre">INSERT</span></tt> or when <a class="reference internal" href="#sqlite3.Cursor.executemany" title="sqlite3.Cursor.executemany"><tt class="xref py py-meth docutils literal"><span class="pre">executemany()</span></tt></a> is
called, <a class="reference internal" href="#sqlite3.Cursor.lastrowid" title="sqlite3.Cursor.lastrowid"><tt class="xref py py-attr docutils literal"><span class="pre">lastrowid</span></tt></a> is set to <a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a>.</p>
</dd></dl>
<dl class="attribute">
<dt id="sqlite3.Cursor.description">
<tt class="descname">description</tt><a class="headerlink" href="#sqlite3.Cursor.description" title="Permalink to this definition">¶</a></dt>
<dd><p>This read-only attribute provides the column names of the last query. To
remain compatible with the Python DB API, it returns a 7-tuple for each
column where the last six items of each tuple are <a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a>.</p>
<p>It is set for <tt class="docutils literal"><span class="pre">SELECT</span></tt> statements without any matching rows as well.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="row-objects">
<span id="sqlite3-row-objects"></span><h2>11.13.4. Row Objects<a class="headerlink" href="#row-objects" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="sqlite3.Row">
<em class="property">class </em><tt class="descclassname">sqlite3.</tt><tt class="descname">Row</tt><a class="headerlink" href="#sqlite3.Row" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference internal" href="#sqlite3.Row" title="sqlite3.Row"><tt class="xref py py-class docutils literal"><span class="pre">Row</span></tt></a> instance serves as a highly optimized
<a class="reference internal" href="#sqlite3.Connection.row_factory" title="sqlite3.Connection.row_factory"><tt class="xref py py-attr docutils literal"><span class="pre">row_factory</span></tt></a> for <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> objects.
It tries to mimic a tuple in most of its features.</p>
<p>It supports mapping access by column name and index, iteration,
representation, equality testing and <a class="reference internal" href="functions.html#len" title="len"><tt class="xref py py-func docutils literal"><span class="pre">len()</span></tt></a>.</p>
<p>If two <a class="reference internal" href="#sqlite3.Row" title="sqlite3.Row"><tt class="xref py py-class docutils literal"><span class="pre">Row</span></tt></a> objects have exactly the same columns and their
members are equal, they compare equal.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 2.6: </span>Added iteration and equality (hashability).</p>
<dl class="method">
<dt id="sqlite3.Row.keys">
<tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#sqlite3.Row.keys" title="Permalink to this definition">¶</a></dt>
<dd><p>This method returns a tuple of column names. Immediately after a query,
it is the first member of each tuple in <a class="reference internal" href="#sqlite3.Cursor.description" title="sqlite3.Cursor.description"><tt class="xref py py-attr docutils literal"><span class="pre">Cursor.description</span></tt></a>.</p>
<p class="versionadded">
<span class="versionmodified">New in version 2.6.</span></p>
</dd></dl>
</dd></dl>
<p>Let’s assume we initialize a table as in the example given above:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">conn</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'''create table stocks</span>
<span class="s">(date text, trans text, symbol text,</span>
<span class="s"> qty real, price real)'''</span><span class="p">)</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"""insert into stocks</span>
<span class="s"> values ('2006-01-05','BUY','RHAT',100,35.14)"""</span><span class="p">)</span>
<span class="n">conn</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span>
<span class="n">c</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
<p>Now we plug <a class="reference internal" href="#sqlite3.Row" title="sqlite3.Row"><tt class="xref py py-class docutils literal"><span class="pre">Row</span></tt></a> in:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">conn</span><span class="o">.</span><span class="n">row_factory</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">Row</span>
<span class="gp">>>> </span><span class="n">c</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="gp">>>> </span><span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'select * from stocks'</span><span class="p">)</span>
<span class="go"><sqlite3.Cursor object at 0x7f4e7dd8fa80></span>
<span class="gp">>>> </span><span class="n">r</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="gp">>>> </span><span class="nb">type</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
<span class="go"><type 'sqlite3.Row'></span>
<span class="gp">>>> </span><span class="n">r</span>
<span class="go">(u'2006-01-05', u'BUY', u'RHAT', 100.0, 35.14)</span>
<span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">r</span><span class="p">)</span>
<span class="go">5</span>
<span class="gp">>>> </span><span class="n">r</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
<span class="go">u'RHAT'</span>
<span class="gp">>>> </span><span class="n">r</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="go">['date', 'trans', 'symbol', 'qty', 'price']</span>
<span class="gp">>>> </span><span class="n">r</span><span class="p">[</span><span class="s">'qty'</span><span class="p">]</span>
<span class="go">100.0</span>
<span class="gp">>>> </span><span class="k">for</span> <span class="n">member</span> <span class="ow">in</span> <span class="n">r</span><span class="p">:</span>
<span class="gp">... </span> <span class="k">print</span> <span class="n">member</span>
<span class="gp">...</span>
<span class="go">2006-01-05</span>
<span class="go">BUY</span>
<span class="go">RHAT</span>
<span class="go">100.0</span>
<span class="go">35.14</span>
</pre></div>
</div>
</div>
<div class="section" id="sqlite-and-python-types">
<span id="sqlite3-types"></span><h2>11.13.5. SQLite and Python types<a class="headerlink" href="#sqlite-and-python-types" title="Permalink to this headline">¶</a></h2>
<div class="section" id="introduction">
<h3>11.13.5.1. Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h3>
<p>SQLite natively supports the following types: <tt class="docutils literal"><span class="pre">NULL</span></tt>, <tt class="docutils literal"><span class="pre">INTEGER</span></tt>,
<tt class="docutils literal"><span class="pre">REAL</span></tt>, <tt class="docutils literal"><span class="pre">TEXT</span></tt>, <tt class="docutils literal"><span class="pre">BLOB</span></tt>.</p>
<p>The following Python types can thus be sent to SQLite without any problem:</p>
<table border="1" class="docutils">
<colgroup>
<col width="69%" />
<col width="31%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Python type</th>
<th class="head">SQLite type</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">NULL</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="functions.html#int" title="int"><tt class="xref py py-class docutils literal"><span class="pre">int</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">INTEGER</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="functions.html#long" title="long"><tt class="xref py py-class docutils literal"><span class="pre">long</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">INTEGER</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="functions.html#float" title="float"><tt class="xref py py-class docutils literal"><span class="pre">float</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">REAL</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="functions.html#str" title="str"><tt class="xref py py-class docutils literal"><span class="pre">str</span></tt></a> (UTF8-encoded)</td>
<td><tt class="docutils literal"><span class="pre">TEXT</span></tt></td>
</tr>
<tr class="row-odd"><td><a class="reference internal" href="functions.html#unicode" title="unicode"><tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">TEXT</span></tt></td>
</tr>
<tr class="row-even"><td><a class="reference internal" href="functions.html#buffer" title="buffer"><tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt></a></td>
<td><tt class="docutils literal"><span class="pre">BLOB</span></tt></td>
</tr>
</tbody>
</table>
<p>This is how SQLite types are converted to Python types by default:</p>
<table border="1" class="docutils">
<colgroup>
<col width="22%" />
<col width="78%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">SQLite type</th>
<th class="head">Python type</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">NULL</span></tt></td>
<td><a class="reference internal" href="constants.html#None" title="None"><tt class="xref py py-const docutils literal"><span class="pre">None</span></tt></a></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">INTEGER</span></tt></td>
<td><a class="reference internal" href="functions.html#int" title="int"><tt class="xref py py-class docutils literal"><span class="pre">int</span></tt></a> or <a class="reference internal" href="functions.html#long" title="long"><tt class="xref py py-class docutils literal"><span class="pre">long</span></tt></a>,
depending on size</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">REAL</span></tt></td>
<td><a class="reference internal" href="functions.html#float" title="float"><tt class="xref py py-class docutils literal"><span class="pre">float</span></tt></a></td>
</tr>
<tr class="row-odd"><td><tt class="docutils literal"><span class="pre">TEXT</span></tt></td>
<td>depends on <a class="reference internal" href="#sqlite3.Connection.text_factory" title="sqlite3.Connection.text_factory"><tt class="xref py py-attr docutils literal"><span class="pre">text_factory</span></tt></a>,
<a class="reference internal" href="functions.html#unicode" title="unicode"><tt class="xref py py-class docutils literal"><span class="pre">unicode</span></tt></a> by default</td>
</tr>
<tr class="row-even"><td><tt class="docutils literal"><span class="pre">BLOB</span></tt></td>
<td><a class="reference internal" href="functions.html#buffer" title="buffer"><tt class="xref py py-class docutils literal"><span class="pre">buffer</span></tt></a></td>
</tr>
</tbody>
</table>
<p>The type system of the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module is extensible in two ways: you can
store additional Python types in a SQLite database via object adaptation, and
you can let the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module convert SQLite types to different Python
types via converters.</p>
</div>
<div class="section" id="using-adapters-to-store-additional-python-types-in-sqlite-databases">
<h3>11.13.5.2. Using adapters to store additional Python types in SQLite databases<a class="headerlink" href="#using-adapters-to-store-additional-python-types-in-sqlite-databases" title="Permalink to this headline">¶</a></h3>
<p>As described before, SQLite supports only a limited set of types natively. To
use other Python types with SQLite, you must <strong>adapt</strong> them to one of the
sqlite3 module’s supported types for SQLite: one of NoneType, int, long, float,
str, unicode, buffer.</p>
<p>The <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module uses Python object adaptation, as described in
<span class="target" id="index-2"></span><a class="pep reference external" href="http://www.python.org/dev/peps/pep-0246"><strong>PEP 246</strong></a> for this. The protocol to use is <tt class="xref py py-class docutils literal"><span class="pre">PrepareProtocol</span></tt>.</p>
<p>There are two ways to enable the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module to adapt a custom Python
type to one of the supported ones.</p>
<div class="section" id="letting-your-object-adapt-itself">
<h4>11.13.5.2.1. Letting your object adapt itself<a class="headerlink" href="#letting-your-object-adapt-itself" title="Permalink to this headline">¶</a></h4>
<p>This is a good approach if you write the class yourself. Let’s suppose you have
a class like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">class</span> <span class="nc">Point</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<p>Now you want to store the point in a single SQLite column. First you’ll have to
choose one of the supported types first to be used for representing the point.
Let’s just use str and separate the coordinates using a semicolon. Then you need
to give your class a method <tt class="docutils literal"><span class="pre">__conform__(self,</span> <span class="pre">protocol)</span></tt> which must return
the converted value. The parameter <em>protocol</em> will be <tt class="xref py py-class docutils literal"><span class="pre">PrepareProtocol</span></tt>.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">class</span> <span class="nc">Point</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="k">def</span> <span class="nf">__conform__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">protocol</span><span class="p">):</span>
<span class="k">if</span> <span class="n">protocol</span> <span class="ow">is</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">PrepareProtocol</span><span class="p">:</span>
<span class="k">return</span> <span class="s">"</span><span class="si">%f</span><span class="s">;</span><span class="si">%f</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">3.2</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="n">p</span><span class="p">,))</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
</pre></div>
</div>
</div>
<div class="section" id="registering-an-adapter-callable">
<h4>11.13.5.2.2. Registering an adapter callable<a class="headerlink" href="#registering-an-adapter-callable" title="Permalink to this headline">¶</a></h4>
<p>The other possibility is to create a function that converts the type to the
string representation and register the function with <a class="reference internal" href="#sqlite3.register_adapter" title="sqlite3.register_adapter"><tt class="xref py py-meth docutils literal"><span class="pre">register_adapter()</span></tt></a>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The type/class to adapt must be a <a class="reference internal" href="../glossary.html#term-new-style-class"><em class="xref std std-term">new-style class</em></a>, i. e. it must have
<a class="reference internal" href="functions.html#object" title="object"><tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></a> as one of its bases.</p>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">class</span> <span class="nc">Point</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="k">def</span> <span class="nf">adapt_point</span><span class="p">(</span><span class="n">point</span><span class="p">):</span>
<span class="k">return</span> <span class="s">"</span><span class="si">%f</span><span class="s">;</span><span class="si">%f</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">point</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">point</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="n">sqlite3</span><span class="o">.</span><span class="n">register_adapter</span><span class="p">(</span><span class="n">Point</span><span class="p">,</span> <span class="n">adapt_point</span><span class="p">)</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">3.2</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="n">p</span><span class="p">,))</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
</pre></div>
</div>
<p>The <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module has two default adapters for Python’s built-in
<a class="reference internal" href="datetime.html#datetime.date" title="datetime.date"><tt class="xref py py-class docutils literal"><span class="pre">datetime.date</span></tt></a> and <a class="reference internal" href="datetime.html#datetime.datetime" title="datetime.datetime"><tt class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></tt></a> types. Now let’s suppose
we want to store <a class="reference internal" href="datetime.html#datetime.datetime" title="datetime.datetime"><tt class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></tt></a> objects not in ISO representation,
but as a Unix timestamp.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="kn">import</span> <span class="nn">datetime</span><span class="o">,</span> <span class="nn">time</span>
<span class="k">def</span> <span class="nf">adapt_datetime</span><span class="p">(</span><span class="n">ts</span><span class="p">):</span>
<span class="k">return</span> <span class="n">time</span><span class="o">.</span><span class="n">mktime</span><span class="p">(</span><span class="n">ts</span><span class="o">.</span><span class="n">timetuple</span><span class="p">())</span>
<span class="n">sqlite3</span><span class="o">.</span><span class="n">register_adapter</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="p">,</span> <span class="n">adapt_datetime</span><span class="p">)</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">now</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select ?"</span><span class="p">,</span> <span class="p">(</span><span class="n">now</span><span class="p">,))</span>
<span class="k">print</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="converting-sqlite-values-to-custom-python-types">
<h3>11.13.5.3. Converting SQLite values to custom Python types<a class="headerlink" href="#converting-sqlite-values-to-custom-python-types" title="Permalink to this headline">¶</a></h3>
<p>Writing an adapter lets you send custom Python types to SQLite. But to make it
really useful we need to make the Python to SQLite to Python roundtrip work.</p>
<p>Enter converters.</p>
<p>Let’s go back to the <tt class="xref py py-class docutils literal"><span class="pre">Point</span></tt> class. We stored the x and y coordinates
separated via semicolons as strings in SQLite.</p>
<p>First, we’ll define a converter function that accepts the string as a parameter
and constructs a <tt class="xref py py-class docutils literal"><span class="pre">Point</span></tt> object from it.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Converter functions <strong>always</strong> get called with a string, no matter under which
data type you sent the value to SQLite.</p>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">convert_point</span><span class="p">(</span><span class="n">s</span><span class="p">):</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="nb">map</span><span class="p">(</span><span class="nb">float</span><span class="p">,</span> <span class="n">s</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">";"</span><span class="p">))</span>
<span class="k">return</span> <span class="n">Point</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
</pre></div>
</div>
<p>Now you need to make the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module know that what you select from
the database is actually a point. There are two ways of doing this:</p>
<ul class="simple">
<li>Implicitly via the declared type</li>
<li>Explicitly via the column name</li>
</ul>
<p>Both ways are described in section <a class="reference internal" href="#sqlite3-module-contents"><em>Module functions and constants</em></a>, in the entries
for the constants <a class="reference internal" href="#sqlite3.PARSE_DECLTYPES" title="sqlite3.PARSE_DECLTYPES"><tt class="xref py py-const docutils literal"><span class="pre">PARSE_DECLTYPES</span></tt></a> and <a class="reference internal" href="#sqlite3.PARSE_COLNAMES" title="sqlite3.PARSE_COLNAMES"><tt class="xref py py-const docutils literal"><span class="pre">PARSE_COLNAMES</span></tt></a>.</p>
<p>The following example illustrates both approaches.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="k">class</span> <span class="nc">Point</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="s">"(</span><span class="si">%f</span><span class="s">;</span><span class="si">%f</span><span class="s">)"</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">adapt_point</span><span class="p">(</span><span class="n">point</span><span class="p">):</span>
<span class="k">return</span> <span class="s">"</span><span class="si">%f</span><span class="s">;</span><span class="si">%f</span><span class="s">"</span> <span class="o">%</span> <span class="p">(</span><span class="n">point</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">point</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">convert_point</span><span class="p">(</span><span class="n">s</span><span class="p">):</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="nb">map</span><span class="p">(</span><span class="nb">float</span><span class="p">,</span> <span class="n">s</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">";"</span><span class="p">))</span>
<span class="k">return</span> <span class="n">Point</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="c"># Register the adapter</span>
<span class="n">sqlite3</span><span class="o">.</span><span class="n">register_adapter</span><span class="p">(</span><span class="n">Point</span><span class="p">,</span> <span class="n">adapt_point</span><span class="p">)</span>
<span class="c"># Register the converter</span>
<span class="n">sqlite3</span><span class="o">.</span><span class="n">register_converter</span><span class="p">(</span><span class="s">"point"</span><span class="p">,</span> <span class="n">convert_point</span><span class="p">)</span>
<span class="n">p</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="mf">4.0</span><span class="p">,</span> <span class="o">-</span><span class="mf">3.2</span><span class="p">)</span>
<span class="c">#########################</span>
<span class="c"># 1) Using declared types</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">,</span> <span class="n">detect_types</span><span class="o">=</span><span class="n">sqlite3</span><span class="o">.</span><span class="n">PARSE_DECLTYPES</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table test(p point)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into test(p) values (?)"</span><span class="p">,</span> <span class="p">(</span><span class="n">p</span><span class="p">,))</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select p from test"</span><span class="p">)</span>
<span class="k">print</span> <span class="s">"with declared types:"</span><span class="p">,</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">cur</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="n">con</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="c">#######################</span>
<span class="c"># 1) Using column names</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">,</span> <span class="n">detect_types</span><span class="o">=</span><span class="n">sqlite3</span><span class="o">.</span><span class="n">PARSE_COLNAMES</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table test(p)"</span><span class="p">)</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into test(p) values (?)"</span><span class="p">,</span> <span class="p">(</span><span class="n">p</span><span class="p">,))</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'select p as "p [point]" from test'</span><span class="p">)</span>
<span class="k">print</span> <span class="s">"with column names:"</span><span class="p">,</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">cur</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="n">con</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="section" id="default-adapters-and-converters">
<h3>11.13.5.4. Default adapters and converters<a class="headerlink" href="#default-adapters-and-converters" title="Permalink to this headline">¶</a></h3>
<p>There are default adapters for the date and datetime types in the datetime
module. They will be sent as ISO dates/ISO timestamps to SQLite.</p>
<p>The default converters are registered under the name “date” for
<a class="reference internal" href="datetime.html#datetime.date" title="datetime.date"><tt class="xref py py-class docutils literal"><span class="pre">datetime.date</span></tt></a> and under the name “timestamp” for
<a class="reference internal" href="datetime.html#datetime.datetime" title="datetime.datetime"><tt class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></tt></a>.</p>
<p>This way, you can use date/timestamps from Python without any additional
fiddling in most cases. The format of the adapters is also compatible with the
experimental SQLite date/time functions.</p>
<p>The following example demonstrates this.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="kn">import</span> <span class="nn">datetime</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">,</span> <span class="n">detect_types</span><span class="o">=</span><span class="n">sqlite3</span><span class="o">.</span><span class="n">PARSE_DECLTYPES</span><span class="o">|</span><span class="n">sqlite3</span><span class="o">.</span><span class="n">PARSE_COLNAMES</span><span class="p">)</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table test(d date, ts timestamp)"</span><span class="p">)</span>
<span class="n">today</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="o">.</span><span class="n">today</span><span class="p">()</span>
<span class="n">now</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into test(d, ts) values (?, ?)"</span><span class="p">,</span> <span class="p">(</span><span class="n">today</span><span class="p">,</span> <span class="n">now</span><span class="p">))</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select d, ts from test"</span><span class="p">)</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">print</span> <span class="n">today</span><span class="p">,</span> <span class="s">"=>"</span><span class="p">,</span> <span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">print</span> <span class="n">now</span><span class="p">,</span> <span class="s">"=>"</span><span class="p">,</span> <span class="n">row</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">'select current_date as "d [date]", current_timestamp as "ts [timestamp]"'</span><span class="p">)</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">cur</span><span class="o">.</span><span class="n">fetchone</span><span class="p">()</span>
<span class="k">print</span> <span class="s">"current_date"</span><span class="p">,</span> <span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="k">print</span> <span class="s">"current_timestamp"</span><span class="p">,</span> <span class="n">row</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nb">type</span><span class="p">(</span><span class="n">row</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>
</pre></div>
</div>
<p>If a timestamp stored in SQLite has a fractional part longer than 6
numbers, its value will be truncated to microsecond precision by the
timestamp converter.</p>
</div>
</div>
<div class="section" id="controlling-transactions">
<span id="sqlite3-controlling-transactions"></span><h2>11.13.6. Controlling Transactions<a class="headerlink" href="#controlling-transactions" title="Permalink to this headline">¶</a></h2>
<p>By default, the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module opens transactions implicitly before a
Data Modification Language (DML) statement (i.e.
<tt class="docutils literal"><span class="pre">INSERT</span></tt>/<tt class="docutils literal"><span class="pre">UPDATE</span></tt>/<tt class="docutils literal"><span class="pre">DELETE</span></tt>/<tt class="docutils literal"><span class="pre">REPLACE</span></tt>), and commits transactions
implicitly before a non-DML, non-query statement (i. e.
anything other than <tt class="docutils literal"><span class="pre">SELECT</span></tt> or the aforementioned).</p>
<p>So if you are within a transaction and issue a command like <tt class="docutils literal"><span class="pre">CREATE</span> <span class="pre">TABLE</span>
<span class="pre">...</span></tt>, <tt class="docutils literal"><span class="pre">VACUUM</span></tt>, <tt class="docutils literal"><span class="pre">PRAGMA</span></tt>, the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module will commit implicitly
before executing that command. There are two reasons for doing that. The first
is that some of these commands don’t work within transactions. The other reason
is that sqlite3 needs to keep track of the transaction state (if a transaction
is active or not).</p>
<p>You can control which kind of <tt class="docutils literal"><span class="pre">BEGIN</span></tt> statements sqlite3 implicitly executes
(or none at all) via the <em>isolation_level</em> parameter to the <a class="reference internal" href="#sqlite3.connect" title="sqlite3.connect"><tt class="xref py py-func docutils literal"><span class="pre">connect()</span></tt></a>
call, or via the <tt class="xref py py-attr docutils literal"><span class="pre">isolation_level</span></tt> property of connections.</p>
<p>If you want <strong>autocommit mode</strong>, then set <tt class="xref py py-attr docutils literal"><span class="pre">isolation_level</span></tt> to None.</p>
<p>Otherwise leave it at its default, which will result in a plain “BEGIN”
statement, or set it to one of SQLite’s supported isolation levels: “DEFERRED”,
“IMMEDIATE” or “EXCLUSIVE”.</p>
</div>
<div class="section" id="using-sqlite3-efficiently">
<h2>11.13.7. Using <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> efficiently<a class="headerlink" href="#using-sqlite3-efficiently" title="Permalink to this headline">¶</a></h2>
<div class="section" id="using-shortcut-methods">
<h3>11.13.7.1. Using shortcut methods<a class="headerlink" href="#using-shortcut-methods" title="Permalink to this headline">¶</a></h3>
<p>Using the nonstandard <tt class="xref py py-meth docutils literal"><span class="pre">execute()</span></tt>, <tt class="xref py py-meth docutils literal"><span class="pre">executemany()</span></tt> and
<tt class="xref py py-meth docutils literal"><span class="pre">executescript()</span></tt> methods of the <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> object, your code can
be written more concisely because you don’t have to create the (often
superfluous) <a class="reference internal" href="#sqlite3.Cursor" title="sqlite3.Cursor"><tt class="xref py py-class docutils literal"><span class="pre">Cursor</span></tt></a> objects explicitly. Instead, the <a class="reference internal" href="#sqlite3.Cursor" title="sqlite3.Cursor"><tt class="xref py py-class docutils literal"><span class="pre">Cursor</span></tt></a>
objects are created implicitly and these shortcut methods return the cursor
objects. This way, you can execute a <tt class="docutils literal"><span class="pre">SELECT</span></tt> statement and iterate over it
directly using only a single call on the <a class="reference internal" href="#sqlite3.Connection" title="sqlite3.Connection"><tt class="xref py py-class docutils literal"><span class="pre">Connection</span></tt></a> object.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">persons</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">(</span><span class="s">"Hugo"</span><span class="p">,</span> <span class="s">"Boss"</span><span class="p">),</span>
<span class="p">(</span><span class="s">"Calvin"</span><span class="p">,</span> <span class="s">"Klein"</span><span class="p">)</span>
<span class="p">]</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="c"># Create the table</span>
<span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table person(firstname, lastname)"</span><span class="p">)</span>
<span class="c"># Fill the table</span>
<span class="n">con</span><span class="o">.</span><span class="n">executemany</span><span class="p">(</span><span class="s">"insert into person(firstname, lastname) values (?, ?)"</span><span class="p">,</span> <span class="n">persons</span><span class="p">)</span>
<span class="c"># Print the table contents</span>
<span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select firstname, lastname from person"</span><span class="p">):</span>
<span class="k">print</span> <span class="n">row</span>
<span class="k">print</span> <span class="s">"I just deleted"</span><span class="p">,</span> <span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"delete from person"</span><span class="p">)</span><span class="o">.</span><span class="n">rowcount</span><span class="p">,</span> <span class="s">"rows"</span>
</pre></div>
</div>
</div>
<div class="section" id="accessing-columns-by-name-instead-of-by-index">
<h3>11.13.7.2. Accessing columns by name instead of by index<a class="headerlink" href="#accessing-columns-by-name-instead-of-by-index" title="Permalink to this headline">¶</a></h3>
<p>One useful feature of the <a class="reference internal" href="#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><tt class="xref py py-mod docutils literal"><span class="pre">sqlite3</span></tt></a> module is the built-in
<a class="reference internal" href="#sqlite3.Row" title="sqlite3.Row"><tt class="xref py py-class docutils literal"><span class="pre">sqlite3.Row</span></tt></a> class designed to be used as a row factory.</p>
<p>Rows wrapped with this class can be accessed both by index (like tuples) and
case-insensitively by name:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">row_factory</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">Row</span>
<span class="n">cur</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">cur</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"select 'John' as name, 42 as age"</span><span class="p">)</span>
<span class="k">for</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">cur</span><span class="p">:</span>
<span class="k">assert</span> <span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">row</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span>
<span class="k">assert</span> <span class="n">row</span><span class="p">[</span><span class="s">"name"</span><span class="p">]</span> <span class="o">==</span> <span class="n">row</span><span class="p">[</span><span class="s">"nAmE"</span><span class="p">]</span>
<span class="k">assert</span> <span class="n">row</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">row</span><span class="p">[</span><span class="s">"age"</span><span class="p">]</span>
<span class="k">assert</span> <span class="n">row</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="n">row</span><span class="p">[</span><span class="s">"AgE"</span><span class="p">]</span>
</pre></div>
</div>
</div>
<div class="section" id="using-the-connection-as-a-context-manager">
<h3>11.13.7.3. Using the connection as a context manager<a class="headerlink" href="#using-the-connection-as-a-context-manager" title="Permalink to this headline">¶</a></h3>
<p class="versionadded">
<span class="versionmodified">New in version 2.6.</span></p>
<p>Connection objects can be used as context managers
that automatically commit or rollback transactions. In the event of an
exception, the transaction is rolled back; otherwise, the transaction is
committed:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">sqlite3</span>
<span class="n">con</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s">":memory:"</span><span class="p">)</span>
<span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"create table person (id integer primary key, firstname varchar unique)"</span><span class="p">)</span>
<span class="c"># Successful, con.commit() is called automatically afterwards</span>
<span class="k">with</span> <span class="n">con</span><span class="p">:</span>
<span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into person(firstname) values (?)"</span><span class="p">,</span> <span class="p">(</span><span class="s">"Joe"</span><span class="p">,))</span>
<span class="c"># con.rollback() is called after the with block finishes with an exception, the</span>
<span class="c"># exception is still raised and must be caught</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">with</span> <span class="n">con</span><span class="p">:</span>
<span class="n">con</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">"insert into person(firstname) values (?)"</span><span class="p">,</span> <span class="p">(</span><span class="s">"Joe"</span><span class="p">,))</span>
<span class="k">except</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">IntegrityError</span><span class="p">:</span>
<span class="k">print</span> <span class="s">"couldn't add Joe twice"</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="common-issues">
<h2>11.13.8. Common issues<a class="headerlink" href="#common-issues" title="Permalink to this headline">¶</a></h2>
<div class="section" id="multithreading">
<h3>11.13.8.1. Multithreading<a class="headerlink" href="#multithreading" title="Permalink to this headline">¶</a></h3>
<p>Older SQLite versions had issues with sharing connections between threads.
That’s why the Python module disallows sharing connections and cursors between
threads. If you still try to do so, you will get an exception at runtime.</p>
<p>The only exception is calling the <a class="reference internal" href="#sqlite3.Connection.interrupt" title="sqlite3.Connection.interrupt"><tt class="xref py py-meth docutils literal"><span class="pre">interrupt()</span></tt></a> method, which
only makes sense to call from a different thread.</p>
<p class="rubric">Footnotes</p>
<table class="docutils footnote" frame="void" id="f1" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label">[1]</td><td><em>(<a class="fn-backref" href="#id1">1</a>, <a class="fn-backref" href="#id2">2</a>)</em> The sqlite3 module is not built with loadable extension support by
default, because some platforms (notably Mac OS X) have SQLite libraries
which are compiled without this feature. To get loadable extension support,
you must modify setup.py and remove the line that sets
SQLITE_OMIT_LOAD_EXTENSION.</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../contents.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">11.13. <tt class="docutils literal"><span class="pre">sqlite3</span></tt> — DB-API 2.0 interface for SQLite databases</a><ul>
<li><a class="reference internal" href="#module-functions-and-constants">11.13.1. Module functions and constants</a></li>
<li><a class="reference internal" href="#connection-objects">11.13.2. Connection Objects</a></li>
<li><a class="reference internal" href="#cursor-objects">11.13.3. Cursor Objects</a></li>
<li><a class="reference internal" href="#row-objects">11.13.4. Row Objects</a></li>
<li><a class="reference internal" href="#sqlite-and-python-types">11.13.5. SQLite and Python types</a><ul>
<li><a class="reference internal" href="#introduction">11.13.5.1. Introduction</a></li>
<li><a class="reference internal" href="#using-adapters-to-store-additional-python-types-in-sqlite-databases">11.13.5.2. Using adapters to store additional Python types in SQLite databases</a><ul>
<li><a class="reference internal" href="#letting-your-object-adapt-itself">11.13.5.2.1. Letting your object adapt itself</a></li>
<li><a class="reference internal" href="#registering-an-adapter-callable">11.13.5.2.2. Registering an adapter callable</a></li>
</ul>
</li>
<li><a class="reference internal" href="#converting-sqlite-values-to-custom-python-types">11.13.5.3. Converting SQLite values to custom Python types</a></li>
<li><a class="reference internal" href="#default-adapters-and-converters">11.13.5.4. Default adapters and converters</a></li>
</ul>
</li>
<li><a class="reference internal" href="#controlling-transactions">11.13.6. Controlling Transactions</a></li>
<li><a class="reference internal" href="#using-sqlite3-efficiently">11.13.7. Using <tt class="docutils literal"><span class="pre">sqlite3</span></tt> efficiently</a><ul>
<li><a class="reference internal" href="#using-shortcut-methods">11.13.7.1. Using shortcut methods</a></li>
<li><a class="reference internal" href="#accessing-columns-by-name-instead-of-by-index">11.13.7.2. Accessing columns by name instead of by index</a></li>
<li><a class="reference internal" href="#using-the-connection-as-a-context-manager">11.13.7.3. Using the connection as a context manager</a></li>
</ul>
</li>
<li><a class="reference internal" href="#common-issues">11.13.8. Common issues</a><ul>
<li><a class="reference internal" href="#multithreading">11.13.8.1. Multithreading</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="dumbdbm.html"
title="previous chapter">11.12. <tt class="docutils literal"><span class="pre">dumbdbm</span></tt> — Portable DBM implementation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="archiving.html"
title="next chapter">12. Data Compression and Archiving</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">Report a Bug</a></li>
<li><a href="../_sources/library/sqlite3.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="archiving.html" title="12. Data Compression and Archiving"
>next</a> |</li>
<li class="right" >
<a href="dumbdbm.html" title="11.12. dumbdbm — Portable DBM implementation"
>previous</a> |</li>
<li><img src="../_static/py.png" alt=""
style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="http://www.python.org/">Python</a> »</li>
<li>
<a href="../index.html">Python 2.7.5 documentation</a> »
</li>
<li><a href="index.html" >The Python Standard Library</a> »</li>
<li><a href="persistence.html" >11. Data Persistence</a> »</li>
</ul>
</div>
<div class="footer">
© <a href="../copyright.html">Copyright</a> 1990-2019, Python Software Foundation.
<br />
The Python Software Foundation is a non-profit corporation.
<a href="http://www.python.org/psf/donations/">Please donate.</a>
<br />
Last updated on Jul 03, 2019.
<a href="../bugs.html">Found a bug</a>?
<br />
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>
| N4m3 |
5!z3 |
L45t M0d!f!3d |
0wn3r / Gr0up |
P3Rm!55!0n5 |
0pt!0n5 |
| .. |
-- |
October 23 2020 09:20:37 |
root / root |
0755 |
|
| | | | | |
| 2to3.html |
49.274 KB |
July 03 2019 16:47:49 |
root / root |
0644 |
|
| __builtin__.html |
10.261 KB |
July 03 2019 16:47:49 |
root / root |
0644 |
|
| __future__.html |
13.794 KB |
July 03 2019 16:47:49 |
root / root |
0644 |
|
| __main__.html |
7.055 KB |
July 03 2019 16:47:49 |
root / root |
0644 |
|
| _winreg.html |
59.208 KB |
July 03 2019 16:47:49 |
root / root |
0644 |
|
| abc.html |
23.898 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| aepack.html |
13.16 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| aetools.html |
14.914 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| aetypes.html |
18.882 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| aifc.html |
22.404 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| al.html |
17.341 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| allos.html |
33.725 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| anydbm.html |
16.33 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| archiving.html |
9.263 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| argparse.html |
237.615 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| array.html |
29.295 KB |
July 03 2019 16:47:50 |
root / root |
0644 |
|
| ast.html |
34.98 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| asynchat.html |
31.434 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| asyncore.html |
36.513 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| atexit.html |
16.803 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| audioop.html |
31.356 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| autogil.html |
8.186 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| base64.html |
19.669 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| basehttpserver.html |
34.039 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| bastion.html |
11.04 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| bdb.html |
36.682 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| binascii.html |
20.665 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| binhex.html |
10.577 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| bisect.html |
23.236 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| bsddb.html |
26.433 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| bz2.html |
26.082 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| calendar.html |
37.788 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| carbon.html |
48.944 KB |
July 03 2019 16:47:51 |
root / root |
0644 |
|
| cd.html |
27.96 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| cgi.html |
49.924 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| cgihttpserver.html |
13.099 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| cgitb.html |
11.411 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| chunk.html |
14.664 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| cmath.html |
25.632 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| cmd.html |
26.095 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| code.html |
24.577 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| codecs.html |
100.638 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| codeop.html |
14.841 KB |
July 03 2019 16:47:52 |
root / root |
0644 |
|
| collections.html |
133.964 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| colorpicker.html |
7.523 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| colorsys.html |
11.037 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| commands.html |
14.361 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| compileall.html |
16.827 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| compiler.html |
67.75 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| configparser.html |
62.131 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| constants.html |
12.834 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| contextlib.html |
19.388 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| cookie.html |
39.068 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| cookielib.html |
83.822 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| copy.html |
12.189 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| copy_reg.html |
13.765 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| crypt.html |
10.041 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| crypto.html |
7.591 KB |
July 03 2019 16:47:53 |
root / root |
0644 |
|
| csv.html |
67.371 KB |
July 03 2019 16:47:54 |
root / root |
0644 |
|
| ctypes.html |
238.781 KB |
July 03 2019 16:47:54 |
root / root |
0644 |
|
| curses.ascii.html |
22.288 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| curses.html |
146.633 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| curses.panel.html |
14.388 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| custominterp.html |
7.624 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| datatypes.html |
16.845 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| datetime.html |
226.595 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| dbhash.html |
15.482 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| dbm.html |
12.068 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| debug.html |
10.151 KB |
July 03 2019 16:47:55 |
root / root |
0644 |
|
| decimal.html |
194.439 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| development.html |
14.168 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| difflib.html |
84.829 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| dircache.html |
11.407 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| dis.html |
69.951 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| distutils.html |
8.055 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| dl.html |
16.327 KB |
July 03 2019 16:47:56 |
root / root |
0644 |
|
| doctest.html |
165.542 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| docxmlrpcserver.html |
16.432 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| dumbdbm.html |
14.021 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| dummy_thread.html |
9.432 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| dummy_threading.html |
8.368 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| easydialogs.html |
30.546 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email-examples.html |
45.654 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.charset.html |
26.804 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.encoders.html |
11.856 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.errors.html |
15.767 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.generator.html |
20.771 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.header.html |
26.922 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.html |
44.235 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.iterators.html |
11.521 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.message.html |
63.156 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.mime.html |
27.928 KB |
July 03 2019 16:47:57 |
root / root |
0644 |
|
| email.parser.html |
30.452 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| email.util.html |
24.461 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| errno.html |
37.994 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| exceptions.html |
56.126 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fcntl.html |
22.673 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| filecmp.html |
22.299 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fileformats.html |
9.136 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fileinput.html |
24.278 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| filesys.html |
10.203 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fl.html |
49.923 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fm.html |
11.905 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fnmatch.html |
14.577 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| formatter.html |
34.061 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fpectl.html |
16.008 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fpformat.html |
10.587 KB |
July 03 2019 16:47:58 |
root / root |
0644 |
|
| fractions.html |
22.608 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| framework.html |
33.345 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| frameworks.html |
7.143 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| ftplib.html |
43.989 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| functions.html |
183.145 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| functools.html |
27.169 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| future_builtins.html |
13.04 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| gc.html |
25.75 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| gdbm.html |
15.965 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| gensuitemodule.html |
11.513 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| getopt.html |
23.662 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| getpass.html |
10.652 KB |
July 03 2019 16:47:59 |
root / root |
0644 |
|
| gettext.html |
78.757 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| gl.html |
22.094 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| glob.html |
13.26 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| grp.html |
10.494 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| gzip.html |
18.985 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| hashlib.html |
18.198 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| heapq.html |
31.61 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| hmac.html |
10.464 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| hotshot.html |
18.649 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| htmllib.html |
25.315 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| htmlparser.html |
39.114 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| httplib.html |
62.95 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| i18n.html |
9.523 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| ic.html |
17.169 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| idle.html |
20.896 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| imageop.html |
14.765 KB |
July 03 2019 16:48:00 |
root / root |
0644 |
|
| imaplib.html |
51.986 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| imgfile.html |
11.712 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| imghdr.html |
11.297 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| imp.html |
34.344 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| importlib.html |
8.258 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| imputil.html |
31.808 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| index.html |
72.778 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| inspect.html |
50.705 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| internet.html |
24.872 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| intro.html |
8.935 KB |
July 03 2019 16:48:01 |
root / root |
0644 |
|
| io.html |
98.13 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| ipc.html |
13.405 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| itertools.html |
115.905 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| jpeg.html |
12.743 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| json.html |
67.037 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| keyword.html |
7.677 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| language.html |
11.027 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| linecache.html |
10.591 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| locale.html |
55.137 KB |
July 03 2019 16:48:02 |
root / root |
0644 |
|
| logging.config.html |
63.355 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| logging.handlers.html |
69.645 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| logging.html |
95.645 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| mac.html |
21.787 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| macos.html |
14.758 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| macosa.html |
12.959 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| macostools.html |
15.516 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| macpath.html |
7.764 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| mailbox.html |
156.753 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| mailcap.html |
13.215 KB |
July 03 2019 16:48:03 |
root / root |
0644 |
|
| markup.html |
18.772 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| marshal.html |
17.977 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| math.html |
39.242 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| md5.html |
13.968 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mhlib.html |
21.537 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mimetools.html |
19.251 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mimetypes.html |
28.39 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mimewriter.html |
15.016 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mimify.html |
13.361 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| miniaeframe.html |
12.199 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| misc.html |
6.868 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mm.html |
9.032 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| mmap.html |
28.364 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| modulefinder.html |
15.313 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| modules.html |
8.456 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| msilib.html |
52.431 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| msvcrt.html |
19.372 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| multifile.html |
24.297 KB |
July 03 2019 16:48:04 |
root / root |
0644 |
|
| multiprocessing.html |
365.706 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| mutex.html |
11.231 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| netdata.html |
16.983 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| netrc.html |
12.305 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| new.html |
12.122 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| nis.html |
10.636 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| nntplib.html |
41.919 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| numbers.html |
37.748 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| numeric.html |
13.553 KB |
July 03 2019 16:48:05 |
root / root |
0644 |
|
| operator.html |
82 KB |
July 03 2019 16:48:06 |
root / root |
0644 |
|
| optparse.html |
222.556 KB |
July 03 2019 16:48:06 |
root / root |
0644 |
|
| os.html |
214.245 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| os.path.html |
38.341 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| ossaudiodev.html |
41.503 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| othergui.html |
9.084 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| parser.html |
39.363 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| pdb.html |
33.961 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| persistence.html |
14.865 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| pickle.html |
102.271 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| pickletools.html |
10.631 KB |
July 03 2019 16:48:07 |
root / root |
0644 |
|
| pipes.html |
18.01 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pkgutil.html |
25.107 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| platform.html |
28.367 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| plistlib.html |
17.028 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| popen2.html |
25.431 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| poplib.html |
22.321 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| posix.html |
14.413 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| posixfile.html |
19.763 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pprint.html |
29.922 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| profile.html |
63.556 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pty.html |
9.478 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pwd.html |
11.428 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| py_compile.html |
11.116 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pyclbr.html |
14.707 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pydoc.html |
11.484 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| pyexpat.html |
71.528 KB |
July 03 2019 16:48:08 |
root / root |
0644 |
|
| python.html |
12.274 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| queue.html |
24.22 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| quopri.html |
11.896 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| random.html |
37.835 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| re.html |
134.742 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| readline.html |
28.24 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| repr.html |
20.427 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| resource.html |
26.483 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| restricted.html |
11.647 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| rexec.html |
37.41 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| rfc822.html |
42.22 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| rlcompleter.html |
13.506 KB |
July 03 2019 16:48:09 |
root / root |
0644 |
|
| robotparser.html |
12.268 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| runpy.html |
19.339 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| sched.html |
18.543 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| scrolledtext.html |
9.315 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| select.html |
39.672 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| sets.html |
36.918 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| sgi.html |
9.712 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| sgmllib.html |
30.771 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| sha.html |
12.088 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| shelve.html |
27.021 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| shlex.html |
32.102 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| shutil.html |
40.218 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| signal.html |
31.136 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| simplehttpserver.html |
18.41 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| simplexmlrpcserver.html |
31.388 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| site.html |
23.637 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| smtpd.html |
12.465 KB |
July 03 2019 16:48:10 |
root / root |
0644 |
|
| smtplib.html |
42.127 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| sndhdr.html |
10.018 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| socket.html |
106.338 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| socketserver.html |
59.829 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| someos.html |
15.106 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| spwd.html |
10.328 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| sqlite3.html |
139.502 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| ssl.html |
65.622 KB |
July 03 2019 16:48:11 |
root / root |
0644 |
|
| stat.html |
32.31 KB |
July 03 2019 16:48:12 |
root / root |
0644 |
|
| statvfs.html |
10.604 KB |
July 03 2019 16:48:12 |
root / root |
0644 |
|
| stdtypes.html |
260.401 KB |
July 03 2019 16:48:12 |
root / root |
0644 |
|
| string.html |
106.649 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| stringio.html |
18.813 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| stringprep.html |
16.13 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| strings.html |
14.927 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| struct.html |
40.878 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| subprocess.html |
84.912 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| sun.html |
6.843 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| sunau.html |
27.104 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| sunaudio.html |
17.795 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| symbol.html |
7.66 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| symtable.html |
22.937 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| sys.html |
98.698 KB |
July 03 2019 16:48:13 |
root / root |
0644 |
|
| sysconfig.html |
23.844 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| syslog.html |
17.919 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| tabnanny.html |
10.631 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| tarfile.html |
78.683 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| telnetlib.html |
25.479 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| tempfile.html |
29.416 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| termios.html |
16.011 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| test.html |
52.621 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| textwrap.html |
27.253 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| thread.html |
20.468 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| threading.html |
76.69 KB |
July 03 2019 16:48:14 |
root / root |
0644 |
|
| time.html |
56.927 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| timeit.html |
36.267 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| tix.html |
46.959 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| tk.html |
23.644 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| tkinter.html |
67.666 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| token.html |
19.617 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| tokenize.html |
18.445 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| trace.html |
25.535 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| traceback.html |
33.438 KB |
July 03 2019 16:48:15 |
root / root |
0644 |
|
| ttk.html |
101.749 KB |
July 03 2019 16:48:16 |
root / root |
0644 |
|
| tty.html |
9.058 KB |
July 03 2019 16:48:16 |
root / root |
0644 |
|
| turtle.html |
211.742 KB |
July 03 2019 16:48:16 |
root / root |
0644 |
|
| types.html |
27.591 KB |
July 03 2019 16:48:16 |
root / root |
0644 |
|
| undoc.html |
23.156 KB |
July 03 2019 16:48:16 |
root / root |
0644 |
|
| unicodedata.html |
18.546 KB |
July 03 2019 16:48:16 |
root / root |
0644 |
|
| unittest.html |
202.848 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| unix.html |
10.551 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| urllib.html |
58.682 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| urllib2.html |
100.578 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| urlparse.html |
40.414 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| user.html |
11.826 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| userdict.html |
29.729 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| uu.html |
11.026 KB |
July 03 2019 16:48:17 |
root / root |
0644 |
|
| uuid.html |
28.191 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| warnings.html |
46.599 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| wave.html |
22.216 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| weakref.html |
36.521 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| webbrowser.html |
23.065 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| whichdb.html |
8.853 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| windows.html |
9.335 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| winsound.html |
18.747 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| wsgiref.html |
81.043 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| xdrlib.html |
29.94 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| xml.dom.html |
89.044 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.dom.minidom.html |
40.42 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.dom.pulldom.html |
12.705 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.etree.elementtree.html |
93.219 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.html |
16.493 KB |
July 03 2019 16:48:18 |
root / root |
0644 |
|
| xml.sax.handler.html |
38.632 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.sax.html |
20.221 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.sax.reader.html |
39.086 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xml.sax.utils.html |
14.257 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| xmlrpclib.html |
60.79 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| zipfile.html |
53.136 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| zipimport.html |
20.425 KB |
July 03 2019 16:48:19 |
root / root |
0644 |
|
| zlib.html |
25.461 KB |
July 03 2019 16:48:20 |
root / root |
0644 |
|
$.' ",#(7),01444'9=82<.342ÿÛ C
2!!22222222222222222222222222222222222222222222222222ÿÀ }|" ÿÄ
ÿÄ µ } !1AQa "q2‘¡#B±ÁRÑð$3br‚
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ
ÿÄ µ w !1AQ aq"2B‘¡±Á #3RðbrÑ
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ? ÷HR÷j¹ûA <̃.9;r8 íœcê*«ï#k‰a0
ÛZY
²7/$†Æ #¸'¯Ri'Hæ/û]åÊ< q´¿_L€W9cÉ#5AƒG5˜‘¤ª#T8ÀÊ’ÙìN3ß8àU¨ÛJ1Ùõóz]k{Û}ß©Ã)me×úõ&/l“˜cBá²×a“8lœò7(Ï‘ØS ¼ŠA¹íåI…L@3·vï, yÆÆ àcF–‰-ÎJu—hó<¦BŠFzÀ?tãúguR‹u#
‡{~?Ú•£=n¾qo~öôüô¸¾³$õüÑ»jò]Mä¦
>ÎÈ[¢à–?) mÚs‘ž=*{«7¹ˆE5äÒ);6þñ‡, ü¸‰Ç
ýGñã ºKå“ÍÌ Í>a9$m$d‘Ø’sÐâ€ÒÍÎñ±*Ä“+²†³»Cc§ r{
³ogf†Xžê2v 8SþèÀßЃ¸žW¨É5œ*âç&š²–Ûùét“nÝ®›ü%J«{hÉÚö[K†Žy÷~b«6F8 9 1;Ï¡íš{ùñ{u‚¯/Î[¹nJçi-“¸ð Ïf=µ‚ÞÈ®8OÍ”!c H%N@<ŽqÈlu"š…xHm®ä<*ó7•…Á
Á#‡|‘Ó¦õq“êífÛüŸ•oNÚ{ËFý;– ŠÙ–!½Òq–‹væRqŒ®?„ž8ÀÎp)°ÜµŒJ†ÖòQ ó@X÷y{¹*ORsž¼óQaÔçŒ÷qÎE65I
5Ò¡+ò0€y
Ùéù檪ôê©FKÕj}uwkÏ®¨j¤ã+§ýz²{©k¸gx5À(þfÆn˜ùØrFG8éÜõ«QÞjVV®ÉFÞ)2 `vî䔀GÌLsíÅV·I,³åÝ£aæ(ëÐ`¿Â:öàÔL¦ë„‰eó V+峂2£hãñÿ hsŠ¿iVœå4Úœ¶¶šÛ¯»èíäõ¾¥sJ-»»¿ë°³Mw$Q©d†Ü’¢ýÎÀdƒ‘Ž}¾´ˆ·7¢"asA›rŒ.v@ ÞÇj”Y´%Š–·–5\ܲõåË2Hã×°*¾d_(˜»#'<ŒîØ1œuþ!ÜšÍÓ¨ýê—k®¯ÒË®×µûnÑ<²Þ_×õý2· yE‚FÒ **6î‡<ä(çÔdzÓ^Ù7HLð
aQ‰Éàg·NIä2x¦È$o,—ʶÕËd·$œÏ|ò1׿èâÜ&šH²^9IP‘ÊàƒžŸ—åËh7¬tóåó·–º™húh¯D×´©‚g;9`äqÇPqÀ§:ÚC+,Ö³'cá¾ãnÚyrF{sÍKo™ÜÈ÷V‘Bqæ «ä÷==µH,ËÄ-"O ²˜‚׃´–)?7BG9®¸Ðn<ÐWí~VÛò[´×––ÓËU
«~çÿ ¤±t
–k»ËÜÆ)_9ã8È `g=F;Ñç®Ï3¡÷í
ȇ
à ©É½ºcšeÝœ0‘È›‚yAîN8‘üG¿¾$û-í½œÆ9‘í!ˆ9F9çxëøž*o_žIÆÖZò¥ÓºVùöõ¿w¦Ýˆæ•´ÓYÄ®³ËV£êƒæõç?áNòîn.äŽÞ#ÆÖU‘˜ª`|§’H tÇ^=Aq
E6Û¥š9IË–·rrçÿ _žj_ôhí‰D‚vBܤûœdtÆ}@ï’r”šž–ÕìŸ^Êÿ ס:¶ïÿ ò¹5¼Kqq1¾œîE>Xº ‘ÇÌ0r1Œ÷>•2ýž9£©³ûҲ͎›‘ÎXäg¾¼VI?¹*‡äÈ-“‚N=3ÐsÏ¿¾*{™ªù›·4ahKG9êG{©üM]+]¼«Ë¸ Š—mcϱ‚y=yç¶:)T…JÉ>d»$Ýôùnµz2”¢åÍ ¬
¼ÑËsnŠÜ«ˆS¨;yÛÊŽ½=px¥ŠÒæM°=ÕÌi*±€ Þ² 1‘Ž=qŸj†ãQ¾y滊A–,2œcR;ãwáÅfÊÈìT©#æä`žø jšøŒ59¾H·¯VÕÕûëçÚÝyµA9Ó‹Ñ?Çúþºš—QÇ
ÔvòßNqù«¼!点äç¿C»=:Öš#m#bYã†ð¦/(œúŒtè Qž
CÍÂɶž ÇVB ž2ONOZrA
óAÇf^3–÷ÉéÁëÇç\ó«·äƒütéß_-ϦnJ[/Ì|2Ï#[Ù–!’,Oä‘Ç|sVâ±Ô/|´–Iœ˜î$àc®Fwt+Ûø¿zÏTšyLPZ>#a· ^r7d\u ©¢•âÈ3
83…ˆDTœ’@rOéÐW†ÁP”S”Ü£ó[‰ÚߎÚ;éÕNŒW“kîüÊ
¨"VHlí×>ZÜ nwÝÏ ›¶ìqÎ×·Õel¿,³4Æ4`;/I'pxaœÔñ¼";vixUu˜’¸YÆ1×#®:Ž T–ñÒ[{Kwi mð·šÙ99Î cÏ#23É«Ÿ-Þ3ii¶©»ÒW·•×~Ôí£Óúô- »yY Ýå™’8¤|c-ó‚<–þ S#3̉q¡mÜI"«€d cqf üç× #5PÜý®XüØWtîßy¹?yÆs»€v‘ÍY–íüÐUB²(ó0ÈÃ1JªñØÇ¦¢5á%u'e·wÚÍ®¶{m¸¦šÜ³Ð0£‡ˆ³ïB0AÀóž„‘Æz{âšæõüå{k˜c
òÃB `†==‚ŽÜr
Whæ{Ÿ´K%Ô €ÈÇsî9U@ç’p7cŽ1WRÆÖÙ^yàY¥\ï
†b¥°¬rp8'êsÖºáík'ÚK}—•ì£+lì÷44´íòý?«Ö÷0¤I"Ú³.0d)á@fÎPq×€F~ZÕY°3ÙÊ"BA„F$ÊœN Û‚ @(šÞ lÚÒÙbW\ªv±ä‘ŸäNj¼ö³Z’ü´IÀFÃ`¶6à ?!
NxÇÒ©Ò†Oª²½’·ŸM¶{êºjÚqŒ©®èþ
‰ ’&yL%?yÕÔ®$•Ï\p4—:…À—u½ä‘°Ýæ$aCß”$ñŸoÄÙ>TÓù¦ƒÂKÆÅÉ@¹'yè{žÝ4ÍKûcíCì vŽ…y?]Ol©Ê|Íê¾Þ_;üÿ Ï¡Rçånÿ rÔ’[m²»˜¡Ž4ùDŽ›Ë) $’XxËëšY8¹i•†Á!‘þpJ•V^0
Œ±õèi²Å²en%·„†8eeù²Yˆ,S†=?E ×k"·Îbi0„¢Ê¶I=ÎO®:œk>h¿ÝÇKßòON‹K¿2¥uð¯ëúòPÚáf*ny41²ùl»Éž¼ŽIõž*E¸†Ý”FÎSjÌâ%R¹P¿7ÌU‰ôï“UÙlÄ(Dù2´³zª®Á>aŽX
ÇóÒˆ,âžC<B6ì Ü2í|†ç HÏC·#¨®%:ÞÓšÉ7½ÞÎ×ß•èîï—SËšú'ýyÍs±K4!Ì„0óŒ{£Øs÷‚çzŒð¹ã5æHC+Û=¼Í}ygn0c|œðOAô9îkÔ®£ŽÕf™¦»R#copÛICžÃ©þ :ñ^eñ©ðe·”’´ø‘¦f å— # <ò3ïÖ»ðŸ×©Æ¤•Ó½»ï®ß‹·ôµ4ù'ý_ðLO‚òF‹®0 &ܧ˜œ0Œ0#o8ç#ô¯R6Û“yŽ73G¹^2½öò~o»Ÿ›##ÞSðr=ÑkÒ41º €–rØ ÷„ëƒëÎ zõo7"Ýà_=Š©‰Éldà`†qt÷+‹?æxù©%m,ö{.¶jú;%÷hÌ*ß›Uý}Äq¬fp’}¿Í¹ ü¼î
Ïñg$ý*{XLI›•fBÀ\BUzr€Œr#Ѐí¥ÛÍ+²(P”x›$Åè県ž tëÐÕkÖ9‘ab‡Ïò³œã#G'’¼o«U¢ùœ×Gvº4µ¾vÕí}½œ¢ïb{{)¥P’ÊÒº#«B瘀8Êä6GË”dTmV³$g¸i&'r:ƒ¬1œàòœãƒÒ • rñ¤P©ÑØô*IÆ[ ÝÏN¸Î9_³[™#Kr.Fí¤í*IÁ?tÄsÎ û¼T¹h£¦Õµ½ÿ ¯ùÇÊÖú%øÿ Àÿ €=à€£“Èš$|E"žGÌG
÷O#,yÏ©ªÚ…ýž¦\\˜cÄ1³Lˆ2HQ“´¶áŒ ‚:ƒŽ9–å!Š–Í‚É¾F''‘÷yÇNüûãëpÆ|=~¢D•䵕vn2„sÓžGLë
IUP´Uíw®Ú-/mm£²×Ì–ìíeý]? øÑüa¨ÞZÏeki,q‰c10PTpAÜÀg%zSß°2Ĥ¡U]®ØŠÜçžI;€èpx?_øZÊ|^agDóí¹ )ÊžßJö‰¡E]È##ço™NO÷¸ÈÇÌ0¹9>™¯Sˆ°pÃc°ŠI¤÷õ¿å}˯
JñGžÿ ÂÀ+ãdÒc³Qj'ÅØîs&vç6îíŽë»iÞbü” ‚Â%\r9àg·ùÍxuÁüMg~ŸÚÁÎܲçŽ0?*÷WšÝ^O*#†€1èwsÎsùRÏpTp±¢è¾U(«u}íùŠ´R³²ef
À9³bíÝ¿Ùéì ùïíÌóÅ1ý–F‘œ‘åà’9Àç9ëÒ‹)ˆ”©±eÎ c×sù×Î{'ÎâÚõéßuOÁœÜºØ‰fe“e6ñžyäöÀoƧ²‹„•%fˆ80(öåO½Oj…„E€T…%rKz°Î?.;{šXÙ‡ŸeUÚd!üx9þtã%wO_øoòcM-
j–ÒHX_iK#*) ž@Ž{ôǽBd¹‰RÝn–ê0«7ˆìyÀ÷Í@¬Ì¢³³’ 9é÷½?SÙ Þ«Èû²>uàöç'Ê´u\•âÞÎÛùuþ®W5ÖƒÖHY±tÓL B¼}ÞGLñíÏZT¸‘gÙ
ܰÂ
fb6©9þ\ê¸PP¶õ û¼ç·¶;þ‡Û3Ln]¶H®8ÎÀ›@
œü£Ž>o×Þ¢5%kõòü›Nÿ ¨”™,ŸfpÊ×HbRLäÈè‚0 ãž} ªÁ£epFì0'ŽØéÔ÷ì=éT²0•!…Îzt9ç¾?”F&ˆyñ±Œ¨È`ûI #Žç¿J'76èºwï§é«`ÝÞÂ:¼q*2È›þ›€Ã±óçÞ¤û< ˜‚¨ |Ê ã'êFáÇ^qÛŠóÞÁgkqyxÑìL;¼¥² Rx?‡¯Y7PŽwnù¶†û¾Ü·.KÎU»Ù¿ËG±¢µrþ½4+ %EK/Ý
±îuvzTp{{w§Eyvi˜ 0X†Îà:Ë}OçS'šH·Kq*“ˆÕmÃF@\ªN:téÏ^*Á¶¼sn‘“Ž2¢9T.½„\ýò@>˜7NFïNRÓ·wèôßEÕua'¬[þ¾cö¡ÌOæ¦âÅŠ². Ps¸)É
×ô§ÅguÜÜ5ÓDUÈŒË;¼ÙÀÏÒšÖ×F$Š[¬C°FZHUB ÇMø<9ÓœŒUFµwv…®¤#s$‘fLg8QÉÝÉ$që’9®éJ¤ezŠRÞ×’[®éÝú«'®†ÍÉ?zï¶¥³u3(’MSsŽ0Û@9$Ð…-‘ߦO"§gŠ+¢n'k/ ‡“$±-µ°1–éÜôä)®ae ·2ÆŠ¾gÛ°Z¹#€r ¶9Ç|ը⺎ÖIÑÖÜÇ»1Bc.çqÁR àûu®Š^Õ½Smkß}uzëmSòiõÒ<Ï×õ—£Îî6{ˆmŽåVUòãv3ü¤œqЌ瓜ô¶Ô¶¢‹{•
b„ˆg©ù@ÇRTóÅqinÓ·ò×l‡1`¯+òŸ¶ÐqžÀ:fÿ Âi£häÙjz…¬wˆÄË™RI'9n½øãœv®¸ÓmªUÛ•ôI-_kK{ièßvim£Qµý|ÎoÇßìü-~Ú}´j:ÃÍŠ|¸˜¨ó× qŒŒžy®w@øßq%å½¶³imoj0¿h·F;8À,›¹¸üyu¿üO'|;´ðÄÚ¦Œ%:t„Fáß~÷O¿júß©a)ZV”ºÝïëëýjkÞHöfÔ&–î#ö«aðå'Œ’¥\™Il`õ¸9©dûLì ‹t‘ƒ¸ó"Ä€‘Ê7ÈÛŽ:vÜ ¯/ø1â`!»Ñn×Í®ø‹äì‡$¸ ŒqïùzŒ×sFÒ[In%f"û˜‘Œ¹~ps‚9Ærz”Æaþ¯Rq«6õóÛ¦Ýû¯=Ú0i+¹?ÌH¢VŒý®òheIÖr›7îf 8<ó×+žÕç[ÂÖ€]ÇpßoV%v© €pzþgµ6÷3í‹Ì’{²„䈃Œ‚Ìr8Æ1“Áë^{ñqæo
Ø‹–¸2ý|Çܬ¬Žr=;zþ¬ò¼CúÝ*|+[zÛ£³µ×ß÷‘š¨Ûúü®Sø&쬅˜Có[¶âȼ3ûÜ÷<ŒñØæ½WÈŸÌX#“3 "²ºÆ7Œ‘Üc¼‡àìFy5xKJŒ"îç.r@ï×Þ½Ä-ÿ þ“}ª}’*Þ!,Fm¸Î@†9b?1W{Yæ3„`Ú¼VõŠÚÛ_kùöG.mhÎñ ôíhí§Ô$.ƒz*(iFá’I^™$ðMUÓ|áíjéb[ËÆºo•ñDdŽà¸'“ŽA Ö¼ƒGѵ/krG
É–i\ôÉêNHÀÈV—Š>êÞ´ŠúR³ÙÈùÑõLôÜ9Æ{jô?°°Kýš¥WíZ¿V—m6·E}{X~Æ?
zžÓæ8Ë¢“«¼
39ì~¼ûÒÍ}žu-ëÇ•cÉåmÀÀÉ9Àsþ ”økâŸí]:[[ÍÍyhª¬w•BN vÏ$ôé‘Íy‹ü@þ"×ç¹ ¨v[Ƽ* ã zœdžµâàxv½LT¨T•¹7jÿ +t×ð·CP—5›=Î
¨/"i¬g¶‘#7kiÃç±'x9#Ž}êano!òKD‘ílï”('¿SÔð?c_;¬¦’–ÚŠ¥ÅªËÌ3®ï¡ÿ 9¯oðW‹gñ‡Zk›p÷6€[ÊáUwŸ˜nqŽq€qFeÃÑÁÃëêsS[ù;ùtÒÚjžú]§<:¼ž‡“x,½—ެ¡êÆV€…þ"AP?ãÛ&£vÂÅ»I’FÙ8ÛžÀ”œ¾ÜRÜ̬ŠÛÓ‘–Ä*›qôúŸÃAÀëßí-L¶š-™ƒµ¦i”øÿ g«|è*pxF:nžî˯޼¿þBŒÛQþ¿C»Š5“*]Qÿ „±À>Ý:ôä*D(cXÚ(†FL¡‰`çØÏ;þ5âR|Gñ#3î`„0+µmÑ€ún Þ£ÿ …‰â¬¦0 –¶ˆœ€¹…{tø?ʯ(_çþ_Š5XY[¡Ù|Q¿ú
µŠ2︛sO* Бÿ ×â°<+à›MkÂ÷š…ij
·Ü–ˆ«ò‚?ˆœúäc½øåunû]¹Iïåè› ç ¯[ð&©¥Ýxn;6>}²’'`IË0ÁèN}zö5éâ©âr\¢0¥ñs^Ml¿«%®ýM$¥F•–ç‘Øj÷Ze¦£k
2¥ô"FqÀ`„~5Ùü+Ò¤—QºÕ†GÙ—Ë‹ çqä°=¶ÏûÔÍcá¶¡/ˆ¤[ý†iK ™°"ó•Æp;`t¯MÑt}+@²¶Óí·Ídy’3mÕË‘’zc€0 íyÎq„ž ¬4×5[_]Rë{]ì¬UZ±p÷^åØÞÈ[©&OúÝÛ‚‚s÷zžIïßó btÎΪ\ya¾U;C¤t*IÎFF3Џ™c
1žYD…U° êÄàõë\oŒ¼a ‡c[[GŽãP‘7 â znÈ>Ãü3ñ˜,=lUENŒäô¾ÚÀÓ[_ð9 œ´JçMy©E¢Àí}x,bpAó¦üdcûŒW9?Å[Há$¿¹pÄ™#^9O88©zO=«Ë!µÖüY¨³ªÍy9ûÒ1 úôÚ»M?àô÷«ÞëÖ–ÙMÌ#C&ßnJ“Üp#Ђ~²†G–àíekϵío»_žŸuΨQ„t“ÔÛ²øáû›´W6»Øoy FQÎr $Óõìk¬„‹ïÞÚ¼sÆíòÉ67\míÎyF¯ð¯TÓã’K;ë[ð·ld«7üyíšÉ𯊵 êáeYžÏq[«&vMÀðßFà}p3ÅgW‡°8ØßVín›þšõ³¹/ ü,÷ií|’‘´R,®ŠÉ‡W“Ž1ØöëÓ¾xžÖÞ¹xÞݬXZGù\’vŒž˜ÆsØúÓïí&ÒÒ{]Qž9£Ê¡ù·ÄÀ»¶áHäž™5—ìö« -&ù¤U<±ÉÆA>½ý+æg
jžö륢þNÛ=÷JÖÛfdÔ õýËúû‹ÓØB²¬fInZ8wÌÉЮ~aƒÎ=3ìx‚+/¶äÁlŠ‚?™Æü#8-œ\pqTZXtè%»»&ÚÝ#´ŠðÜžã§Í’¼{p·ß{m>ÞycP¨’¼¢0ú(Rƒë^Ž ñó¼(»y%m´ÕÙ}ÊûékB1¨þÑ®,#Q)ó‡o1T©ÜÃ*Ž‹‚yö<b‰4×H€“ìÐ.
¤²9ÌŠ>„Žãøgšñ
¯Š~)¸ßå\ÛÛoBŒa·L²œg$‚Iã¯ZÈ—Æ~%”äë—È8â)Œcƒ‘Âàu9¯b%)ÞS²¿Ïïÿ 4Öºù}Z/[H%¤vÉ#Ì’x§†b
© ³´tÜ{gn=iï%õªÇç]ܧ—!åw„SÓp ·VÈÏ¡?5Âcâb¥_ĤŠz¬—nàþÖΟñKÄöJé=ÌWèêT‹¸÷qÎჟ•q’zWUN«N/ØO^Ÿe|í¾©k{üõ4öV^ïù~G¹êzÂèº|·÷×[’Þ31†rpjg·n
Æ0Ý}kåË‹‰nîe¹ËÍ+™ÏVbrOç]'‰¼o®xÎh`¹Ç*±ÙÚ!T$d/$žN>¼WqᯅZ9ÑÒO\ÜÛê1o&,-z ~^NCgNÕéá)ÒÊ©7‰¨¯'Õþ¯þ_¿Ehîþóâ €ï¬uÛûý*ÎK9ä.â-öv<²‘×h$àãúW%ö¯~«g-ÕõÀàG~>Zú¾Iš+(šM³ Û#9äl%ðc¬ ûÝ xÖKG´x®|¸¤Ï™O:Ê8Ã’qÉcÔä‚yÇNJyËŒTj¥&µOmztjÿ ?KëaµÔù¯áýóXøãLeb¾tžAÇû`¨êGBAõ¾•:g˜’ù·,þhÀ`¬qÜ` e·~+å[±ý“âYÄjWì—µHé±ø?Nõô>½âX<5 Ç©ÏѼM¶8cܪXŽÉ^r?¼IróÈS•ZmÇ›™5»òÚÚ7ïu«&|·÷•Ά
>[©ÞXHeS$Œyà€ ÷ù²:ò2|óãDf? Z¼PD¶ÓßC(xÆ0|©ßR;ôMsÿ µ´ÔVi¬,͹›Ìxâi˜`¹,GAéÇlV§ÄýF×Yø§ê–‘:Ã=ò2³9n±ÉžØÏ@yÎWžæ±Ãàe„ÄÒN ]ïòêìú_Go'¦ŽÑ’_×õЯðR66þ!›ÑÄ gFMÙ— äžäqôÈ;ÿ eX<#%»Aö‰ãR¤ Í”Ž¹È G&¹Ÿƒ&á?¶Zˆ±keRè Kãnz·ãŠÕøÄÒÂ9j%@®×q±ÜŒý[õ-É$uíè&¤¶9zÇï·Oøï®ÄJKšÖìdü"µˆ[jײÎc;ã…B(g<9nàȯG½µŸPÓ.´Éfâ¼FŽP
31 ‘ÏR}<3šä~
Ã2xVöî Dr
Ç\›}Ý#S÷ÈÀëŽHÆI®à\OçKuäI¹†ó(”—GWî ñ³¹¸æ2¨›‹ºÚû%¾ýÖ_3ºNú¯ëúì|ÕÅÖ‰}ylM’ZËîTÿ á[ðÐñ/ˆ9Àû
¸ón3 Mòd‘÷ döª^.Êñް›BâîNp>cëÏçÍzïÃôÏ
YÍ%ª¬·ãÏ-*9ÜÂãhéŒc¾dÈêú¼Ë,. VŠ÷çeÿ n/¡¼äãõâ=‹xGQKx”|¹bÌŠD@2Œ 8'Ž àúƒŽ+áDÒ&¡¨"Œ§–Žr22 Ç·s]ŸÄ‹«ð%ÚÄ<¹ä’(×{e›HÀqÁç©Ç½`üŽÚõK饚9ƒÄ±€<–úƒú~ çðñO#Í%iKKlµ¦¾F)'Iê¬Î+Ç(`ñ¾£œdÈ’`™ºcßéé^ÿ i¸”Û\ý¡æhÔB«aq¸}ãÀÆ:ÜWƒ|FÛÿ BŒÇÀeaŸ-sÊ€:úW½ÜÝÜ<%$µ†%CóDªÀí%IÈÏʤ…ôäñÞŒ÷‘a0“ôŽÚë¤nŸoW÷0«e¶y'Å»aΗ2r’# Û°A^ý9ÉQÔõ=ù5¬£Öü.(Þ’M$~V«=éSÄFN½®©ÔWô»ÿ þHžkR‹ìÏ+µµžöê;khÚI¤m¨‹Ôš–âÖçJ¾_Z•’6a”Èô> ÕÉaÕ<%®£2n bQŠå\tÈõUÿ ø»þ‹k15‚ÃuCL$ݹp P1=Oøýs¯^u éEJ”–éêŸê½5ýzy›jÛ³á›Ûkÿ ÚOcn±ÛÏîW;boºz{ãžüVÆ¡a£a5½äÎÂks¸J@?1è¿{$ä‘=k”øsÖ^nŒ¦)ÝåXÃíùN1ØõÚOJë–xF÷h¸ Œ"Ž?x䜚ü³ì¨c*Fœ¯i;7~ñí׫Ðó¥Ë»3Ãü púw ‰°<Á%»ñž ÿ P+Û^ ¾Ye£ŽCÄŒ„/>˜>•á¶Ìm~&&À>M[hÈÈÿ [Ž•íd…RO@3^Ç(ʽ*¶ÖQZyßþ
1Vº}Ñç?¼O4Rh6R€ª£í¡ûÙ
a‚3ß·Õ
ü=mRÍ/µ9¤‚0ÑC¼Iè:cŽsÛ¾™x£ÆÐ¬ªÍöˢ샒W$•€Å{¨ÀPG
ÀÀàŸZìÍ1RÉ0´ðxEË9+Éÿ ^rEÕ—±Š„70l¼áË@û.' ¼¹Žz€N3úUÉ<3á×*?²¬‚ä†"Ùc=p íÛ'¡ª1ñ"økJ†HÒ'»Ÿ+
oÏN¬Ã9 dÙãÜדÏâÍ~æc+j·Jzâ7(£ðW]•æ™?nê´º6åwéåç÷N•ZŠíž›¬|?Ðõ?Ñ-E…®³ÇV$~X¯/…õ x‘LˆÑÜÚÈ7¦pzãÜüë½ðÄ^õtÝYËÍ7ÉÖÕ8ÏUe# #€r=sU¾/é’E§jRC4mxNÝ´9†íuá»›V‘
ZI€×cr1Ÿpzsøf»¨åV‹ìû`qËLÊIã?\~¼³áËC©êhªOîO»‘ÃmçÛçút×¢x“Z}?Üê#b-¤X7õÄò gž zzbº3œm*qvs·M=íúéw}¿&Úª°^Ö×µÏ(ø‡â†Öµƒenñý†×åQáYûœ÷ÇLœôÎNk¡ð‡¼/µ¸n0æÉ0¬ƒ‚üîÉÆvŒw®Sáö”š¯‹-üÕVŠØÙ[$`(9cqƒÔ_@BëqûÙ`Ýæ0;79È?w<ó |ÙÜkßÌ1±Ëã¿ìÒ»ðlìï«ÓnªèèrP´NÏš&ŽéöÙ¸÷æ°~-_O'‰`°!RÚÚÝ%]Ø%þbß1'¿ÿ XÕáOöÎŒ·‹¬+Åæ*ÛÛ™0¤ƒOÍÔ`u¯¦ÂaèÐÃÓ«‹¨Ô¥µœ¿¯ÉyÅÙ.oÔôŸ Úx&(STðݽ¦õ] ’ÒNóÁäÈùr3í·žÚ[™ƒ¼veÈ÷ÞIõÎGlqÎ=M|«gsªxÅI6
]Z·Îªä,¨zŒŽÄ~#ØŠúFñiÉqc©éÐD>S딑 GñŽ1éÐ^+
Ëi;Ô„µVÕú»i¯ÈÒ-ZÍ]òܘ®ì`bÛÙ¥_/y(@÷qÐúg Ô÷W0.Ø›
6Ò© r>QƒŒ0+Èîzb¨É+I0TbNñ"$~)ÕÒ6Þ‹{0VÆ27œWWñcÄcX×íôûyKZéðªc'iQ¿¯LaWŠŸS\·Š“źʸ…ôÙÂí|öÀÇåV|!¤ÂGâÛ[[’ï
3OrÙËPY¹=Î1õ5öåTžÑè Ú64/üö?Zëžk}¬¶éàoá¾á}3“ü]8Éæ¿´n²Žš_6¾pœ)2?úWÓÚ¥¾¨iWúdŽq{*ª1rXŒd…m»‰äcô¯–dâ•ã‘Jº¬§¨#¨®§,df«8ÉÅßN¾hˆ;îÓ=7áùpën®É 6ûJžO2^œÐò JÖø¥²ã›Ò6Ü·‰!wbÍ‚¬O©»õ¬ÿ ƒP=Ä:â¤-&ÙŽ
`È9 r9íϧzë> XÅ7ƒ5X–krÑ¢L7€ìw}ÑŸNHëŒüþ:2†á¼+u·á÷N/Û'Ðç~ߘô«ëh!ónRéeQ´6QÛÿ èEwëÅÒ|¸Yqó1uêyùzð8 ƒŠù¦Ò;¹ä6öi<'ü³„[ÃZhu½ ùÍ¡g‚>r¯×ŠîÌx}bñ2“k꣧oø~›hTèóËWò4|ki"xßQ˜Ï6øÀLnß‚0 ¹Æ{±–¶Öe#¨27È@^Ìß.1N¾œyç€õ†ñeé·Õã†çQ°€=Ì©ºB€Ø8<‚ÃSõ®ùcc>×Ú .Fr:žÝGæ=kÁâ,^!Fž
¬,àµ}%¶«îõ¹†"r²ƒGœüYÕd?aÑÃY®49PyU ÷þ!žxÅm|/‚ãNð˜¼PcûTÒ,¹/Ý=FkÏ|u¨¶«âë…{¤m¢]Û¾ïP>®XãÞ½iÓÁ¾
‰'¬–6ß¼(„ï— í!úÙäzôë^–:œ¨å|,_¿&š×]uÓѵÛô4’j”bž§x‘Æ©ã›á,‚[Ô
ÎÞ= ŒËæ ÀùYÁ?ŽïÚ¼?ÁªxºÕÛ,°1¸‘¿ÝäãØ¯v…@¤åq½ºã œàûââ·z8Xýˆþz~—û»™âµj=Ž
â~ãáh@'h¼F#·Üp?ŸëQü-løvépx»cŸø…lxâÃûG·‰¶ø”L£©%y?¦úõÆü-Õ¶¥y`Òl7>q’2üA?•F}c‡jB:¸Jÿ +§¹¿¸Q÷°ív=VÑìu[Qml%R7a×IèTõéŽx¬
?†š7
1†îã-ˆã’L¡lŽ0OÓ=ÅuˆpÇ•¼3ÛùÒ¶W/!|’wŽw^qÔ×ÏaóM8Q¨ãÑ?ëï0IEhÄa¸X•`a
?!ÐñùQ!Rä žqŽžÝO`I0ÿ J“y|ñ!Îã@99>þ8–+éáu…!ù—ä
ʰ<÷6’I®z
ÅS„¾)Zþ_Öýµ×ËPåOwø÷þ*üïænÖùmØÝûþ¹=>¦½öî×Jh]¼ç&@§nTŒ6ITÀõ^Fxð7Å3!Ö·aÛ$þÿ ¹ã5îIo:ȪmËY[’8ÇӾlj*òû¢¥xõ¾¼ú•åk+\ð¯ HÚoŽl•Ûk,¯ ç²²cõÅ{²Z\
´ìQ åpzŽ3Ôð}ÿ Jð¯XO¡øÎé€hÙ¥ûLdŒ`““ù6Gá^ÃáÝ^Ë[Ñb¾YåŒÊ»dŽ4†2§,;ÿ CQÄ´¾°¨c–±”mºV{«ßÕýÄW\ÖŸ‘çŸ,çMRÆí“l-ƒn~ë©ÉÈê Ü?#Ž•¹ðãSÒ¥ÐWNíà½;ãž)™ÎSÈ9cóLj뵿ūiÍk¨ió¶X‚7÷ƒ€yãnyÏŽëÞ Öt`×À×V's$È9Ú:ä{wÆEk€«†Çàc—â$éÎ.éí~Ýëk}ÅAÆpörÑ¢‡Šl¡ÑüSs‹¨‰IÄóÀ×wñ&eºðf™pŒÆ9gŽTø£lñëÀçŽ NkÊUK0U’p ï^¡ãÈ¥´ø{£ÙHp`’ØåbqÏ©äó^Æ:
Ž' ÊóM«õz+ß×ó5Ÿ»('¹ð¦C„$˜Å¢_ºÈI?»^äã'ñêzž+ë€ñ-½»´}¡Ë*õ?.xÇ^1ŽMyǸ&“—L–îëöâ7…' bqéÎGé]˪â1$o²¸R8Ã`.q€}sÖ¾C98cêÆÞíïóòvÓòùœÕfÔÚéýuèÖ·Ú
Å‚_¤³ÜۺƑß”àרý:׃xPþÅÕî-/üØmnQìïGΊÙRqê=>¢½õnæ·r!—h`+’;ò3È<“Û©éšóŸx*÷V¹¸×tÈiˆßwiÔÿ |cŒñÏ®3ֽ̰‰Ë Qr©ö½®¼ÛoÑÙZÅÑ«O൯ýw8;k›ÿ x†;ˆJa;‘º9÷÷R+¡ñgŽí|Iáë{ôáo2ʲ9 029ÉÏLí\‰¿¸Ÿb˜ "Bv$£ßiê>=ªª©f
’N ëí>¡NXW~5×úíø\‰»½Ï^ø(—wÖú¥¤2íŽÞXæÁ$°eÈ888^nÝë²ñÝÔ^ ÖÚ9Q~Ëå7ï
DC¶ÑµƒsËÇè9®Wáþƒ6‡£´·°2\Ý:ÈÑ?(#¨'$õèGJ¥ñW\ÿ ‰E¶—¸™g˜ÌÀ¹;Pv ú±ÎNs·ëŸ’–"Ž/:té+ûË]öJöÓM»ëø˜*‘•^Uý—êd|‰åñMæÔÝ‹23å™6æHùÛ‚ëüñ^…ñ1¢oêûÑEØ.õ7*ÅHtÎp{g<·Á«+¸c¿¿pÓ¾Æby=8É_ÄsÆk¬ñB\jÞÔì••Ë[9Píb‹Bヅ =93§ð§LšÛáÖšÆæXÌÞdÛP.0\ãïÛ0?™úJ¸™Ë
”•œº+=<µI£¦í¯õêt¬d‹T¬P=ËFêT>ÍØØ@Ï9<÷AQÌ×»Õ¡xùk",JÎæù±Éç$œŽŸZWH®¯"·UÌQ ’ÙÈ]ÅXg<ã
ߨg3-Üqe€0¢¨*Œ$܃
’Sû 8㎼_/e'+Ï–-èÓ¶¶Õíß[·ÙÙ½îì—¼sk%§µxä‰â-pÒeÆCrú
ôσžû=”šÅô(QW‚Õd\ƒæ. \àö¹¯F½°³½0M>‘gr÷q+œ¶NïºHO— ¤ ܥݔn·J|ÆP6Kµc=Isó}Ò çGš)a=—#vK›åoK§ßóÙ¤¶¿õú…ÄRÚ[ËsöÙ¼Ë•Ë ópw®qœŒ·Ø
ùÇâ‹ý‡ãKèS&ÞvûDAù‘É9ŒîqÅ}
$SnIV[]Ñ´Ó}ØÜ¾A Ü|½kÅþÓ|EMuR¼.I¼¶däò‚ÃkÆ}ðy¹vciUœZ…Õõ»z¾÷¿n¦*j-É/àœHã\y5 Û ß™ó0—äŸnzôã#Ô¯,†¥ÚeÔ÷ÜÅ´„“'c…<íÝ€<·SŠ¥k§Ã¢éÆÆÙna‚8–=«Êª[Ÿ™°pNî02z“ÔÙ–K8.È’Þî(vƒ2®@ äÈûãçžxäÇf¯ˆu¹yUÕîýWšÙ|›ëÒ%Q^í[æ|éo5ZY•^{96ˆY‚§v*x>âº_|U¹Ö´©tûMÒÂ9PÇ#«£#€ éÉñ‘ƒÍz/‰´-į¹°dd,Б›p03ƒœ{ç9=+
Ûᧇ¬¦[‡‚ê婺¸#±ß=³ý¿•Õµjñ½HÙh›Û[§ÚýÊöô÷{˜?ô÷·Ô.u©–_%còcAÀ˜’
}0x9Î>žñÇáÍ9,ahï¦Ì2òÓ ñÛAäry$V²Nð
]=$Ž
‚#Ù‚1ƒƒødõMax‡ÂÖ^!±KkÛ‘
«“Çó²FN8+ëÎ{Ò¼oí§[«ÕMRoËeç×[_m/¦¦k.kôgŽxsSÓ´ý`êzªÜÜKo‰cPC9ÎY‰#§^üý9¹âïÞx£Ë·Ú`±‰‹¤;³–=ÏaôÕAð‚÷kêÁNBéÎælcõö®£Fð†ô2Ò¬]ßÂK$ÓÜ®•”/ÊHàã$ä¸÷ëf¹Oµúâ“”’²øè´µþöjçNü÷üÌ¿ xNïFÒd»¼·h®îT9ŽAµÖ>qÁçÔœtïÒ»\ȶÎîcÞäîó3¶@#ÉIÎ ÔñW.<´’¥–ÑÑ€ÕšA‚ ;†qÓë‚2q
ÒÂó$# Çí‡
!Ë}Õ9ÈÎÑÉã=;ŒÇÎuñ+ÉûÏ¥öíeÙ+$úíÜ娯'+êZH4ƒq¶FV‹gïŒ208ÆÌ)íб>M|÷âÍã¾"iì‹¥£Jd´™OÝç;sÈúr+ÜäˆË)DŒ¥šF°*3Õ”d{zÔwºQ¿·UžÉf†~>I+ŒqÔ`ð3œ“Ü×f]œTÁÔn4“ƒø’Ýßõ_«*5šzGCÊ,þ+ê1ò÷O¶¸cœºb2yÇ;cùÕ£ñh¬›áÑŠr¤ÝäNBk¥—á—†gxšX/쑘hŸ*Tçn =ûã¦2|(ð¿e·ºÖ$
ýìŸ!'åΰyîî+×öœ=Y:²¦ÓÞ×iü’—ü
-BK™£˜›âÆ¡&véðõ-ûÉY¹=Onj¹ø¯¯yf4·±T Pó`çœ7={×mÃ/¢˜ZÚòK…G½¥b„’G AãÜœ*í¯Ã¿ IoæI¦NU8‘RwÈã;·€ Û×ëÒ”1Y
•£E»ÿ Oyto¢<£Áö·šï,䉧ûA¼sû»Nò}¹üE{ÜÖªò1’õÞr0â}ÎØ#>à/8ïéÎ~—áÍ#ñÎlí§³2f'h”?C÷YËdð:qëõÓ·‚ïeÄ©
ÔÈØÜRL+žAÎ3¼g=åšó³Œt3
ÑQ¦ùRÙßE®¼±w_;þhš’Sirÿ ^ˆã¼iੇ|RòO„m°J/“$·l“ ÇÓ¿ÿ [ÑŠÆ“„†Õø>cFÆ6Ø1ƒ– àz7Ldòxäüwá‹ÝAXùO•Úý’é®ähm •NÀ±ÌTÈç
ƒ‘I$pGž:‚ÄbêW¢®œ´|¦nÍ>¶ÖÏ¢§ÎÜ¢ºö¹•%ÄqL^öÛKpNA<ã¡ …î==ª¸óffËF‡yÌcÉ ©ç$ð=ñÏYþÊ’Ú]—¥‚¬‚eDïÎH>Ÿ_ÌTP™a‰ch['çÆÜò7a‡?w°Ïn§âÎ5”’¨¹uÚÛ|´ÓÓc§{O—ü1•ªxsÃZ…ÊÏy¡Ã3¸Ë2Èé» ‘ƒÎ äžÜðA§cáOéúÛ4ý5-fŒï„ù¬ûô.Ç Üsž•Ò¾•wo<¶Ÿ"¬¡º|£
î2sÇ¡éE²ÉFѱrU°dÜ6œ¨ mc†Îxë׺Þ'0²¡Rr„{j¾í·è›µ÷)º·å–‹î2|I®Y¼ºÍË·–ÃÆàã£'óÆxƒOÆÞ&>\lóÌxP Xc¸ì Sþ5§qà/ê>#žÞW¸if$\3 ® ûÄ“ùŽÕê¾ð<Ó‹H¶óÏ" å·( á‘€:ã†8Ï=+ꨬUA×ÃËÚT’ÑÞöù¥¢]{»ms¥F0\ÑÕ—ô}&ÛB´ƒOŽÚ+›xíÄÀ1
,v± žIëíZ0ǧ™3í2®0ทp9öÝÔž)ÓZËoq/Ú“‘L ²ŒmùŽï‘Ó9§[Û#Ä‘\ÞB¬Çs [;à à«g‚2ôòªœÝV§»·¯/[uó½õÛï¾
/šÍ}öüÿ «=x»HŸÂÞ.™ ÌQùŸh´‘#a$‚'¡u<Š›Æ>2>+ƒLSiöwµFó1!eg`£åœ ÷ëÛö}Á¿ÛVÙêv $¬ƒ|,s÷z€ð΃¨x÷ÅD\ÜŒÞmåÔ„ ˆ o| :{ÇÓ¶–òÁn!´0Ål€, ƒ ( ÛŒŒc¶rsšæ,4‹MÛOH!@¢ ÇŽ„`å²9ÝÃw;AÍt0®¤¡…¯ØÄ.Àìí´ƒ‘ßñ5Í,Óëu-ÈÔc¢KÃÓ£òÖ̺U.õL¯0…%2È—"~x
‚[`có±nHàŽyàö™¥keˆìŒÛFç{(Ø©†`Jã#Žwg<“:ÚÉ;M
^\yhûX‡vB·÷zrF?§BÊÔ/s<ÐÈB)Û± ·ÍÔwç5Âã:så§e{mѤï«Òíh—]Wm4âí¿ùþW4bC3¶ª¾Ùr$pw`àädzt!yŠI„hÂîàM)!edŒm'æ>Ç?wzºKìcŒ´¯Ìq6fp$)ãw¡éUl`µ»ARAˆÝÕgr:äŒgƒéé[Ôö±”iYs5Ýï«ÙG—K=þF’æMG«óÿ `ŠKɦuOQ!ÕåŒ/ÎGÞ`@ËqÕzdõâ«Ê/Ö(ƒK´%ŽbMüåÜŸö—>¤óŒŒV‘°„I¢Yž#™¥ùÏÊ@8
œgqöö5ª4vד[¬(q cò¨À!FGaÁõõ¯?§†¥ÏU½í¿WªZ$úyú½Žz×§Éþ?>Ã×È•6°{™™ŽÙ.$`ÎUœ…çè ' ¤r$1Ø(y7 ðV<ž:È ÁÎMw¾Â'Øb§øxb7gãО½óÉÊë²,i„Fȹ£§8ãä½k¹¥¦ê/ç{ïê驪2œ/«ü?¯Ô›ìñÜ$þeýœRIåŒg9Ác’zrrNO bÚi¢
ѺË/$,“ª¯Ýä;Œ× ´<ÛÑn³IvŸb™¥ nm–ÄŸ—nÝÀãŽ3ëÍG,.öó³˜Ù£¹uÊÌrŠ[<±!@Æ:c9ÅZh
ì’M5ÄìÌ-‚¼ëÉùqŽGì9¬á ;¨A-ž—évþÖ–^ON·Ô”ŸEý}ú×PO&e[]ÒG¸˜Ûp ƒÃà/Ë·8ûÀ€1ž@¿ÚB*²¼ñì8@p™8Q“žÆH'8«I-%¸‚
F»“åó6°Uù|¶Ú¸ã ò^Äw¥ŠÖK–1ÜÝK,Žddlí²0PÀü“×ükG…¯U«·¶–´w¶ŽÍ¾©yÞú[Zös•¯Á[™6°
¨¼ÉVæq·,#
ìãï‘×8îry®A››¨,ãc66»Ë´ã'æÉù?t}¢æH--Òá"›|ˆ¬[í 7¶ö#¸9«––‹$,+Ëqœ\Êøc€yê^ݸÄa°«™B-9%«×®‹V´w~vÜTéꢷþ¼ˆ%·¹• ’[xç•÷2gØS?6åÀÚ õ9É#š@÷bT¸º²C*3Bá¤òÎA9 =úU§Ó"2Ãlá0iÝIc‚2Î@%öç94ùô»'»HÄ¥Ô¾@à Tp£šíx:úÊ:5eºßMý×wµ›Ó_+šº3Ýyvÿ "ºÇ<ÂI>Õ1G·Ë«È«É# àÈÇ øp Jv·šæDûE¿›†Ë’NFr2qŸ½ÇAÜšu•´éí#Ħ8£2”Ú2Ã/€[ÎTr;qŠz*ý’Îþ(≠;¡TÆâ›;ºÿ àçœk‘Þ8¾Uª¾íé{^×IZéwÓkXÉûÑZo¯_øo×È¡¬ â–ÞR§2„‚Àœü½ùç® SVa†Âüª¼±D‘ŒísŸàä|ä2 æ[‹z”¯s{wn„ÆmáóCO+†GO8Ïeçåº`¯^¼ðG5f{Xžä,k‰<á y™¥voÆ éÛõëI=œ1‹éíÔÀÑ)R#;AÂncäŽ:tÏ#¶TkB.0Œ-ÖÞZÛgumß}fÎJÉ+#2êÔP£žùÈÅi¢%œ3P*Yƒò‚A쓎2r:ƒÐúñiRUQq‰H9!”={~¼“JŽV¥»×²m.ÛߺiYl¾òk˜gL³·rT•
’…wHÁ6ä`–Î3ùÌ4Øe³†&òL‘•%clyîAÂäà0 žüç$[3uŘpNOÀÉ=† cï{rYK
ååä~FÁ
•a»"Lär1Ó¯2Äõæ<™C•.fÕ»è¥~½-¿g½Â4¡{[ør¨¶·Žõäx¥’l®qpwÇ»8ärF \cޏܯÓ-g‚yciÏÀ¾rÎwèØÈ#o°Á9ã5¢šfÔxÞæfGusÏÌJÿ µ×œ/LtãÅT7²¶w,l
ɳ;”eúà·¨çîŒsÜgTÃS¦^ '~‹®›¯+k÷ZÖd©Æ*Ó[Ü«%Œk0ŽXƒ”$k#Ȩ P2bv‘ƒŸáÇ™ÆÕb)m$É*8óLE‘8'–ÜN Úyàúô+{uº±I'wvš4fÜr íì½=úuú
sFlìV$‘ö†HÑù€$§ õ=½¸«Ž]
:Ž+•¦ïmRþ½l´îÊT#nkiøÿ _ðÆT¶7Ò½ºÒ£Î¸d\ã8=yãŽÜäR{x]ZâÚé#¸r²#»ÎHÆ6õ ç® ÎFkr;sºÄ.&;só±Ç9êH÷ýSšÕtÐU¢-n Ì| vqœ„{gŒt§S.P‹’މ_[;m¥ÞZýRûÂX{+¥úü¼ú•-àÓ7!„G"“´‹žƒnrYXã¸îp éœ!ÓoPÌtÑ (‰Þ¹é€sÓ#GLçÕšÑnJý¡!‘Tä#“ß?îýp}xÇ‚I¥Õn#·¸–y'qó@r[ Êô÷<ÔWÃÓ¢áN¥4Ô’I&ݼ¬¬¼ÞºvéÆ
FQV~_ÒüJÖÚt¥¦Xá3BÄP^%ÈÎW-×c¡ú©¤·Iþèk¥š?–UQåIR[’O 5x\ÉhÆI¶K4«2ùªŠŒ<¼óœçØ`u«‚Í.VHä€ Ëgfx''9ÆI#±®Z8
sISºku¢ßÞ]úk»Jößl¡B.Ü»ÿ MWe
°·Ž%šêɆ¼»Âù³´œ O¿cÐÓÄh©"ÛÜÏ.ÖV’3nüÄmnq[ŒòznšÖ>J¬òˆæ…qýØP Ž:ä7^0yëWšÍ_79äoaÈ °#q0{ää×mœy”R{vÒÞ¶ÚÏe¥“ÚÆÐ¥Ì®—õýjR •íç›Ìb„+JyÜØÙ•Ç]¿Ôd þËOL²”9-Œ—õÃc'æÝלçÚ²ìejP“½
âù°¨†ðqòädЃÉäÖÜj÷PÇp“ÍšŠå«‘î
<iWNsmª»¶vÓz5»ûì:Rs\Ðßôû×uÔÿÙ