Esmerald

Latest version: v3.5.0

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

Scan your dependencies

Page 3 of 18

3.3.1

Changed

- Automatic detection of a response for a default status code when using OpenAPI documentation.
- Addressing `from __future__ import annotation` when using the dependency injection defaulting to Any.

3.3.0

Fixed

- Fixes `PydanticEncoder` when checking for subclasses of `BaseModel` causing the dependency injection to fail
for those specific types

Added

- Esmerald is ow using `python-slugify` instead of `awesome-slugify` for internals.
- OpenAPI Schemas Pydantic is now fully integrated with Esmerald OpenAPI.
- Esmerald now supports `app` as decorator prodiving another way of declaring the routing.

Example

python
!/usr/bin/env python
import uvicorn

from esmerald import Esmerald, Gateway, JSONResponse, Request, get


app = Esmerald()


app.get("/esmerald")
def welcome() -> JSONResponse:
return JSONResponse({"message": "Welcome to Esmerald"})


app.get("/esmerald/{user}")
def user(user: str) -> JSONResponse:
return JSONResponse({"message": f"Welcome to Esmerald, {user}"})


app.get("/esmerald/in-request/{user}")
def user_in_request(request: Request) -> JSONResponse:
user = request.path_params["user"]
return JSONResponse({"message": f"Welcome to Esmerald, {user}"})


if __name__ == "__main__":
uvicorn.run(app, port=8000)


The same is also applied to the `Router` object.

3.2.7

Changed

- Removed unused middleware.
- Updated AppSettingsMiddleware for lazy loading
- Updated `globalise_settings`.

Fixed

- Performance issues caused by `AppSettingsModule`.

3.2.6

Added

- `XFrameOptionsMiddleware` to handle with options headers.
- `SecurityMiddleware` adding various security headers to the request/response lifecycle.
- `override_settings` as new decorator that allows to override the Lilya settings in any given test.
- New `--simple` flag for `createproject` directive generating simple structured projects.
- Integration with new `rapidoc` as another alternative to display the OpenAPI docs.

Changed

- Internal `asyncz` decorator inside a wrapper.
- Updated pydantic an lilya requirements.

3.2.5

Fixed

- Added missing options into get_scheduler of AsynczConfig.

3.2.4

Added

!!! danger
This new version deprecates an old style declaring the scheduler for Esmerald.
There is a new [SchedulerConfig](https://esmerald.dev/configurations/scheduler).

- New [SchedulerConfig](https://esmerald.dev/configurations/scheduler) interface for Esmerald schedulers and
custom schedulers.
- New [AsynczConfig]() that implements the configuration for Asyncz scheduler.
- New `scheduler_config` parameter to Esmerald and EsmeraldAPISettings.

Changed

- Deprecate `scheduler_class`, `scheduler_configurations` and `scheduler_tasks`
in favour of the new [SchedulerConfig](https://esmerald.dev/configurations/scheduler) approach.
- Deprecate the use of the `EsmeraldScheduler`.
- Creation of multilingual documentation by DJWOMS in https://github.com/dymmond/esmerald/pull/339

Breaking changes

You must update the imports to be:

From:

python
from asyncz.contrib.esmerald.decorator import scheduler


To:

python
from esmerald.contrib.schedulers.asyncz.decorator import scheduler


Check the documentation about the [Scheduler](https://www.esmerald.dev/scheduler/scheduler/), [handlers](https://www.esmerald.dev/scheduler/handler/) and the [SchedulerConfig](https://esmerald.dev/configurations/scheduler) to
see how to update your current project to the new version with the minimum disruption.

This change should not break existing functionality, instead, its just an update to make it more modular.
There is an [example](https://github.com/dymmond/scheduler-example) how to simply use this.

Fixed

- Added missing options `--settings` into the `runserver` directive.

Page 3 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.