blob: a6ee05e917a96c1a0dd4366e2f08be16adf2300d (
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
88
89
|
.. 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.
redis-py - Python Client for Redis
====================================
Getting Started
****************
`redis-py <https://pypi.org/project/redis>`_ requires a running Redis server, and Python 3.7+. 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 <commands.html>`_.
.. toctree::
:hidden:
genindex
Redis Command Functions
***********************
.. toctree::
:maxdepth: 2
commands
redismodules
Module Documentation
********************
.. toctree::
:maxdepth: 1
backoff
connections
exceptions
lock
retry
advanced_features
clustering
lua_scripting
opentelemetry
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>`_.
|