Release Notes¶
0.3.3¶
Changed¶
- Started full support for url_for instead of path_for.
Warning
path_for will be deprecated in future versions in favor of url_path_for.
If you want to avoid any break, please start updating from path_for to url_path_for as soon as possible. Same interface.
Breaking¶
To make sure you don't hit performance issues, we are moving directly to url_path_for, so if you use those you simply
need to update from path_for to url_path_for. We understand this is breaking but it is required for the upcoming features.
0.3.2¶
Changed¶
- Unified lazy caching mechanism for permission evaluation across
WebSocketHandler,Include, andBaseRouter. handle_permissions()now caches the effective permissions on first evaluation instead of mutating per-request state.- Internal
__slots__updated for clarity and memory optimization.
Fixed¶
- Avoided redundant recomputation of permissions and
lilya_permissionsin nested routing structures. - Prevented potential state mutation during concurrent permission evaluation.
0.3.1¶
Added¶
- Allow
XORandNORoperators in permissions.
Changed¶
- Cleanup
gateways.pyto make it maintainable and non redundant.
Fixed¶
- Duplicate check on Gateway permissions and WebsocketGateway permissions.
- Allowing async operators to work in permissions.
0.3.0¶
Added¶
runserver_themetoRavynsettings andrunserverdirective. This allows you to customise the theme of theravyn runservercommand.
Changed¶
- Rewritten the internals for OpenAPI representation models with Pydantic and compatible with Python 3.14+.
Fixed¶
- Regression in runserver with a path provided.
- Fix permissions operations AND,OR,NOT by @egorvavilov. PR #627.
- Lilya permissions and Ravyn permissions cannot be combined and now Ravyn raises an assertation error when it happens.
0.2.4¶
Changed¶
- Query Parameters documentation updated with generics (list, dict) examples.
Fixed¶
- Parsing query parameters with multiple datastructures was not parsing it properly
0.2.3¶
Added¶
- Support for the new AuthenticationMiddleware from Lilya.
- Extensive documentation for the AuthenticationMiddleware with examples and guides.
Changed¶
- Deprecate BasicAuthMiddleware in favour of the new AuthenticationMiddleware from Lilya and it will be removed from version 0.4.0.
- Updated the documentation for Edgy with the new AuthenticationMiddleware.
- Updated the documentation for MongoZ with the new AuthenticationMiddleware.
Fixed¶
- Overriding the
status_codefor custom encoder types (Pydantic, msgspec...).
0.2.2¶
Added¶
- Add response parameter to exception initialization.
Changed¶
- Simplified
Factoryinternals for cleaner nested provider handling and async consistency. - The Dependency Injection system now supports async providers in nested dependencies.
- GenericAlias was changed since Python 3.9+ to types.GenericAlias.
Fixed¶
- Exception handler for HTTPException was not properly handling the response from the shortcuts.
0.2.1¶
Added¶
- Support for Python 3.14
- Support for contrib shortcuts provided by Lilya.
0.2.0¶
Added¶
add_controlleralternative toadd_apiview.
Changed¶
- Update
runserverdirective to reflect the new Ravyn colour palette. - Webhooks are now inside
routing.webhooksand the handlers redundancy was removed. -
Routing apis is now called
controllers. For importing reasons, this is the update:**Before
from ravyn.routing.apisAfter
-from ravyn.routing.controllershas_permissionhas changed signature.**Before
def has_permission(request, apiview)After
- Thedef has_permission(request, controller)routing/apiviewURL in the docs is now pointing torouting/controllers.
Removed¶
Ravynwhen it was Esmerald, had theplugglablesas parameter but since the version3.5.0of Esmerald, now Ravyn, that was considered deprecated and instead theextensionswas added. This version now removes it for good from the internals.
Why is this happening? Is Esmerald going away? No, absolutely not. Esmerald remains and will remain as is and will keep growing as it has its own use cases but under a new name, Ravyn.
The reason for the rebranding its because the ecosystem has grown a lot and Esmerald was the first tool being created. Since then it was released as version 3+.
This happened because of internal dependencies, and we already removed all of them but goes a bit off compared to the rest of the ecosystem.
This is the reason for Ravyn to come into existence and to keep everything aligned with the future projects coming out.
Please check the migration guide for more details about how to migrate from Esmerald to Ravyn.
0.1.0¶
We are proud to announce the first official release of Ravyn (0.1.0) โ the async web framework that builds on the strengths of Esmerald while embracing a new identity and future roadmap.
Highlights¶
- New Identity: Esmerald has been renamed to Ravyn. All imports, documentation, and branding now reflect this change.
Migration from Esmerald¶
This is not mandatory at all but if you want to start using Ravyn right away, you can simply do:
- Replace all
esmeraldimports withravyn. - No breaking changes in core APIs โ projects built on Ravyn should run with minimal adjustments.
Please check the migration guide for more details about how to migrate from Esmerald to Ravyn.
Again, Ravyn is a rebrand of Esmerald with the same concepts, same everything.
Pior to Ravyn Rebranding¶
These are the releases done under the old Esmerald name and as you can now see, we have rebranded to Ravyn to align with the ecosystem plans starting a new set of versions from the 0.1.0.
3.9.5¶
Fixed¶
- Autodetection of app in cli.
- Generic lifespan support in
rundirective.
3.9.4¶
Changed¶
@directive(display_in_cli=True)discovery improved by showing errors and not throw directly an exception.- Update minimum Sayer version to 0.6.0.
- Custom directives under
@directiveare now displayed in a "Custom directives" group.
3.9.3¶
Added¶
- Support for
@directiveto be display when callingravynclient. - display_in_cli to
@directive. - Relay documentation section.
3.9.2¶
Changed¶
- Allow minimum Lilya to be 0.20.5
- Esmerald cli now loses the
nameargument. This is now handled directly by the newest Sayer that was internal refactored for the@callback.
3.9.1¶
Added¶
is_jsonandis_formproperties forRequest.- Introduced ravyn.contrib.mail providing a full-featured, async-first email framework.
- Includes a high-level
MailerAPI for sending single, multiple, and templated messages. - Supports multipart messages (text + HTML), custom headers, attachments (in-memory or files), and metadata.
- CLI integration,
ravyn mail sendtest, for sending quick test emails via console backend. - send_file to contrib.
- jsonify to contrib.
Built-in Backends¶
These backends are shared with Lilya as they are internally used.
- SMTPBackend: Async-friendly with connection pooling and TLS/authentication.
- ConsoleBackend: Writes messages to stdout for debugging.
- FileBackend: Saves emails as
.emlfiles for inspection or archiving. - InMemoryBackend: Stores emails in memory for development or testing scenarios.
Application Integration¶
- New
setup_mail(app, backend, template_dir, attach_lifecycle=True)utility attaches aMailertoapp.state.mailer. - Automatically opens/closes backend connections via startup/shutdown hooks.
Exception Hierarchy¶
MailError: Base exception for all mail errors.BackendNotConfigured: Raised when no backend or template renderer is configured.InvalidMessage: Raised when anEmailMessageis incomplete or malformed.
Changed¶
- Simplify
has_permissionfunction calls from the internals.
3.9.0¶
Changed¶
- Morph path argument into path option and expose it for all commands.
Fixed¶
- Properly detect wrapped Esmerald instances.
- Fix double initialization of app in runserver.
- Fix crash in runserver when no autodiscovery.
Internal¶
- Add the new
formatin theTaskfileandpyproject.toml.
Breaking¶
ravyn runserverloses its path argument. You can specify it viaravyn --path foo runserver.
3.8.11¶
Added¶
--versionattribute when runningcreateappdirective allowing to generate a versioned scaffold.--locationattribute when usingcreateappandcreateprojectdirective allowing to specify the location to be created.
Changed¶
- To make Esmerald lighter and simpler, the some minimal changes for the
SessionMiddlewareimport were added.
Before
from ravyn.middleware import SessionMiddleware
After
from esmerald.middleware.sessions import SessionMiddleware
Warning
Esmerald SessionMiddleware relies on itsdangerous Python package. You can install it by yourself or you can install
the esmerald[standard] package that brings all of the niceties of Esmerald.
In theory you don't need to worry ever about this as Esmerald injects this for you when using the session_config but if you
are importing directly, the previous change needs to happen.
- To make Esmerald cleaner in the installation we have now separated the installation. The Esmerald native client requires some additional packages and not everyone requires this or even desires but for those already using, the change is simple.
Before¶
$ pip install esmerald
After¶
$ pip install esmerald[standard]
This brings the current behaviour of Esmerald prior to version 3.8.11 and nothing changes at all.
**This is important if you are using the Form or request.form() as this comes with the standard packaging.
3.8.10¶
Changed¶
- Moved the
securitymodule imports down to use the Lilya contrib security.
Fixed¶
- Handlers were not preserving the original state.
@cachedecorator was not allowing proper serialization when used with handler.- Fix cache key generator for classes.
- Typos in documentation.
3.8.9¶
Changed¶
- Add
wrapsto theschedulerdecorator of Asyncz preserving the original state of the function. - Update Lilya minimum requirements.
3.8.8¶
Fixed¶
- Typing for
scheduler.
Changed¶
- Rewrite the interceptor to be on a ASGI bases and not from the base handler only. This makes it 100% ASGI compliant and allows to use the interceptor in any level independently.
- When a scheduler is instantiated and a lifespan is detected, then it should wrap it properly automatically.
3.8.7¶
Fixed¶
- Leftover
breakpoint()
Changed¶
- Reformat with ruff and really apply line length limit.
3.8.6¶
Fixed¶
- The way the permissions was being manipulated, although working 100% as they should, it was not respecting the ASGI life cycle.
- ake Esmerald permissions similar to ASGI Lilya in the internal life cycle.
3.8.5¶
Fixed¶
- Typo in the description of
runserver.
Changed¶
rundirective now injects a global context for the directive using the lilyag. This is available anywhere by usingfrom lilya.context import g.
3.8.4¶
Added¶
pathto runserver allowing the user to customise the path location of an Esmerald app.refreshUrlto OAuth2PasswordBearer.- Missing
json_schema_extrainto the parameters.
Changed¶
- Make
reloadin the runserverFalseby default. - Minimum default of Lilya as base.
Fixed¶
- Allowed hosts return default.
3.8.3¶
Added¶
- Support for a second form of declaring directives.
- Support for
@directivedecorator on top of a Sayer command making it a directive as long as it still follows the directive lookup for files.
Fixed¶
EsmeraldAPISettingswas not properly declared for backwards compatibility.- Migration to Sayer missed the
rundirective argument required as False. - Fix a regression on
EsmeraldAPISettingswhen importing fromesmerald. - Broken documentation references.
3.8.2¶
Added¶
- Missing
logging_levelin the EsmeraldAPISettings. - New naming convention for
EsmeraldAPISettingsto be now calledEsmeraldSettings. The oldEsmeraldAPISettingswill remain as is for backwards compatibility but it will eventually be removed in the future.
Changed¶
- Upgraded the internal requirements and Lilya.
- Revamped
runserverto be modern and more informative. - Updated the documentation for the
EsmeraldSettings.
3.8.1¶
Changed¶
- Update to latest mypy and removed old code.
- Updated the internals to support the latest Lilya version.
- Make sure the str types when annotations are passed and parsed are discovered by
get_type_hintswhen the create signature is triggered.
Fixed¶
- Documentation references.
3.8.0¶
Due to advanced changes in the internals of Esmerald, this release is a major one and it will be under the version 3.8
and it will follow Lilya's integration which means, we will be dropping the support for Python 3.9 and focus solely on 3.10+
for syntaxes and tooling.
Added¶
- Integration with the newest client, Sayer. This brings a whole new experience to the Esmerald cli and allows to have a more interactive experience with the framework.
Changed¶
- Drop support for Python 3.9 due technology advancements.
3.7.8¶
Fixed¶
- Bump Lilya version
- Removed constraints for rich.
- Fixed
runserverextra display message. - Fix for new click versions.
- Fix redis cache.
- Fix memory cache (it was much slower as it had to be).
3.7.7¶
Changed¶
- Added warning message to
runserverexplaining the usage in development mode only. - Lazy evaluate the environment variable for the settings import. This relaxes the restraints on the import order.
You can e.g. import lilya settings before adjusting
ESMERALD_SETTINGS_MODULEas long as you don't access the settings object.
Fixed¶
- Typing for the handlers (@get, @post...) that was causing mypy to give false positives.
- Documentation examples.
- Documentation references.
encodersENCODER_TYPES was a static snapshot of a ContextVar. Leverage a TransparentCage instead.
3.7.6¶
Changed¶
esmerald createproject <PROJECT-NAME> --edgyNow generates the settings also plugged withDatabaseSettingsautomatically.- Bump internal Lilya version to 0.13.0 minimum.
esmerald.loggingis now delegated to the thread-safe version oflilya.logging. Nothing changes in the Esmerald interface.
3.7.5¶
Added¶
- New LoggingConfig for the logging configuration. This now allows you to setup your own logging system and plug it with anything you want and then use the global logger from Esmerald to log your messages by simply using:
from esmerald.logging import logger
logger.info("My message in my logger.")
StandardLogging as the new default logging system of Esmerald, removing the dependency of loguru and make this one
optional.
Warning
If you use loguru and this might now "break" your code, simple run pip install loguru and add it into your dependencies.
- New
esmerald createproject --edgy <PROJECT-NAME>directive to create a new project with the scaffold for Edgy ORM.
Changed¶
- As part the continuous effort to make Esmerald cleaner, the
esmerald.protocolsnow lives insideesmerald.core.protocols. The only thing that needs changing its just that small import. The rest remains the same.
Fixed¶
- Typing for handler on Gateway/WebSocketGateway.
- Partial imports on handlers.
3.7.4¶
Fixed¶
- Partial imports on CSRF typing was causing the app to sometimes crash.
- Partial imports in types was causing the asyncz tests to crash.
Changed¶
- Move router methods in a mixin, so we have it in only two places.
3.7.3¶
Changed¶
- Bump Lilya version.
- Update settings loading module with Monkay.
- Change base of Esmerald to BaseLilya.
wheadrenamed towhheadfor naming consistency.- Monkay lazy loading now its at the
__init__of Esmerald.
Deprecated¶
- Saffier was the beginning of a big journey to what it later on became Edgy and for that reason, it makes no longer sense of keeping the support where Saffier is not growing as the same as Edgy.
Note
Saffier is under the name of its creator and he is more than happy to donate the ORM and the pypi package to anyone who would like to continue maintaining it.
Breaking Change¶
- This is not 100% sure but since passlib stopped maintenance a long time ago, since python 3.13 some other issues will
arise and therefore the decision to move away from it to bcrypt. Unfortunately this means that the
passwordhashing will not be compatible with the previous versions of Esmerald and we know this might not be ideal but this is the best way to move forward due to security constraints.
3.7.2¶
Changed¶
esmerald shellnow also imports thereversefunction from Lilya to make it simpler to test in the command-line.esmerald.routing.viewsto import the APIView must now be done viaesmerald.routing.apis. The reason for this change it was to keep the consistency in the codebase. Previously it was just an alias.
Fixed¶
esmerald show_urlswas displaying an extra parameter in the reverse lookup.
Removed¶
memory_cacheas this is not documented and should not be used. This is a leftover from internal testing.
3.7.1¶
Warning
This release introduces some import changes as part of the ongoing internal restructure of Esmerald. This will be done in different phases during different releasing but you can already see the Changed section to understand where the new imports must be done. Very likely that you won't need to do this but those serve as a reference.
Added¶
- When using
Requiresand a callable is not passed, Esmerald will generate a lambda callable automatically. - New experimental documentation section with the new features that are being tested.
- New gRPC documentation section with the new gRPC functionality.
-
New
wrap_middlewarefromesmerald.utils.middleware. This serves as alternative when setting up a middleware which also allows the fully module naming to be passed.from esmerald.utils.middleware import wrap_middleware -
New Learning and Examples section. This section will be growing in time and will help newcomers to understand a bit more about Esmerald.
Experimental¶
- GRPC - Support for GRPC endpoints and introduction to the newly
GrpcGatewaywrapper. This functionality is experimental to test in the next releases. If successful, it will be marked as final.
Fixed¶
- Bump Pydantic internal version to 2.11+.
Changed¶
The following must be updated if you are using any of these.
This is now part of the phase migration of modules to make them more consistent and easier to use.
esmerald.datastructuresis nowesmerald.core.datastructures.esmerald.cachesis nowesmerald.core.caches.esmerald.configis nowesmerald.core.config.esmerald.interceptorsis nowesmerald.core.interceptors.esmerald.transformersis nowesmerald.core.transformers.
3.7.0¶
Added¶
- Decorator
controller. This decorator allows to, as the name suggests, create a controller from a normal python objects. This is a simple way of creating a controller without the need of subclassing theControllerclass. - Decorators documentation section with the available Esmerald decorators.
- Support for native caching with support for custom backends.
- Observables documentation section. This is a new feature that allows to create observables that can be used to create a more reactive programming style.
Example¶
from esmerald.utils.decorators import controller
from esmerald import get, post
@controller(path="/items")
class ItemHandler:
@get("/{item_id}")
async def get_item(self, item_id: int) -> dict:
return {"item_id": item_id}
@post("/")
async def create_item(self, data: dict) -> dict:
return {"message": "Item created", "data": data}
The rest remains as per normal usage of Esmerald.
3.6.8¶
Added¶
-
Esmerald now allows the import of Lilya EnvironLoader directly using it directly via:
from esmerald.utils.environments import EnvironmentLoader -
Factory now accepts
kwargsparameters. - You can now declare dependencies without using explicitly the
Inject().
Changed¶
- Event lifecycle fully delegated to Lilya internals removing duplication.
- Cleanup internals for the path and delegate to Lilya.
- Background tasks pointing 100% to Lilya.
- Moved
concurrecytoesmerald.utils.concurrency. - Moved
esmerald.enumstoesmerald.utils.enums. - Refactored
parse_form_datafromesmerald.parsersinto a cleaner version.
Fixed¶
- Documentation pointing to the state of the CI.
Removed¶
- Official support for Mako template engine as previously announced.
3.6.7¶
Added¶
before_requestandafter_requestWebSocketGateway handler added.before_requestandafter_requestadded as default to the settings. This was not required as the settings loading system of Esmerald defaults values but this should be added to the settings for consistency reasons of the framework.
Changed¶
- Reverse order on Gateway
after_request.
Fixed¶
override_settingswas not taking into account async functions.
3.6.6¶
Added¶
Esmerald,Include,Host,Gateway,HTTPHandlerandRouternow supportbefore_requestandafter_requestlife cycles. This can be particularly useful to those who want to perform actions before and after a request is performed. E.g.: Telemetry.- Missing before and after request in the handler helpers.
BaseControlleralias for theView. This serves a preparation for the internal renaming.
Fixed¶
- Internal permission checking for Lilya and Esmerald was not extended to
Viewbase of Controllers. - Inheritance extending previous permissions on Controllers.
3.6.5¶
Added¶
- Esmerald now also supports Pure ASGI Permissions. That means you can pass the same style of permissions as the ones used in Lilya as alternative to the native Esmerald permission system.
- New Lilya permissions documentation section.
Changed¶
- Permissions section moved and renamed to Esmerald Permissions.
Fixed¶
set_cookiewas causing an issue when multiple were being generated.
3.6.4¶
Added¶
- Support for
asyncjinja templates. - Missing
esmerald --versioncommand to the cli.
Changed¶
- Removed hard dependency of
nest_asyncio. - Use ORJSON as parsing json.
Fixed¶
- Internal pattern for OAuth2 form password.
- Fixed internal typings of passthrough in Response and TemplateResponse.
- Esmerald permissions on Include were being overriten by Lilya too early.
3.6.3¶
Added¶
- Requires() as a new independent way to manage dependencies.
- A more thorough explanation about the Security(), how to use it and examples.
Changed¶
- Expose
Controllerinesmeraldas alternative toAPIView. This was already available to use but not directly accessible viafrom esmerald import Controller.
Fixed¶
- Fix escaped " in TemplateResponse.
- Fix TemplateResponse's auto-detection of the media-type when used directly.
- Don't mangle strings by default for other media-types than json.
- Don't mangle returned responses.
- Reverse lookup or Class based views and nested naming using
path_for
3.6.2¶
Added¶
nameparameter to StaticFiles config allowing to reverse lookup internally.- Support for Python 3.13
- Support for
redirect_slashesin the Include. status_codeto ResponseContainer to be parameter detectable.
Changed¶
- Cleanup Response.
- Move
transformmethod to lilya but provide speedup in a mixin. - Esmerald
Responsebehaves likemake_responsein lilya with a plainResponse. - Special handle None (nothing is returned) in
Response. It shouldn't map tonullso not all handlers have to return a value.
Fixed¶
dataandpayloadspecial kwargs are now allowed when a not-bodyless method is available for the handler. They default to None.byteswon't be encoded as json when returned from a handler. This would unexpectly lead to a base64 encoding.- SessionConfig has a unneccessarily heavily restricted secret_key parameter.
- Gracefully handle situations where cookies are None in
get_cookies. - Fix validation of parameters requiring a body.
3.6.1¶
Added¶
- Allow passing extensions as string.
Changed¶
- Change
media_typeparameter ofResponsefromMediaType.JSONtoNoneto match the default of the underlying lilya Response.
Fixed¶
- OpenAPI responses.
- Enum definitions.
3.6.0¶
Added¶
- New Security section with all the explanations how to use the internals of Esmerald.
- Added new
Securityobject used for security dependencies using Esmeraldesmerald.securitypackage.
Changed¶
- Updates from python-jose to PyJWT as dependency contrib library.
- Remove OpenAPI security as they where redundant and not 100% compliant with OpenAPI security.
- Allow the new Lilya StaticFiles allowing to provide multiple directories with fallthrough behaviour.
- Deprecate support for Mako.
- Internal code organisation and cleaning.
Fixed¶
- Fix cli detection of wrapped esmerald instances or different ASGI servers.
- Allow passing multiple
StaticFilesConfigconfigurations in a tuple. - Allow passing multiple directories to
StaticFilesby removing the stringification inStaticFilesConfigso a fallthrough behavior can be established. Note: this requires a newer lilya version.
3.5.1¶
Changed¶
- Use assigned encoders at requests for json_encoder.
- Allow overwriting the
LILYA_ENCODER_TYPESfor different encoder sets or tests. - Use more OrJSON for encoding requests.
3.5.0¶
Added¶
- Allow passing HTTP/WebSocket handlers directly to routes. They are automatically wrapped in Gateways-
- Allow passing HTTP/WebSocket handlers directly to routes as alternative to defining a Gateway/WebsocketGateway.
Changed¶
- Esmerald is now under the License BSD-3. This aims to protect the maintainers and contributors and the license will be now the final.
- Pluggables can now receive plain Extensions and Extension classes.
- Rename of Pluggables to Extensions:
- Breaking: The
pluggablesattribute and parameter are now renamed toextensions. The old name is still available but deprecated. - Breaking: The
add_pluggablemethod is now renamed toadd_extension. The old name is still available but deprecated. - The documentation will refer now to extensions with
Pluggableas a setup wrapper.
- Breaking: The
Fixed¶
- Directive
runservernow allows the use of ASGI middlewares. - Remove the dependency of an app being an
esmeraldinstance forrunserver. - Check the environment variables instead of settings variable for esmerald settings in the runserver.
3.4.4¶
Added¶
- Support for Taskfile when generating a project via directive.
- Add taskfile for development mode.
Changed¶
- Internal JSONResponse is now natively supporting ORJSON.
3.4.3¶
Changed¶
- PydanticEncoder now tries mode
jsonfirst as default. - Stop ignoring warnings in the tests.
- Stop shadowing the BaseDirective
helpfrom Lilya. - Asyncz settings for empty tasks.
- Update the docs for the templates.
3.4.2¶
Changed¶
- OpenAPI for inheritance models using pydantic or any type of encoders.
- Stop supporting Python 3.8.
- Changed internal schema location in the helpers.
3.4.1¶
Changed¶
- OpenAPI now if no
descriptionis provided from the handlers, it will read directly from the docstrings. - Internal code cleaning and organisation.
Fixed¶
- OpenAPI query parameters were not rendering properly for optional
dictorlisttypes. This was due to the internal evaluation of theNonefield which is now skipping for OpenAPI purposes.
Example¶
Now it is possible to do something like this:
from typing import Dict, List, Union, Optional
from esmerald import Gateway, JSONResponse, Query, get
@get("/item")
async def check_item(q: Union[List[str], None]) -> JSONResponse:
return JSONResponse({"value": q})
@get("/another-item")
async def check_item(q: Optional[Dict[str, str]]) -> JSONResponse:
return JSONResponse({"value": q})
3.4.0¶
Added¶
- New ways of providing the request data allowing to pass a more complex body using also the encoders. The complex body is explained and how to achieve this result.
Warning
This is an additional functionality to the existing one and it does not represent any replacement. Be sure you read the documentation and if you understand it.
Example¶
As per some examples of the documentation:
from pydantic import BaseModel, EmailStr
from esmerald import Esmerald, Gateway, post
class User(BaseModel):
name: str
email: EmailStr
class Address(BaseModel):
street_name: str
post_code: str
@post("/create")
async def create_user(user: User, address: Address) -> None:
"""
Creates a user in the system and does not return anything.
Default status_code: 201
"""
app = Esmerald(routes=[Gateway(handler=create_user)])
You can expect to send a payload like this:
{
"user": {
"name": "John",
"email": "john.doe@example.com",
},
"address": {
"street_name": "123 Queens Park",
"post_code": "90241"
}
}
More details can and must be read in the request data section.
Changed¶
- Overriding the
status_codein any response is now possible directly by specifying the intended response and ignoring the default from thehandler.
Example¶
@get()
def create(name: Union[str, None]) -> Response:
if name is None:
return Response("Ok")
if name == "something":
return Response("Ok", status_code=status.HTTP_401_UNAUTHORIZED)
if name == "something-else":
return Response("Ok", status_code=status.HTTP_300_MULTIPLE_CHOICES)
If none of the conditions are met, then it will always default to the status_code of the handler which in the get case,
its 200.
Fixed¶
- Internal parsing of the encoders for OpenAPI representation and removed unused code (deprecated).
3.3.7¶
Added¶
- New application generator using
--contextallowing to generate application scaffolds containing more complex structures.
Changed¶
- jinja2 templating is now 100% delegated to its base, Lilya.
- Added examples in the documentation for windows users.
Fixed¶
- Lookup for summary in the handler for OpenAPI.
3.3.6¶
Added¶
allow_private_networksproperty toCORSMiddleware.
Changed¶
Gatewaynow allows to pass also an optionaloperation_idas parameter for OpenAPI documentation allowing multiple gateways to use the same handler and being recognised automatically by OpenAPI documentation.- OpenAPI documentation when multiple gateways use the same handler and no
operation_idis declared, automatically tries to generate a uniqueoperation_idfor it. - Internal code organisation for class based
Viewto generate the routes in one place and reducing code duplication. - Updated internal testing requirements for Edgy and Saffier and Lilya.
3.3.5¶
This was missed from the release 3.3.4 and it was supposed to be included.
Added¶
- Native types for Esmerald transformer models/
- Hashing list internally for the signature allowing lists to be declared for OpenAPI representation.
Changed¶
- Query parameters when declared as
list,List,dictandDictautomatically parses the values to the declared type. - OpenAPI understands the native types, objects and lists (arrays).
3.3.4¶
Added¶
- Missing documentation for Query Parameters and Path Parameters.
Changed¶
- Documentation for
Extra, Advanced && Usefulis now renamedAdvanced & Usefuland its located in theFeaturessection. - Removed unused internal functions for validations now used by Esmerald encoders.
Fixed¶
- Regression caused by the introduction of the dynamic encoders when diplaying the query parameters in the OpenAPI documentation.
- Annotation discovery for the Signature.
3.3.3¶
Changed¶
- Internal implementation of the exceptions.
- Removed redundant exception declaration and delegate the internals to Lilya.
- Internal code cleaning.
Added¶
- ValidationError for custom independent raising exceptions within any Esmerald application
Fixed¶
is_server_errorfor dependencies was causing an exception to be raised in aloc[-1].
3.3.2¶
Changed¶
- Update the internals of contrib for Asyncz to match the new Asyncz specifications and API.
3.3.1¶
Changed¶
- Automatic detection of a response for a default status code when using OpenAPI documentation.
- Addressing
from __future__ import annotationwhen using the dependency injection defaulting to Any.
3.3.0¶
Fixed¶
- Fixes
PydanticEncoderwhen checking for subclasses ofBaseModelcausing the dependency injection to fail for those specific types
Added¶
- Esmerald is ow using
python-slugifyinstead ofawesome-slugifyfor internals. - OpenAPI Schemas Pydantic is now fully integrated with Esmerald OpenAPI.
- Esmerald now supports
appas decorator prodiving another way of declaring the routing.
Example¶
#!/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¶
This was missed from version 3.2.6.
Changed¶
- Removed unused middleware.
- Updated AppSettingsMiddleware for lazy loading
- Updated
globalise_settings.
Fixed¶
- Performance issues caused by
AppSettingsModule.
3.2.6¶
Added¶
XFrameOptionsMiddlewareto handle with options headers.SecurityMiddlewareadding various security headers to the request/response lifecycle.override_settingsas new decorator that allows to override the Esmerald settings in any given test.- New
--simpleflag forcreateprojectdirective generating simple structured projects. - Integration with new
rapidocas another alternative to display the OpenAPI docs.
Changed¶
- Internal
asynczdecorator 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.
- New SchedulerConfig interface for Esmerald schedulers and custom schedulers.
- New AsynczConfig that implements the configuration for Asyncz scheduler.
- New
scheduler_configparameter to Esmerald and EsmeraldAPISettings.
Changed¶
- Deprecate
scheduler_class,scheduler_configurationsandscheduler_tasksin favour of the new SchedulerConfig approach. - Deprecate the use of the
EsmeraldScheduler.
Breaking changes¶
You must update the imports to be:
From:
from asyncz.contrib.esmerald.decorator import scheduler
To:
from esmerald.contrib.schedulers.asyncz.decorator import scheduler
Check the documentation about the Scheduler, handlers and the SchedulerConfig 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 how to simply use this.
Fixed¶
- Added missing options
--settingsinto therunserverdirective.
3.2.3¶
Changed¶
EsmeraldSchedulerintegration with Asyncz is not assembled before the configuration of the routing, allowing multiple events to be triggered without overriding.
3.2.2¶
These changes were missed from the version 3.2.1
Changed¶
- Updated the default scheduler class to be in the configuration.
- Internal Dispatcher implemented for the routing and response handlers update.
3.2.1¶
Changed¶
Contextis not inheriting directly from Lilya.
Fixed¶
- The default
scheduler_classinternal settings validation.
3.2.0¶
Added¶
settings_modulealso supports import as string.- New
encodersto Esmerald settings and instance parameters. - New
register_encoderencoder in any Esmerald and ChildEsmerald instances. - New
encodersto Esmerald responses. This allows to use any Response as ASGI application. with unique custom encoders. - Encoders documentation.
Changed¶
- Internal refactor of the
classmethodsof theTransformerModel. The class methods are now normal python functions. - Unifying the transformers in the signature model.
- Rename
EsmeraldSignaturetoSignatureModel.
3.1.5¶
Added¶
This change was supposed to be shipped in the version 3.1.4 but it missed the release.
- Printing the stack trace when an Esmerald application is in
debug=Trueproviding a deeper level of understanding the source of the errors.
3.1.4¶
Fixed¶
- AsyncExitMiddleware raising exception.
- OpenAPI error when generating the parameters with dependencies.
- OpenAPI security schemes.
3.1.3¶
Changed¶
- Internal support for
hatchand removed the need for aMakefile. - Internals for Directives. #308 by @devkral.
- Documentation references and refinements #311 by @paolodina.
WSGIMiddlewareis now pointing to Lilya.
3.1.2¶
Fixed¶
- Regression with
typing_extensions.
3.1.1¶
Added¶
Changed¶
- Documentation improvements.
Fixed¶
- Typo in the create project directive urls file descripton.
operation_idbeing generated to include the class based view name when coming from class based views handlers. #PR 289 by @tarsil.
3.1.0¶
Added¶
settings_modulewhen passed in the instance of Esmerald will take precedence over the global settings, removing the need of using constantly theESMERALD_SETTINGS_MODULE.ApplicationSettingsMiddlewareas internal that handles with thesettings_moduleprovided and maps the context of the settings.
Example of the way the settings are evaluated¶
from esmerald import Esmerald, EsmeraldAPISettings, Gateway, Include, JSONResponse, get, settings
@get()
async def home() -> JSONResponse:
return JSONResponse({"title": settings.title})
class NewSettings(EsmeraldAPISettings):
title: str = "Main app"
class NestedAppSettings(EsmeraldAPISettings):
title: str = "Nested app"
app = Esmerald(
settings_module=NewSettings,
routes=[
Gateway("/home", handler=home),
Include(
"/child",
app=Esmerald(
settings_module=NestedAppSettings,
routes=[
Gateway("/home", handler=home),
],
),
),
],
)
In the context of the controller home, based on the path being called, it should return the
corresponding value of the title according to the settings of the app that is included.
Changed¶
createappdirectiveviews.pyfile generated renamed tocontrollers.py.- Make the
EsmeraldAPISettingshashable. - Remove
settings_configin favor of thesettings_module. - Bump Lilya version to 0.3.3.
Fixed¶
3.0.0¶
Changed¶
- Moved from beta v3 version to the official v3 of Esmerald fully supporting Lilya.
3.0.0-beta2¶
Added¶
- Allow the use
from lilya.middleware import Middlewareas alternative toDefineMiddleware,
Changed¶
- Cleaned the
ServerErrorMiddlewarefrom the lilya import.
3.0.0-beta1¶
Warning
This is a major release and it will be under the the version 3 of Esmerald.
You should not be affected but in case you are, please report any issues
so we can correct it.
Added¶
- Support for
Lilyaand dropStarlette.
Changed¶
CSRFConfigcookie_securerenamed tosecure.CSRFConfighttponlyrenamed tohttponly.CSRFConfigcookie_samesiterenamed tosamesite.CSRFConfigcookie_domainrenamed todomain.CSRFConfigcookie_securerenamed tosecure.- Removed support for the
BasicMiddlewareas this can be imported from any other ASGI application.
Internal¶
In the past, Middleware was being used but with the introduction of Lilya, now is DefineMiddleware that
is applied.
from lilya.middleware import DefineMiddleware
- The
PlainTextResponsewas renamed toPlainText.
2.7.4¶
Fixed¶
WSGIMiddlewareoptional was being called in the core middlewares.
2.7.3¶
Added¶
- Allowing
appto load as a string as alternative to an object inside theInclude.
Changed¶
- Internal code for lazy objects.
- Make
a2wsgioptional forWSGIMiddleware. httpxis now only a depedency for testing.- Cleared some core dependencies.
2.7.2¶
Changed¶
- Security update for python multipart.
- Update minimum Starlette requirement.
2.7.1¶
Added¶
settings_moduleas replacement forsettings_config.- Deprecation warning for
settings_configin favour ofsettings_moduleparameter.
Changed¶
- Added improvements to the scaffold generated by
esmerald createprojectin the tests. - Added extra origin type for when a MsgSpec Struct is passed in the payload of a handler.
Fixed¶
- OpenAPI Tags not loading from top down if handler had
tags=None. - TestClient to allow passing pluggables inside
create_client.
2.7.0¶
Changed¶
Token.decode()is now aclassmethod. This allows to subclass theTokenand add extra fields into the model allowing operations likeencode()with extra claims. This can be useful for situations like claiming arefreshoraccesstoken.- Internal handlers decorators are now wrapped in a function decorator. This does not affect anything but allows more control over the middleware calls to async ASGI applications.
Fixed¶
- OpenAPI when overriding the response for the default status codes of the handlers.
2.6.0¶
Added¶
- New createdeployment directive allowing the generation of deployment scaffolds for any Esmerald project.
Changed¶
- Added
requirementsto thecreateprojectdirective generating the minimum requirements for an Esmerald project.
Fixed¶
BaseAuthenticationforself.appwhen its of the type of HTTPHandler and WebSocketHandler.
2.5.0¶
Changed¶
- Upgraded internal dependencies.
- The internals for the middleware are now delegated to Starlette directly.
- Middlewares of Gateway and WebSocket Gateways are now delegated to Starlette.
Fixed¶
- Internals to be compliant with new version of Starlette.
- Building middleware stack for the
Middlewareobject. - Internal testing to reflect the new way of the
Includeto be compliant with the ASGI spec.
2.4.3¶
Fixed¶
- OpenAPI
contactit was not parsing properly on transformation. - Rename
includeattribute fromParam(base) and callinclude_in_schema. - Missing
nest_asynciodependency when usingesmerald shell.
2.4.2¶
Changed¶
- Pin starlette version to
0.32.0.post1
2.4.1¶
Fix¶
- Regression when performing a
model_dumpof pydantic models in the responses. - Re-enable
orjsonfor generic response parsing.
2.4.0¶
Changed¶
- Updated SwaggerUI version.
- Updated responses with a
msgspecresponse example.
Added¶
- Support for payload as alternative to
data. This aims to make the process more intuitive and easy to implement. #199. - Context - The new context object for the handlers.
- Support for msgspec natively allowing to have more than just Pydantic.
Note
Esmerald is not fully tight with Pydantic which means it's more flexible and extendible and allows more versatility.
Fixed¶
- Missing Request document.
- Removed the use of
randomfor the secrets in favour of thesecretslibrary instead. - Contrib documentation updates regarding the Authorization headers.
2.3.1¶
Fixed¶
Middlewareas an independent ASGI app on anIncludelevel.
Warning
This was supposed to go in the release 2.3.0 but it was not merged on time to make the release.
2.3.0¶
Changed¶
- OpenAPI fields are permanently moved to OpenAPIConfig
making the codebase cleaner. The options are still available via
settingsin case of wanting to override the defaults but not via instantiation parameters. Via instantiation theOpenAPIConfigis the one to be used.
Warning
This is a breaking change. The functionality itself still works as it is supposed to but from now on instead of passing via Esmerald instance, you need to pass the variables via OpenAPIConfig. object instead.
Added¶
- Annotated for documentation generators.
- Add new documentation structure for Esmerald base.
- Add API Reference . #196
Fixed¶
- Allow tags for levels. When a tag is added to an
Include,Gateway, or any other level, the tags are appended to the final handler. This allows inheriting from existing tags for OpenAPI. Middlewareon levels treating each level as an independent ASGI app.
2.2.0¶
Changed¶
- Updated
OpenAPIConfigdocumentation. - Deprecate
v1. Esmerald prior to version 2.0 is no longer supported.
Added¶
- Allow importing from from string into
Factory. #179 by @tarsil. - New security objects for OpenAPI documentation.
- New OpenAPI documentation describing the ways of using it and what is available with examples.
- New SimpleAPIView supported.
- New CreateAPIView supported.
- New ReadAPIView supported.
- New DeleteAPIView supported.
- New ListAPIView supported.
Fixed¶
- OpenAPI
securitywas not working as intended.
2.1.0¶
Changed¶
- Update base requirements and pydantic to 2.4.
Added¶
- New Factory added for dependency injection allowing to pass any time via Factory instantiation. PR #163 by @ShahriyarR.
- Support for Mongoz showcasing how to integrate Esmerald with an ODM (MongoDB).
- Documentation about how to use Esmerald contrib with Mongoz.
Fixed¶
- Typos in the documentation.
- Pydantic 2.4 compatibility and updating to new names for the functions.
2.0.6¶
Changed¶
- Updated requirements for Pydantic and Starlette.
- Removed unnecessary dependencies.
Added¶
- Support for async
has_permissionon Permissions. - Add new landing page.
Fixed¶
email-validatorerror being thrown fromopenapi-schemas-pydanticrequirement.
2.0.5¶
Changed¶
- Updated the way
esmeraldclient operates internally. - Updated internal minimum requirements.
Fix¶
- Regression in OpenAPI when adding middleware to
GatewayorHTTPHandler. When a middleware was added, the OpenAPI would not generate the docs for it. The API would still work but not OpenAPI docs.
2.0.4¶
Changed¶
- Updated functional internal crypto to only use the system random.
- Cleaner codebase for the application settings.
- Updated version of Asyncz to be at least 0.5.0.
Added¶
- Custom exception handlers,
from esmerald.exception_handlers import value_error_handler. - New native exception handler for pydantic v2 Validation errors in general.
- Dataclasses (normal and Pydantic dataclases) are now supported as Esmerald Responses.
- Support for OpenAPI Webhooks.
- Improved Responses documentation with examples using Pydantic BaseModel and dataclasses.
- OpenAPI Spotlight Elements documentation. When starting the application, accesing the default
/docs/elements. - Support for Edgy ORM. Docs here.
Fixed¶
- Removed old pydantic v1 syntax from tests and applications.
add_include()that wasn't generating signature models upon import.- OpenAPI query params with defaults weren't loading properly.
2.0.3¶
Note
This addition was supposed to go in the release 2.0.2 but somehow it was missed in the merge of the pull requests. It is not a bug fix but instead is a simple new directive that can be useful for those who like using the command-line.
It is important to understand that this support won't be available on releases of Esmerald 1.X.
Added¶
- Interactive shell support directive for any Esmerald application.
2.0.2¶
Changed¶
- Updated Field, Form and Body from
esmerald.paramswith current defaults. - Removed redundant cast from
FiletoBodyas it is a subclass.
Added¶
- Added
strictandmax_digitsesmerald paramsesmerald.params. - Deprecate
exampleas OpenAPI 3.10 supportsexamples. Use examples instead ofexample.
Fixed¶
- UploadFile sending as a list and as normal. This got broken when the migration to pydantic 2.0 happened.
FileandFormfromesmerald.paramsnow acceptannotation.- OpenAPI for
UploadFileas single and list now being parsed as a model.
2.0.1¶
This is a small fix into the parser of lists for the OpenAPI specification.
Fixed¶
- OpenAPIResponse now allows proper parse of lists as definition. More details.
2.0.0¶
Warning
When upgrading Esmerald to version 2, this also means the use of Pydantic 2.0 at its core as well as corresponsing technologies already updated to version 2 of Pydantic (Saffier, Asyncz...). If you still wish to continue to use Pydantic 1 with Esmerald, it is recommended to use Esmerald prior to version 2.0 which it will be maintained for a shor period but we strongly recommend to always use the latest version.
Changed¶
- Major update of the core of Esmerald from Pydantic v1 to Pydantic v2.
ResponseSpecificationrenamed toOpenAPIResponse,from esmerald.openapi.datastructures import OpenAPIResponse.- Changed deprecated functions such as
validatorandroot_validatortofield_validatorandmodel_validator. - Transformers no longer support custom fields. Pydantic natively handles that.
- EsmeraldSignature updated for the new version of the FieldInfo.
paramsreflect the new Pydantic FieldInfo.- Deprecated OpenAPIView in favour of the new OpenAPI documentation generator.
- Changed OpenAPI config to reflect the new generation of OpenAPI documentation.
- Internal data field is now returning Body type parameter making it easier to integrate with Pydantic 2.0.
- General codebase cleanup.
- Removed old OpenAPI document generator in favour to the newest, fastest, simplest and more effective approach in v2.
- Remove the support of pydantic 1.0. Esmerald 2+ will only support pydantic 2+.
Added¶
- OpenAPI support for OAuth2.
Fixed¶
- FileResponse
stat_resultand Streamiteratortyping. - Fix typing across the whole codebase.
- Transformers are now generating Param fields directly.
- Updated fields in favour of the new pydantic model_fields approach.
1.3.0¶
Changed¶
- OpenAPI imports and removed unused dependencies.
- Deprecate
pydantic_factoriesin favour ofpyfactories. - Dropped support for Tortoise ORM natively.
Fixed¶
- Rename
scripts/formattoscripts/lintfor consistency. get_hasherfrom contrib fixed with the return value of the algorithm.- Typing of the codebase updated.
1.2.5¶
Fixed¶
- Removed deprecated functions allowing the mount and host.
- Fixed show_urls for openapi specification.
1.2.4¶
Changed¶
- Updated pyproject.toml keywords.
- Updated to the latest Starlette 0.28.0.
- Exception handler logic refactored.
1.2.3¶
Fixed¶
- Upgrade Starlette version to >=0.27.0 for a security release. Details on Starlette's security
1.2.2¶
Fixed¶
- Exception handler message when
rundirective does not find custom directive properly.
1.2.1¶
Fixed¶
- Lifespan generator for the
rundirective.
1.2.0¶
Changed¶
- Updated native requirements of the project.
- Removed old core management in favour of click.
- Deprecated
managementpackage in favour ofdirectives. #83. - Deprecate
esmerald-admin. Now you can simply callesmeraldwith the same directives as before. Simplification via command line #86.- Example:
esmerald createproject <NAME>esmerald createpapp <NAME>
- Example:
Added¶
- Support for Ruff.
- New esmerald core admin management directives #83.
- New directives client.
- Added rich for command line colours, tables.
- New native directives:
Fixed¶
- Linting and formatting issues with Ruff.
1.1.0¶
Changed¶
- Updated support for Starlette 0.26.1
- Updated support for Lifespan [./lifespan.md] events
- Requests url_for parsing the URL type to return string on parsing #69.
- Esmerald official documentation also available on https://esmerald.dev #70.
- Updated Github CI to deploy also to https://esmerald.dev #73
Added¶
- Internal implementation of on_startup and on_shutdown. #74.
- Added new internal implementation of on_event and add_event_handler functions. #74.
- Missing documentation about the background tasks #71
- Documentation for lifespan events #72
- Added condition to allow cached_properties from the EsmeraldAPISettings and in the settings without raising an Exception.
- New handlers. OPTIONS, HEAD and TRACE. Check out the handlers for more details.
Fixed¶
- New Starlette Lifespan #75. This is now also available to be done in the same way Starlette does. Internally Esmerald also implements the on_startup and on_shutdown but that is an unique implementation. This implementation follows the same pattern as the official Starlette Bridge
1.0.0¶
Changed¶
-
ChildEsmerald now supports the parent which means it can share middlewares and interceptors across main application and children.
Note
Prior to version 1.0.0, sharing resources between Esmerald and ChildEsmerald was not allowed and it needed to be treated as completely isolated application. In the version 1.0.0 you can still isolate them but you can also share resources.
0.15.0¶
Added¶
-
Esmerald Pluggables #60.
This is the feature for the esmerald ecosystem that allows you to create plugins and extensions for any application as well as distribute them as installable packages.
-
New add_child_ravyn allowing adding via function, ChildEsmerald #61.
Add child esmeralds via functions once the application is created and dynamically.
0.14.0¶
Added¶
- Brand new support for Saffier. A brand new ORM running on the top of SQLAlchemy in an async fashion.
- New
base_userandmiddlewaresupport for Saffier with Esmerald. - New docs regarding the Saffier integration. Those include also an example how to use it.
Changed¶
- Breaking change - Removed support for python 3.7. This was blocking the technology from evolving at a normal pace and blocking security patches from being properly applied.
Fixed¶
- Old package versioning conflicts.
0.13.0¶
Changed¶
- Added support for Starlette 0.25.0
Fixed¶
- Internal mapping types #45
0.12.0¶
Changed¶
- Added support for Starlette 0.24.0.
Fixed¶
debugparameter regression.
0.11.2¶
Changed¶
- Code clean for responses and encoders.
- JWTConfig leeway parameter to accept int and str.
Fixed¶
ujsondumps parameter error.
0.11.1¶
Changed¶
- Improved
OrJSON,UJSON,ORJSONResponseandUJSONResponsewhen importing dependency.
0.11.0¶
Added¶
To make esmerald more optional and feature modular, this release brings some backwards incompatibilities that should be addressed when moving to this version. Check out the dcumentation for more details if this release notes doesn't cover it all.
Changed¶
- Moved
UJSON,UJSONResponse,OrJSONandORJSONResponseto be optional dependencies #45. - Changed the imports for
ORJSONResponsetofrom esmerald.responses.encoders import ORJSONResponse#45. - Changed the imports for
UJSONResponsetofrom esmerald.responses.encoders import UJSONResponse#45. - Changed the imports for
OrJSONtofrom esmerald.datastructures.encoders import OrJSON#45. - Changed the imports for
UJSONtofrom esmerald.datastructures.encoders import UJSON#45. - Moved the scheduler to optional installation with
pip install esmerald[schedulers]#45.
Backwards compatibility¶
This is only applied for those who have esmerald prior to 0.11.0.
If you already had template configurations, jwt, schedulers or all the features you need to update the imports to:
-
TemplateConfig:
from esmerald.core.config.template import TemplateConfig -
JWTConfig:
from esmerald.core.config.jwt import JWTConfig - Scheduler class is now imported directly from
asyncz:from asyncz.schedulers import AsyncIOScheduler # for the Scheduler class from asyncz.contrib.esmerald.decorator import scheduler # for the decorator
0.10.0¶
Added¶
Changed¶
Templatenow accepts an extraalternative_templatefor the cases of raising TemplateNotFound #44.- Removed
handle_status_codeinternal functionality as it is no longer used.
Fixed¶
handlertype for Gateway and WebsocketGateway.- The split bytes intead of b''.
0.9.0¶
Added¶
DirectInjectsobject for the direct dependency injection without using Inject anddependenciesfrom the handler #42.
Fixed¶
include_in_schemaon a Gateway level for OpenAPI specification #42.redirect_slasheswhen instantiating an Esmerald/ChildEsmerald application wasn't validating the value properly.- TemplateNotFound raised when a template is not found #42.
- jinja2 Environment to have autoescape by default #43
0.8.1¶
Added¶
- Added Template and Redirect to app imports. This was supposed to go in the release 0.8.0 but somehow it was missed.
0.8.0¶
January 22, 2023
Added¶
- New
FileandFormparams to Esmerald. - Add new
Injectsas parameter function. - Add new
ArbitraryHashableBaseModelto handle theInjectwith arbitrary types. - Add new settings_config parameter. #40.
Changed¶
- Removed unused internal parameters for old functions.
scheduler_classis now a property in the EsmeraldSettings. This allows to override fields without issues.- Deprecate
settingsparameter fromRequestSettingsMiddleware.
Fixed¶
- Error messages being thrown.
- Fix
enable_openapiboolean for ChildEsmerald and submodules andinclude_in_schemafor Include #37 - Fix types for OpenAPI for applications that are subclasses of Esmerald or ChildEsmerald #38
0.7.0¶
Added¶
- New RequestSettingsMiddleware allowing accessing the settings of the application from the request.
- Settings resolution for the whole application #30.
Changed¶
- Request now has a
settingsproperty that can be accessed upon the installation of the RequestSettingsMiddleware.
Fixed¶
licensereference upon instantiation from the settings.
0.6.2¶
Changed¶
- Add support for kwargs in the Dao and AsyncDAO #28
Fixed¶
- Mypy references for the Gateway and WebsocketGateway being added to the handler.
- References to the Esmerald types causing the IDE to misread them.
0.6.1¶
Changed¶
- Include now supports its own middleware handling and loading #26. This hange make sure that the parent level doesn't get affected and do not influence the middleware of other includes.
- JWTConfig
api_key_headernow defaults toAuthorization.
Fixed¶
- JWT Token encoding and decoding #26.
- JWT middleware handling the headers
0.6.0¶
Added¶
- Added support to the new Interceptors. #25
Changed¶
- Added support to httpx 0.23.3
- Updated document references pointing to Interceptors.
Fixed¶
JWTAuthMiddlewarefromesmerald.contrib.auth.tortoise.middlewareraising exception on invalid token.- Fixed code references to the
Void.
0.5.4¶
Changed¶
- Updated version of asyncz to support 0.1.4.
- Fixed dependencies when installing Esmerald based on Asyncz requirements.
- Minor fixes.
0.5.3¶
Changed¶
- Added support to httpx 0.23.2
0.5.2¶
Changed¶
- Support for Asyncz 0.1.3
0.5.1¶
Changed¶
- Add support for Asyncz 0.1.2
0.5.0¶
Warning
This changes might contain some backward incompatibilities if you are already using the previous scheduler.
Changed¶
- Deprecated the integration with
APSchedulerin favour of Asyncz. #15 - Upgraded the Esmerald official symbol.
Warning
If you are using the @scheduler with the func and identifier params, please check the
documentation to understand how to upgrade to the new scheduler.
It is almost the same but with some minor changes to the parameters
0.4.2¶
Changed¶
- Created
BaseModelExtraparser removing repetition of code across transformers.
Fix¶
- Configurations for scheduler being passed as params.
- Scheduler in the slots.
0.4.1¶
Changed¶
- Added support for Starlette 0.23.1.
0.4.0¶
Changed¶
- Updated support to Starlette 0.23.0
- Updated the RavynTestClient to support headers.
Fixed¶
- Token parameters being passed to
python-jose. - Update internal references to the JWT.
0.3.1¶
Added¶
- HashableBaseModel allowing the hash to be done via pydantic BaseModels.
Changed¶
- Update transformer model field and functions.
Fixed¶
- Minor doc fixes.
0.3.0¶
Changed¶
- Deprecated kwargs and signature to give place to Esmerald transformers.
- Code cleaning and improved performance by applying pure pydantic models internally.
0.2.11¶
Fixed¶
- When instantiating an
Esmeraldobject,app_nameshould be passed instead ofname.
0.2.10¶
Changed¶
- Supporting Starlette version 0.22.0.
Fixed¶
max_agefrom SessionConfig allowing negative numbers being passed and can be used for testing purposes or to clear a session.
0.2.9¶
Fixed¶
redirect_slashesproperty added to the main Esmerald object and settings options.
0.2.8¶
Fixed¶
@routerallowing validation for Options for CORS middleware.
0.2.7¶
Added¶
- Officially supporting python 3.11.
0.2.6¶
Changed¶
- Removed Tortoise ORM dependency from the main package.
- Removed
asyncpgfrom the main package as dependency.
0.2.5¶
Changed¶
- Removed
auth.pyfrom security package as is no longer used. This was supposed to go in the release 0.2.4.
0.2.4¶
Changed¶
- Removed
settings.pyfrom permissions as it is no longer used.
0.2.3¶
Fixed¶
- OpenAPI documentation rendering for the same path with different http methods.
0.2.2¶
Added¶
httpxanditsdangerousdependencies.
0.2.1¶
Changed¶
- Removed
archive. - Removed unnecessary comments.
Fixed¶
- Generation of projects and apps using
esmeraldby removing the clutter.
0.2.0¶
Added¶
esmeraldentrypoint allowing generating projects and apps via directives.
Fixed¶
- Namespace conflicts when importing the
Includeand theincludeinternal function.
0.1.3¶
Changed¶
add_route- Fixed the way the add_route was managing the paths and import to OpenAPI docs.
0.1.2¶
Changed¶
add_routes- Fixed the way the add_route was managing the paths and import to OpenAPI docs.
0.1.1¶
Changed¶
pyproject.toml- Added missing dependencies.
0.1.0¶
This release is the first release of Esmerald and it contain all the essentials to start a project from the simplest version to the most advanced.
Added¶
- Fluid and Fast: Thanks to Starlette and Pydantic.
- Fast to develop: Thanks to the simplicity of design, the development times can be reduced exponentially.
- Intuitive: If you are used to the other frameworks, Esmerald is a no brainer to develop.
- Easy: Developed with design in mind and easy learning.
- Short: With the OOP available natively there is no need for code duplication. SOLID.
- Ready: Get your application up and running with production-ready code.
- OOP and Functional: Design APIs in any desired way. OOP or Functional is available.
- Async and Sync: Do you prefer sync or async? You can have both.
- Middleware: Apply middlewares on the application level or API level.
- Exception Handlers: Apply exception handlers on any desired level.
- Permissions: Apply specific rules and permissions on each API.
- DAO and AsyncDAO: Avoid database calls directly from the APIs. Use business objects instead.
- Tortoise ORM: Native support for Tortoise ORM.
- APIView: Class Based endpoints for your beloved OOP design.
- JSON serialization/deserialization: Both UJSON and ORJON support.
- Lifespan: Support for the newly lifespan and on_start/on_shutdown events.
- Dependency Injection: Like any other great framework out there.
- Scheduler: Yes, that's right, it comes with a scheduler for those automated tasks.
- Simplicity from settings: Yes, we have a way to make the code even cleaner by introducing settings based systems.