Skip to main content
# lazyhttp

Drop in replacement for `http.server` with convenience methods added.

```python
import json
import http.server

import lazyhttp

class Handler(lazyhttp.Handler):

def req(self, task):
if '/create' in self.path or '/update' in self.path and \
self.has(task, 'id', 'text'):
TASKS[task['id']] = task
elif '/delete' in self.path and self.has(task, 'id'):
del TASKS[task['id']]
elif '/get' in self.path and self.has(task, 'id'):
self.json(TASKS[task['id']])
elif '/all' in self.path:
self.json(TASKS)
else:
self.err('Nothing to do')

if __name__ == '__main__':
lazyhttp.run(Handler)
```

Metadata

Release files for lazyhttp 0.0.3

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

Source distribution (sdist)

Source distribution for lazyhttp 0.0.3
File Size Uploaded
lazyhttp-0.0.3.tar.gz 2.5 kB Details

Release files / lazyhttp-0.0.3.tar.gz

Download URL lazyhttp-0.0.3.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f5d637fcc0b1d0bc0291bcba5d4e72df47dff1eecf6d943e54041ddd23619eac
BLAKE2b-256 checksum
How to use checksums
a691eddd90219597d15173da38a874472f2eb86e94e909786100c2aea72f714d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.1

1 release file

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