summaryrefslogtreecommitdiff
path: root/docs/index.rst
blob: cbf5115cde35f3a1f3e36ded4a0b71a7a8abfb31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.. redis-py documentation master file, created by
   sphinx-quickstart on Thu Jul 28 13:55:57 2011.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to redis-py's documentation!
====================================

Getting Started
****************

`redis-py <https://pypi.org/project/redis>`_ requires a running Redis server, and Python 3.6+. See the `Redis
quickstart <https://redis.io/topics/quickstart>`_ for Redis installation instructions.

redis-py can be installed using pip via ``pip install redis``.


Quickly connecting to redis
***************************

There are two quick ways to connect to Redis.

**Assuming you run Redis on localhost:6379 (the default)**

.. code-block:: python

   import redis
   r = redis.Redis()
   r.ping()

**Running redis on foo.bar.com, port 12345**

.. code-block:: python

   import redis
   r = redis.Redis(host='foo.bar.com', port=12345)
   r.ping()

**Another example with foo.bar.com, port 12345**

.. code-block:: python

   import redis
   r = redis.from_url('redis://foo.bar.com:12345')
   r.ping()

After that, you probably want to `run redis commands <redis_core_commands.html>`_.

.. toctree::
   :hidden:

   genindex

Redis Command Functions
***********************
.. toctree::
   :maxdepth: 2

   redis_commands
   redis_cluster_commands
   sentinel_commands
   redismodules

Module Documentation
********************
.. toctree::
   :maxdepth: 1

   backoff
   connections
   exceptions
   lock
   retry
   examples

Contributing
*************

- `How to contribute <https://github.com/redis/redis-py/blob/master/CONTRIBUTING.md>`_
- `Issue Tracker <https://github.com/redis/redis-py/issues>`_
- `Source Code <https://github.com/redis/redis-py/>`_
- `Release History <https://github.com/redis/redis-py/releases/>`_

License
*******

This projectis licensed under the `MIT license <https://github.com/redis/redis-py/blob/master/LICENSE>`_.