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.1.0.tar.gz (3.4 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.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file py_simple_network-1.1.0.tar.gz.

File metadata

  • Download URL: py_simple_network-1.1.0.tar.gz
  • Upload date:
  • Size: 3.4 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.1.0.tar.gz
Algorithm Hash digest
SHA256 cdf0f5802393aa777dabd0daed872ec59be3d899a477c8818df7db5da19332e6
MD5 bc4eb4654c5688119d4d8c2c006d44fa
BLAKE2b-256 b49c7758720b9f3744fb321abee2bfddb0338afd5fdd527ee315f8645d641ef6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_simple_network-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3210bb44a403c157263e5923de0f13422ef412836b2f8cf152ce5e4ea9ec56b5
MD5 d0601ad49e8ead84381d4f73c2dae3e4
BLAKE2b-256 caa4caf1db4d3d070c31cc33c8ae5fef629b48aff7a78a2b7322bf2c5712e65b

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