|
5 | 5 |
|
6 | 6 | `tarantool-python <http://github.com/tarantool/tarantool-python>`__
|
7 | 7 | is the official Python connector for Tarantool. It is not supplied as part
|
8 |
| -of the Tarantool repository and must be installed separately (see below for details). |
| 8 | +of the Tarantool repository and must be installed separately. |
| 9 | +For a quick start with ``tarantool-python``, refer to this guide: :ref:`getting_started-python`. |
9 | 10 |
|
10 |
| -Here is a complete Python program that inserts ``[99999,'Value','Value']`` into |
11 |
| -space ``examples`` via the high-level Python API. |
12 |
| - |
13 |
| -.. code-block:: python |
14 |
| -
|
15 |
| - #!/usr/bin/python |
16 |
| - from tarantool import Connection |
17 |
| -
|
18 |
| - c = Connection("127.0.0.1", 3301) |
19 |
| - result = c.insert("examples",(99999,'Value', 'Value')) |
20 |
| - print result |
21 |
| -
|
22 |
| -To prepare, paste the code into a file named :file:`example.py` and install |
23 |
| -the ``tarantool-python`` connector with either :samp:`pip install tarantool\>0.4` |
24 |
| -to install in :file:`/usr` (requires **root** privilege) or |
25 |
| -:samp:`pip install tarantool\>0.4 --user` to install in :file:`~` i.e. user's |
26 |
| -default directory. |
27 |
| - |
28 |
| -Before trying to run, check that the server instance is :ref:`listening <cfg_basic-listen>` at |
29 |
| -``localhost:3301`` and that the space ``examples`` exists, as |
30 |
| -:ref:`described earlier <index-connector_setting>`. |
31 |
| -To run the program, say :samp:`python example.py`. The program will connect |
32 |
| -to the Tarantool server, will send the :ref:`INSERT <box_space-insert>` request, and will not throw any exception if |
33 |
| -all went well. If the tuple already exists, the program will throw |
34 |
| -``tarantool.error.DatabaseError: (3, "Duplicate key exists in unique index 'primary' in space 'examples'")``. |
35 |
| - |
36 |
| -The example program only shows one request and does not show all that's |
37 |
| -necessary for good practice. For that, please see |
38 |
| -`tarantool-python <http://github.com/tarantool/tarantool-python>`__ project at GitHub. |
39 |
| - |
40 |
| -Also there are several community-driven Python connectors: |
| 11 | +There are also several community-driven Python connectors: |
41 | 12 |
|
42 | 13 | * `asynctnt <https://github.com/igorcoding/asynctnt>`__ with asyncio support
|
43 | 14 | * `aiotarantool <https://github.com/shveenkov/aiotarantool>`__ also with asyncio support, **no active maintenance**
|
44 | 15 | * `gtarantool <https://github.com/shveenkov/gtarantool>`__ with gevent support, **no active maintenance**
|
45 | 16 |
|
46 |
| -The table below contains a feature comparison for asynctnt and |
47 |
| -tarantool-python. aiotarantool and gtarantool are absent there because they are quite outdated and |
48 |
| -unmaintained. |
| 17 | +The table below contains a feature comparison for ``asynctnt`` and ``tarantool-python``. |
49 | 18 |
|
50 | 19 | .. _python-feature-comparison:
|
51 | 20 |
|
|
0 commit comments