Skip to main content

A MINI AND EASY TO USE REDIS SERVER

Project description

READPY

  • PROJECT LINK GITHUB

  • PROJECT LINK PYPI

  • 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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

readpy_P-Y-R-O-B-O-T-1.0.3.tar.gz (42.5 kB view hashes)

Uploaded Source

Built Distribution

readpy_P_Y_R_O_B_O_T-1.0.3-py3-none-any.whl (30.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page