Skip to content

Commit d298f83

Browse files
committed
Doc updates.
1 parent 3854cdf commit d298f83

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

CHANGES

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
Development Version
22
-------------------
33

4+
sqlparse is now compatible with Python 3 without any patches. The
5+
Python 3 version is generated during install by 2to3. You'll need
6+
distribute to install sqlparse for Python 3.
7+
48
Bug Fixes
59
* Fix parsing error with dollar-quoted procedure bodies (issue83).
610

711
Other
8-
* sqlparse is now compatible with Python 3 without any patches.
12+
* Documentation updates.
913
* py3k fixes (by vthriller).
1014
* py3k fixes in setup.py (by Florian Bauer).
1115
* setup.py now requires distribute (by Florian Bauer).

docs/source/intro.rst

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
Introduction
22
============
33

4-
:mod:`sqlparse` is a non-validating SQL parser for Python.
5-
It provides support for parsing, splitting and formatting SQL statements.
6-
The module is released under the terms of the
7-
`New BSD license <http://www.opensource.org/licenses/bsd-license.php>`_.
8-
9-
Visit the project page at http://python-sqlparse.googlecode.com for
10-
further information about this project.
11-
124

135
Download & Installation
146
-----------------------
157

16-
The latest released version can be obtained from the
17-
`downloads page <http://code.google.com/p/python-sqlparse/downloads/list>`_
18-
on the project's website. To extract the source archive and to install
19-
the module on your system run
8+
The latest released version can be obtained from the `Python Package
9+
Index (PyPI) <http://pypi.python.org/pypi/sqlparse/>`_. To extract the
10+
install the module system-wide run
2011

2112
.. code-block:: bash
2213
2314
$ tar cvfz python-sqlparse-VERSION.tar.gz
2415
$ cd python-sqlparse/
2516
$ sudo python setup.py install
2617
27-
Alternatively you can install :mod:`sqlparse` from the
28-
`Python Packge Index <http://pypi.python.org/pypi/sqlparse>`_ with your
29-
favorite tool for installing Python modules. For example when using
30-
`pip <http://pypi.python.org/pypi/pip>`_ run :command:`pip install sqlparse`.
18+
Alternatively you can install :mod:`sqlparse` using :command:`pip`:
19+
20+
.. code-block:: bas
21+
22+
$ pip install sqlparse
3123
3224
3325
Getting Started
@@ -108,9 +100,9 @@ Each object can be converted back to a string at any time:
108100

109101
.. code-block:: python
110102
111-
>>> stmt.to_unicode()
103+
>>> unicode(stmt) # str(stmt) for Python 3
112104
u'select * from "someschema"."mytable" where id = 1'
113-
>>> stmt.tokens[-1].to_unicode() # or just the WHERE part
105+
>>> unicode(stmt.tokens[-1]) # or just the WHERE part
114106
u'where id = 1'
115107
116108
Details of the returned objects are described in :ref:`analyze`.

sqlparse/sql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def __unicode__(self):
4545
def to_unicode(self):
4646
"""Returns a unicode representation of this object.
4747
48-
@deprecated: please use __unicode__()
48+
.. deprecated:: 0.1.5
49+
Use ``unicode(token)`` (for Python 3: ``str(token)``) instead.
4950
"""
5051
return unicode(self)
5152

0 commit comments

Comments
 (0)