Lamp
An asynchronous webserver made with sockets! (Not Finished)
Examples of using Lamp:
from WebLamp import Lamp, Connection
server = Lamp()
@server.route(path = '/', method = ['GET'])
async def home(conn: Connection) -> tuple:
return 200, b'Hello World!'
server.run(("127.0.0.1", 5000))
1 unique thing about this webserver is you can use a regex in your route and domain!
from WebLamp import Lamp, Connection
import re
server = Lamp()
@server.route(path = re.compile(r'^/u/(?P<userid>[0-9]*)$'), method = ['GET'])
async def home(conn: Connection) -> tuple:
userid = conn.args['userid'] # this came from the regex that was provided
return 200, userid.encode()
server.run(("127.0.0.1", 5000))
Metadata
Release files for WebLamp 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| WebLamp-0.2.6.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| WebLamp-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.0 kB
Release files / WebLamp-0.2.6.tar.gz
| Download URL | WebLamp-0.2.6.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71a695f0bec8d7d8102a8f9ff382d285c6de7657c09b6a39c329d874538e8d14
|
|
BLAKE2b-256 checksum How to use checksums |
626910ef28c30913474b48e99e8f63aad05a966157a18a6ffa43bed7d4e68a6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7
|
Release files / WebLamp-0.2.6-py3-none-any.whl
| Download URL | WebLamp-0.2.6-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a05418d53f7de7e9eede40c3d267f2672253e9863fa799bd4d8b9a817d202fc
|
|
BLAKE2b-256 checksum How to use checksums |
0028e51524889885178d90f48ace8451a22ebb6a5f13f68e7e8e8ab9e887ba52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7
|