Build Your Own AI Assistant Part 1 - Creating the Assistant
116820 Views
Is the new Raspberry Pi AI Kit better than Google Coral?
114678 Views
Control Arduino with Python using Firmata / PyFirmata
87081 Views
How to Map with LiDAR - using a Raspberry Pi Zero 2W, RPLidar and Rviz
57314 Views
Creating a Supercomputer with a Raspberry Pi 5 Cluster and Docker Swarm!
53588 Views
Node-Red Automation, MQTT, NodeMCU & MicroPython
52067 Views
Thinkman
Podman vs Docker
MicroPython Robotics
Bottango and Isaaca
LidarBot
Snaszy NAS a 3D printed NAS for Raspberry Pi
Running K3s on Raspberry Pi
0h 36m
From Docker to Podman
0h 28m
MicroPython Robotics Projects with the Raspberry Pi Pico
0h 24m
Bottango Basics
0h 22m
Mini-Rack 3D Design Tutorial
0h 20m
Using the Raspberry Pi Pico's Built-in Temperature Sensor
Learn Linux from the basics to advanced topics.
Learn how to use a Raspberry Pi Pico
Learn MicroPython the best language for MicroControllers
Learn Docker, the leading containerization platform. Docker is used to build, ship, and run applications in a consistent and reliable manner, making it a popular choice for DevOps and cloud-native development.
Learn how to build SMARS robots, starting with the 3D Printing the model, Designing SMARS and Programming SMARS
Learn how to build robots, starting with the basics, then move on to learning Python and MicroPython for microcontrollers, finally learn how to make things with Fusion 360.
Learn Python, the most popular programming language in the world. Python is used in many different areas, including Web Development, Data Science, Machine Learning, Robotics and more.
Learn how to create robots in 3D, using Fusion 360 and FreeCAD. The models can be printed out using a 3d printer and then assembled into a physical robot.
Learn how to create Databases in Python, with SQLite3 and Redis.
KevsRobots Learning Platform
20% Percent Complete
By Kevin McAleer, 3 Minutes
In this lesson, we will cover the basics of Redis and how to use it with Python. Redis is an in-memory key-value store that can be used for caching, real-time analytics, message queues, and more. We will cover how to install and configure Redis, and how to use it with Python.
Redis
In this lesson, we will cover:
Redis is an in-memory key-value store that can be used for caching, real-time analytics, message queues, and more. Redis stores data in memory, which makes it very fast, but also means that it is limited by the amount of available memory.
Redis data is organized into key-value pairs, where the key is a string and the value can be any Redis data type, such as a string, hash, list, set, or sorted set. Redis provides a rich set of commands for working with data, including commands for manipulating strings, hashes, lists, sets, and sorted sets, as well as more advanced commands for working with data structures such as bitmaps and hyperloglogs.
To install Redis, you can download it from the Redis website and follow the installation instructions for your operating system. Once Redis is installed, you can start the Redis server using the redis-server command. By default, Redis listens on port 6379, but you can change this in the Redis configuration file.
redis-server
To use Redis with Python, you can use the Redis Python library, which provides a Pythonic interface to Redis. Here’s an example of how to use Redis with Python:
import redis redis_client = redis.Redis(host='localhost', port=6379) # Set a string value redis_client.set('mykey', 'myvalue') # Get a string value value = redis_client.get('mykey') # Delete a key redis_client.delete('mykey')
In this example, we create a Redis client using the redis.Redis method, which connects to the Redis server on localhost at port 6379. We then use the set method to set a string value for the key mykey, and the get method to retrieve the value. We also use the delete method to delete the key and its value.
After completing this lesson, you should be able to:
In this lesson, we covered the basics of Redis and how to use it with Python. We described Redis and its data model, and demonstrated how to install and configure Redis, and how to use Redis with Python using the Redis Python library. In the next lesson, we will cover Redis data types.
< Previous Next >
You can use the arrows ← → on your keyboard to navigate between lessons.
← →