Skip to main content

A Python library for simple TCP-based client-server communication

Project description

py-simple-network Library

A simple Python library for TCP-based client-server communication.

Installation

Install the library using pip:

pip install py-simple-network

Usage

Server

from py_simple_network import Server

server = Server(ip='127.0.0.1', port=8080, backlog=5, bufsize=1024)
server.run()

Client

from py_simple_network import Client

class MyClient(Client):
    def process(self, data:str):
        print(f'Received: {data}')

client = MyClient(ip='127.0.0.1', port=8080, bufsize=1024)
client.run()
client.send_data('Hello, Server!')

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

py-simple-network-1.0.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_simple_network-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file py-simple-network-1.0.0.tar.gz.

File metadata

  • Download URL: py-simple-network-1.0.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for py-simple-network-1.0.0.tar.gz
Algorithm Hash digest
SHA256 58ff16a3158c4f97ae6e97b384a352fdac7bce1abb6b4134bd91029c8eed6f59
MD5 c7e3eb82421c0bc12bc8f098409ad41e
BLAKE2b-256 2a14502e351497549f291a1e1db6a0d314336730efbfd2e61915c425d0e777e6

See more details on using hashes here.

File details

Details for the file py_simple_network-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_simple_network-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 601012a76da26c354ea3aa7c1b07b605e6613365a17f6722100edbee5b9381bf
MD5 4b8b118fec350dd7ebe62bc1d4743077
BLAKE2b-256 c10fe6181482c9aba247a197ad1b7c168c4b1b535eca8495886fba362caf5456

See more details on using hashes here.

Supported by

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