PickleSocket - Python Socket Library for Sending Python Objects

GitHub - Unstable-Robert/PickleSocket: Socket Library for sending python objects with pickle compression
Socket Library for sending python objects with pickle compression - GitHub - Unstable-Robert/PickleSocket: Socket Library for sending python objects with pickle compression

Overview

PickleSocket is an open-source Python library that simplifies and streamlines the process of managing socket connections while allowing the transmission of Python objects between networked devices. It is designed to provide a reliable, efficient, and secure way to send and receive data across network connections, making it a valuable tool for developers working on networked applications, client-server communication, and data exchange between Python processes.

Features

  • Socket Management: PickleSocket abstracts the complexities of socket management, allowing developers to focus on building applications without worrying about low-level network details.

  • Data Serialization: The library enables the transmission of Python objects over sockets by using the pickle module, making it easy to exchange data structures like dictionaries, lists, and custom objects.

  • Secure Communication: With the option to use a network key, PickleSocket enhances security by ensuring that communication is only possible with devices sharing the same key.

  • Heartbeat Mechanism: PickleSocket includes a heartbeat mechanism that helps monitor the health of network connections and allows for the automatic detection of connection issues.

  • Connection Reestablishment: The library supports graceful disconnections and reconnections, making it suitable for applications that require robust error handling.

  • Message Queue: PickleSocket manages message queues, ensuring that data is sent and received efficiently. The library's intelligent message handling minimizes the risk of data loss.

Getting Started

To get started with PickleSocket, follow the installation and usage instructions in the documentation.

from PickleSocket import PickleSocket

# Create a PickleSocket instance
pickle_socket = PickleSocket(name="MyNetwork", ip="127.0.0.1", port=8080, network_key="mykey")

# Start the manager thread to wait for connections
pickle_socket.start_manager(is_server=True)

# Send and receive Python objects over the network
message = {"data": "Hello, PickleSocket!"}
pickle_socket.queue_next_message_send(message)

Ending Connections

PickleSocket provides easy ways to handle disconnections:

  • Send a disconnect message to gracefully end the connection.
pickle_socket.send_disconnect_message()

Contact

If you have any questions or need assistance, please reach out to our team at robert.mannuzza@gmail.com.