Skip to content

Commit

Permalink
Merge pull request #11888 from jorisvandenbossche/doc-gh11686
Browse files Browse the repository at this point in the history
DOC: add examples of database drivers (GH11686)
  • Loading branch information
jorisvandenbossche committed Dec 23, 2015
2 parents 7f062da + 578fd76 commit 6b8a721
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ Optional Dependencies
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage. Version 3.0.0 or higher required, Version 3.2.1 or higher highly recommended.
* `SQLAlchemy <http://www.sqlalchemy.org>`__: for SQL database support. Version 0.8.1 or higher recommended.
* Besides SQLAlchemy, you also need a database specific driver.
Examples of such drivers are `psycopg2 <http://initd.org/psycopg/>`__ for PostgreSQL
or `pymysql <https://github.com/PyMySQL/PyMySQL>`__ for MySQL. For
`SQLite <https://docs.python.org/3.5/library/sqlite3.html>`__ this is
included in Python's standard library by default.
You can find an overview of supported drivers for each SQL dialect in the
`SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__.
* `matplotlib <http://matplotlib.sourceforge.net/>`__: for plotting
* `statsmodels <http://statsmodels.sourceforge.net/>`__
* Needed for parts of :mod:`pandas.stats`
Expand Down
13 changes: 9 additions & 4 deletions doc/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3741,8 +3741,13 @@ SQL Queries

The :mod:`pandas.io.sql` module provides a collection of query wrappers to both
facilitate data retrieval and to reduce dependency on DB-specific API. Database abstraction
is provided by SQLAlchemy if installed, in addition you will need a driver library for
your database.
is provided by SQLAlchemy if installed. In addition you will need a driver library for
your database. Examples of such drivers are `psycopg2 <http://initd.org/psycopg/>`__
for PostgreSQL or `pymysql <https://github.com/PyMySQL/PyMySQL>`__ for MySQL.
For `SQLite <https://docs.python.org/3.5/library/sqlite3.html>`__ this is
included in Python's standard library by default.
You can find an overview of supported drivers for each SQL dialect in the
`SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__.

.. versionadded:: 0.14.0

Expand Down Expand Up @@ -3780,7 +3785,7 @@ To connect with SQLAlchemy you use the :func:`create_engine` function to create
object from database URI. You only need to create the engine once per database you are
connecting to.
For more information on :func:`create_engine` and the URI formatting, see the examples
below and the SQLAlchemy `documentation <http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html>`__
below and the SQLAlchemy `documentation <http://docs.sqlalchemy.org/en/latest/core/engines.html>`__

.. ipython:: python
Expand Down Expand Up @@ -3994,7 +3999,7 @@ connecting to.
# or absolute, starting with a slash:
engine = create_engine('sqlite:////absolute/path/to/foo.db')
For more information see the examples the SQLAlchemy `documentation <http://docs.sqlalchemy.org/en/rel_0_9/core/engines.html>`__
For more information see the examples the SQLAlchemy `documentation <http://docs.sqlalchemy.org/en/latest/core/engines.html>`__


Advanced SQLAlchemy queries
Expand Down

0 comments on commit 6b8a721

Please sign in to comment.