-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import and merge install and first use info from getting started docs
- Loading branch information
Naomi Slater
committed
Feb 21, 2018
1 parent
e23167b
commit 580dbdf
Showing
3 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
/develop-eggs/ | ||
/dist | ||
/eggs | ||
/out | ||
out/ | ||
/parts/ | ||
crate.egg-info | ||
htmlcov/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
.. _index: | ||
|
||
===================== | ||
CrateDB Python Client | ||
===================== | ||
|
||
A Python client library for `CrateDB`_. | ||
|
||
This library: | ||
|
||
- Implements the Python `DB API 2.0`_ specification | ||
- Includes support for `SQLAlchemy`_ (>= 1.0.0) | ||
|
||
.. rubric:: Table of Contents | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
install-first-use.txt | ||
client.txt | ||
sqlalchemy.txt | ||
blobs.txt | ||
advanced_usage.txt | ||
https.txt | ||
|
||
.. _CrateDB: https://crate.io/products/cratedb/ | ||
.. _DB API 2.0: http://www.python.org/dev/peps/pep-0249/ | ||
.. _SQLAlchemy: http://www.sqlalchemy.org/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
===================== | ||
Install and First Use | ||
===================== | ||
|
||
This page shows you how to install the :ref:`Python client library for | ||
CrateDB <index>` and then walks you through a simple first use scenario. | ||
|
||
Prerequisites | ||
============= | ||
|
||
Recent versions of this library require Python 3 (>= 3.4) to run. | ||
|
||
Use version 0.21.x if you are running Python 2.7/3.3 or version 0.14.x if you | ||
are running Python 2.6. | ||
|
||
Install | ||
======= | ||
|
||
The CrateDB Python client is available as a `pip`_ package. | ||
|
||
To install, run: | ||
|
||
.. code-block:: sh | ||
|
||
sh$ pip install crate | ||
|
||
To update, run: | ||
|
||
.. code-block:: sh | ||
|
||
sh$ pip install -U crate | ||
|
||
If you use Python 2.7 or 3.3 with a recent version of pip, it will install only | ||
version 0.21.x by default, because newer versions of this package are not | ||
compatible with Python 2.7/3.3 any more. | ||
|
||
Connect to CrateDB | ||
================== | ||
|
||
Import the client module from the ``crate`` package: | ||
|
||
.. code-block:: python | ||
|
||
from crate import client | ||
|
||
Use the ``client`` module to create a connection: | ||
|
||
.. code-block:: python | ||
|
||
connection = client.connect(SERVER_IP) | ||
|
||
Open a cursor to the database to enable queries. | ||
|
||
.. code-block:: python | ||
|
||
cursor = connection.cursor() | ||
|
||
Learning More | ||
============= | ||
|
||
Crate.io maintains a `sample Python application`_ that uses this library, which | ||
may be a good starting point as you learn to use it for the first time. And be | ||
sure to check out out the `application documentation`_. | ||
|
||
Browse the rest of the Python client :ref:`reference documentation <index>` for | ||
more information. | ||
|
||
.. _sample Python application: https://github.com/crate/crate-sample-apps/tree/master/python | ||
.. _application documentation: https://github.com/crate/crate-sample-apps/blob/master/python/documentation.md | ||
.. _pip: https://pypi.python.org/pypi/pip |