Skip to main content

A simple Python library for creating web servers and APIs using sockets

Project description

socketwrench

A webserver based on socket.

Usage

import logging
from socketwrench import Server as SocketWrench
from pathlib import Path

logging.basicConfig(level=logging.DEBUG)

class Sample:
    def a(self):
        return "yes this is a"

    def b(self):
        return {"x": 6, "y": 7}

    def c(self):
        return Path(__file__)

    def d(self, x: int, y: int):
        return int(x) + int(y)

    def e(self):
        raise Exception("This is an exception")

s = Sample()

SocketWrench(s, serve=True)

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

socketwrench-0.1.0.tar.gz (12.1 kB view hashes)

Uploaded Source

Built Distribution

socketwrench-0.1.0-py3-none-any.whl (13.1 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