Skip to content

Commit 75b1828

Browse files
committed
formatting
1 parent 636004e commit 75b1828

File tree

6 files changed

+100
-3
lines changed

6 files changed

+100
-3
lines changed

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ authors = ["Todd Birchard <toddbirchard@gmail.com>"]
66
maintainers = ["Todd Birchard <toddbirchard@gmail.com>"]
77
license = "MIT"
88
readme = "README.md"
9-
homepage = "https://hackersandslackers.com/redis-python/"
9+
homepage = "https://hackersandslackers.com/redis-py-python/"
1010
repository = "https://github.com/hackersandslackers/redis-python-tutorial/"
11-
documentation = "https://hackersandslackers.com/using-redis-python-applications/"
11+
documentation = "https://hackersandslackers.com/redis-py-python/"
1212
keywords = ["Redis",
1313
"Cache",
1414
"Queue",

redis_python_tutorial/data/list.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,23 @@ def list_values_demo(r):
77
# Add single string to a new list.
88
r.lpush('my_list', 'A')
99
logger.info(f"my_list: {r.lrange('my_list', 0, -1)}")
10+
1011
# Push second string to list from the right.
1112
r.rpush('my_list', 'B')
1213
logger.info(f"my_list: {r.lrange('my_list', 0, -1)}")
14+
1315
# Push third string to list from the right.
1416
r.rpush('my_list', 'C')
1517
logger.info(f"my_list: {r.lrange('my_list', 0, -1)}")
18+
1619
# Remove 1 instance from the list where the value equals 'C'.
1720
r.lrem('my_list', 1, 'C')
1821
logger.info(f"my_list: {r.lrange('my_list', 0, -1)}")
22+
1923
# Push a string to our list from the left.
2024
r.lpush('my_list', 'C')
2125
logger.info(f"my_list: {r.lrange('my_list', 0, -1)}")
26+
2227
# Pop first element of our list and move it to the back.
2328
r.rpush('my_list', r.lpop('my_list'))
2429
logger.info(f"my_list: {r.lrange('my_list', 0, -1)}")
25-
return r.lrange('my_list', 0, -1)

redis_python_tutorial/data/set.py

+5
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@ def set_values_demo(r):
77
# Add item to set 1
88
r.sadd('my_set_1', 'Y')
99
logger.info(f"my_set_1: {r.smembers('my_set_1')}'")
10+
1011
# Add item to set 1
1112
r.sadd('my_set_1', 'X')
1213
logger.info(f"my_set_1: {r.smembers('my_set_1')}'")
14+
1315
# Add item to set 2
1416
r.sadd('my_set_2', 'X')
1517
logger.info(f"my_set_2: {r.smembers('my_set_2')}'")
18+
1619
# Add item to set 2
1720
r.sadd('my_set_2', 'Z')
1821
logger.info(f"my_set2: {r.smembers('my_set_2')}'")
22+
1923
# Union set 1 and set 2
2024
logger.info(f"Union: {r.sunion('my_set_1', 'my_set_2')}")
25+
2126
# Interset set 1 and set 2
2227
logger.info(f"Intersect: {r.sinter('my_set_1', 'my_set_2')}")

redis_python_tutorial/data/string.py

+5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
def string_values_demo(r):
66
"""Manipulate strings as integers."""
7+
# Create string value
78
r.set('index', '1')
9+
logger.info(f"index: {r.get('index')}")
10+
811
# Increment string by 1
912
r.incr('index')
1013
logger.info(f"index: {r.get('index')}")
14+
1115
# Decrement string by 1
1216
r.decr('index')
1317
logger.info(f"index: {r.get('index')}")
18+
1419
# Increment string by 3
1520
r.incrby('index', 3)
1621
logger.info(f"index: {r.get('index')}")

redis_python_tutorial/data/zset.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ def sorted_set_values_demo(r):
99
'Rich Girl - Hall & Oats': 2,
1010
'The Prayer - Griz': 3})
1111
logger.info(f"top_songs_set: {r.zrange('top_songs_set', 0, -1)}'")
12+
1213
# Add item to set with conflicting value
1314
r.zadd('top_songs_set', {'Can\'t Figure it Out - Bishop Lamont': 3})
1415
logger.info(f"top_songs_set: {r.zrange('top_songs_set', 0, -1)}'")
16+
1517
# Shift index of a value
1618
r.zincrby('top_songs_set', 3, 'Never Change - Jay Z')
1719
logger.info(f"top_songs_set: {r.zrange('top_songs_set', 0, -1)}'")

requirements.txt

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
appnope==0.1.0
2+
attrs==19.1.0
3+
autopep8==1.4.2
4+
backports-abc==0.5
5+
backports.shutil-get-terminal-size==1.0.0
6+
bleach==3.1.0
7+
certifi==2019.9.11
8+
chardet==3.0.4
9+
configparser==3.5.0
10+
coverage==4.5.4
11+
decorator==4.4.0
12+
defusedxml==0.5.0
13+
devstack-tools==0.4.0
14+
entrypoints==0.3
15+
enum34==1.1.6
16+
funcsigs==1.0.2
17+
functools32==3.2.3.post2
18+
future==0.17.1
19+
futures==3.2.0
20+
gitdb2==2.0.6
21+
GitPython==2.1.11
22+
idna==2.8
23+
ipaddress==1.0.22
24+
ipykernel==4.10.0
25+
ipython==5.8.0
26+
ipython-genutils==0.2.0
27+
jedi==0.13.1
28+
Jinja2==2.10.1
29+
jsonschema==3.0.1
30+
jupyter-client==5.2.4
31+
jupyter-core==4.4.0
32+
jupyterlab-git==0.5.0
33+
MarkupSafe==1.1.1
34+
mccabe==0.6.1
35+
mistune==0.8.4
36+
mock==2.0.0
37+
nbconvert==5.4.1
38+
nbformat==4.4.0
39+
nbresuse==0.3.1
40+
nose2==0.9.1
41+
notebook==5.7.8
42+
pandocfilters==1.4.2
43+
parso==0.3.1
44+
pathlib2==2.3.3
45+
pbr==5.4.4
46+
pexpect==4.7.0
47+
pickleshare==0.7.5
48+
pluggy==0.8.0
49+
prometheus-client==0.6.0
50+
prompt-toolkit==1.0.14
51+
psutil==5.6.1
52+
ptyprocess==0.6.0
53+
pycodestyle==2.4.0
54+
pydocstyle==3.0.0
55+
pyflakes==2.0.0
56+
Pygments==2.3.1
57+
pyrsistent==0.14.11
58+
python-dateutil==2.8.0
59+
python-jsonrpc-server==0.0.2
60+
python-language-server==0.21.2
61+
pyzmq==18.0.1
62+
regex==2019.11.1
63+
requests==2.22.0
64+
requests-toolbelt==0.9.1
65+
rope==0.11.0
66+
scandir==1.10.0
67+
Send2Trash==1.5.0
68+
simplegeneric==0.8.1
69+
singledispatch==3.4.0.3
70+
six==1.11.0
71+
smmap2==2.0.5
72+
snowballstemmer==1.2.1
73+
terminado==0.8.2
74+
testpath==0.4.2
75+
tornado==5.1.1
76+
traitlets==4.3.2
77+
urllib3==1.25.6
78+
wcwidth==0.1.7
79+
webencodings==0.5.1
80+
whaaaaat==0.5.2
81+
yapf==0.24.0

0 commit comments

Comments
 (0)