A MINI AND EASY TO USE REDIS SERVER
Project description
READPY
-
A mini redis server written in python using CYPHER-PROTOCOL
-
For many purposes, 4GB 8GB RAM is not enough, we need services like REDIS, or what we RAM/MEMORY servers, this project makes using that task very easy.
COMPATIBLITY
-
READPY works with Linux, OS-X, and Windows (OS INDEPENDENT).
-
Supported on python 3.10 and above
INSTALLATION
Install it using pip.
- Goto PYPI
USAGE
CONFIGURATION
- For configuration of server and client need a configuration file named readpy_conf.json
CONFIG PARAMETERS
-
RECV_BUFFER and TRANSMISSION_BUFFER are parameters both should have same corresponding value for both server and client configuration.
-
ENCRYPTION_KEY and DECRYPTION_KEY are parameters which ensure encryption of data sent over connection, see CYPHER-PROTOCOL documentation for more information.
-
TIMEOUT is the time after which a connection is closed or reset from client side or server side.
-
READPY_NODE defines the interface address at which the server will be running (IP).
-
READPY_PORT defines port number on which server runs.
-
Example readpy_conf is given in CONF_FILES folder, consider that for more details.
CLIENT USAGE
-
Put the readpy_conf.json and TEST_SCRIPT/client.py in same folder and run in same directory space.
-
Consider the following code :
from READPY.CLIENT.client import READPY_CLIENT
if __name__ == "__main__" :
# INITIALISING THE READPY_CLIENT
CLIENT = READPY_CLIENT()
# WRITING THE DATA {"VAR1": "Hello from VAR1"} ON LOCATION ["CONSTANTS"] IN SERVER
print(CLIENT.write(["CONSTANTS"], {"VAR1": "Hello from VAR1"}))
# WRITING THE DATA {"PI": 3.14} ON LOCATION ["CONSTANTS", "MATH"] IN SERVER
print(CLIENT.write(["CONSTANTS", "MATH"], {"PI": 3.14}))
# UPDATING THE DATA {"PI": 3.14} TO {"PI": 3.1428} ON LOCATION ["CONSTANTS", "MATH"]
print(CLIENT.write(["CONSTANTS", "MATH"], {"PI": 3.14}))
# READING FROM THE LOCATION ["CONSTANTS"] FROM THE SERVER
print(CLIENT.read(["CONSTANTS"]))
# READING FROM THE LOCATION ["CONSTANTS", "MATH"] FROM THE SERVER
print(CLIENT.read(["CONSTANTS", "MATH"]))
SERVER USAGE
-
Put the readpy_conf.json and TEST_SCRIPT/server.py in same folder and run in same directory space.
-
Consider the following code :
from READPY.SERVER.server import READPY_SERVER
if __name__ == "__main__" :
# INITIALISING THE READPY_SERVER
SERVER = READPY_SERVER()
# STARTING THE SERVER
SERVER.start_node()
input()
# STOPPING THE SERVER AS SOON AS FILE INPUT FACES NEWLINE CHARACTER
SERVER.stop_node()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for readpy_P-Y-R-O-B-O-T-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33ec324fbde00675a4055bd49afae31c537ad78ef3596bb36789f40970ad1ed0 |
|
MD5 | e0a57bd38bddd894f27afa5c58d07903 |
|
BLAKE2b-256 | e92900b94623282bd4056a375bf80f9758cd4105e5266f3bce4ef6c9699f1057 |
Hashes for readpy_P_Y_R_O_B_O_T-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 793d0351b29bfe361843ccfabcec3084cf59ce9e15e4f74abb0d0375e1ab8db0 |
|
MD5 | b1d5b8fb6c209770d0c87c870512307b |
|
BLAKE2b-256 | 86b16660d4e1ae2356f9a8c85206047a5a8677ad0061b94a7ff8e6813ef8849f |