New in version 3006.0.
Implements keyvalue serializer which can be used for serializing or deserializing any file which defines keys and values separated by a common set of characters, such environment files, which are in "KEY=value" format.
Options:
String representation of LF or CRLF to be used for serialization to a
file. Defaults to \r\n
on Windows and \n
on other operating
systems.
Boolean flag to determine if values should be quoted (True
) during
serialization or dequoted (False
) during deserialization. Defaults
to None
(no action).
String representing the character(s) used when concatenating or reading
key/value pairs. Defaults to =
.
A dataset such as:
foo: bar
wang: chung
or
- [foo, bar]
- [wang, chung]
can be represented as:
foo=bar
wang=chung
Raised when stream of string failed to be deserialized
Raised when stream of string failed to be serialized
Remove extra quotes around a string.
Deserialize any string or stream like object into a Python data structure.
stream_or_string -- stream or string to deserialize.
options -- options given to the function
Wraps a text around quotes.
{% set my_text = 'my_text' %}
{{ my_text | quote }}
will be rendered as:
'my_text'
Serialize Python data to environment file.
obj -- the data structure to serialize
options -- options given to the function