Skip to main content

pyserve

Unify socket server implementations using session-based model

Install

pip install pyserve3

Example

from pyserve import *
from typing import Optional

class EchoServer(Session):

    def connection_made(self, addr: Address, writer: Writer):
        print('connection made!', addr, writer)
        self.addr   = addr
        self.writer = writer

    def data_recieved(self, data: bytes):
        print(f'recieved {data!r} from {self.addr}')
        self.writer.write(data)
        self.writer.close()

    def connection_lost(self, err: Optional[Exception]):
        print('connection lost!', self.addr, err)

# run sync
# listen_udp_threaded(('127.0.0.1', 8000), EchoServer)
# listen_tcp_threaded(('127.0.0.1', 8000), EchoServer)

# run async
import asyncio
# asyncio.run(listen_udp_async(('127.0.0.1', 8000), EchoServer))
asyncio.run(listen_tcp_async(('127.0.0.1', 8000), EchoServer))

Metadata

Release files for pyserve3 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyserve3 0.0.8
File Size Uploaded Provenance Actions
pyserve3-0.0.8.tar.gz 14.2 kB Without provenance Details for pyserve3-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyserve3 0.0.8
File Interpreter ABI Platform Actions
pyserve3-0.0.8-py3-none-any.whl Python 3 none any Details for pyserve3-0.0.8-py3-none-any.whl

Total release size: 31.1 kB

Release files / pyserve3-0.0.8.tar.gz

Download URL pyserve3-0.0.8.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bf5086b2d135a017ca5fa810d5adc3b3bbb43aeeaaa7ed61b2a0a666ed0750e9
BLAKE2b-256 checksum
How to use checksums
bbde0a66b8fbdc98695219b368bff259270c1b93dbe91c84b91f1efe6893f7f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / pyserve3-0.0.8-py3-none-any.whl

Download URL pyserve3-0.0.8-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d0e872308e2e96b11fa22af61fe60e1243fee55f6bc7b22934e39a7203b2375
BLAKE2b-256 checksum
How to use checksums
c544ab6ab3d7867725ca8633d4075e5b4458c3da8c0009dedf48df934e1def3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for pyserve3 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page