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
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for socketwrench-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af9fc899cbb33b07ed1d811c2664706fbbca1059244ada429244a8dd35cf1d47 |
|
MD5 | a8be29b4a269145cf52169d4fd178c5a |
|
BLAKE2b-256 | cbc652f8166f0fd87af76d9e50c43c27c271ea71d59f922b96a92e4039c68aff |