Skip to content


Esmerald comes equipped with some datastructures. If you want to use the same as Lilya, feel free as they are compatible and work out of the box.

How to access them

As an example, let's import Headers.

from esmerald.datastructures import Headers

The available datastructures to be imported from Esmerald are as follow.

  • Lilya:
    • URL
    • Address
    • FormData
    • Headers
    • MutableHeaders
    • QueryParam
    • UploadFile
    • URLPath
  • Esmerald:
    • Secret
    • State
    • Cookie - Better import with as ResponseCookies. Check cookies and see how to use them.
    • ResponseHeaders - Check headers and see how to use them.
    • File
    • Redirect
    • Stream
    • Template

All the datastructures can be and are used across the codebase and can be applied by you anywhere.


As mentioned before, all the Lilya datastructures are 100% compatible with Esmerald. You can use whatever it suits you.