Heaven

Latest version: v0.4.1

Safety actively analyzes 688512 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.3.10

- Add the **IP Object** via the `req.ip` object property that provides an `ip.address` and `ip.port` expanded getter for the values.

0.3.9

- Automatically inject `heaven.Request`, `heaven.Response`, and `heaven.Context` objects into jinja2 template scope so it must not be manually added
- Add support for using mock heaven objects for writing testable code

0.3.8

- Add support for `response.interpolate(name: str, **contexts)` to render and return html templates without saving to res.body.

0.3.7

- Add support for `response.cookie(name: str, value: str, **kwargs)` functionality where `kwargs` supports
all the valid set-cookie header parameters (no case sensitivity).

0.3.6

- Change ASGI websocket response from `websocket.start` to `websocket.http.response.start`

0.3.5

- Add support for `._.` a.k.a lookup helper paradigm to manage heaven global state i.e. global state getter and setter
py
from http import HTTPStatus
from heaven import App

app = App()

save 'abc' under your app global state under the `save_me` key
app._.save_me = 'abc'

retrieve from your global state using the same `._.` paradigm
app.GET('/', lambda req, res, ctx: res.out(HTTPStatus.OK, f'This is what you saved: {req.app._.save_me}'))

think of **app**`._.`**this_field** AS **app** -> `lookup` -> **this_field** where `._. == lookup`

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.