Skip to main content

Lamp

An asynchronous webserver made with sockets in python!

Examples of using Lamp:

from Weblamp import Domain, Lamp, Connection

server = Lamp()
domain = Domain(('your.domain.com', '127.0.0.1:5000')) 

@domain.add_route(path = '/', method = ['GET'])
async def home(con: Connection) -> tuple:
  return (200, b'Hello World!')

server.add_domain(domain)
server.run(
  bind = ('127.0.0.1', 5000)
)

1 unique thing about this webserver is you can use a regex in your route and domain!

import re

from Weblamp import Domain, Lamp, Connection

server = Lamp()
domain = Domain(('your.domain.com', '127.0.0.1:5000')) 

@domain.add_route(path = re.compile(r'^/u/(?P<userid>[0-9]*)$'), method = ['GET'])
async def home(con: Connection) -> tuple:
    userid = conn.args['userid'] # this came from the regex that was provided

    return (200, userid.encode())

server.add_domain(domain)
server.run(
  bind = ('127.0.0.1', 5000)
)

Metadata

Release files for WebLamp 0.3.0

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

Source distribution (sdist)

Source distribution for WebLamp 0.3.0
File Size Uploaded Provenance Actions
WebLamp-0.3.0.tar.gz 5.0 kB Without provenance Details for WebLamp-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 11.1 kB

Release files / WebLamp-0.3.0.tar.gz

Download URL WebLamp-0.3.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fc6b07a76d3d97c92abd093329eaf98fcab298d141d1535eb00f13746012f597
BLAKE2b-256 checksum
How to use checksums
4409a1684e1b9a941f285f1ccab71df8fcbbb82909ffc954e20e65d2aa22dd1d
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.3.0-py3-none-any.whl

Download URL WebLamp-0.3.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ee571cecd86d5cf12ede95190ff16aaa11cb9bb3f0e7e4acab581013f163942
BLAKE2b-256 checksum
How to use checksums
35fe49c7e2044f69b06781ebffc39a0c2173a43c53a436dcac82e5c9f0534668
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

Security for WebLamp 0.3.0

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.

Release history Release notifications | RSS feed

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