In
TiddlyWeb, a serializer is a class that implements the
SerializationInterface for the
serialization of
tiddler data.
Serialization formats are accessible as extensions to the respective URI.
By default,
TiddlyWeb provides the following formats:
TiddlyWebWiki provides:
Additional serializers can be added by using
plugins and adjusting
tiddlywebconfig.py.
The job of a serializer is twofold:
- Take an object representing a TiddlyWeb resource and turn it into a string of some form (e.g. JSON).
- Take a string of some form and use that string to fill in an object representing a TiddlyWeb resource.
In web requests a serializer is used to turn an object or collection of objects to a string when there is a
GET request and a string to an object when there is a
PUT request. The
GET asks the server for a
representation of a
resource. The
PUT request sends a representation to replace an existing resource. Note that replace is the correct word here, not update.
In the
text store that comes with
TiddlyWeb, the
text serializer is used when reading and writing some entities to and from disk.
A serializer should never be called directly by TiddlyWeb plugin code. Instead a serializer is produced by a factory class called
Serializer in
tiddlyweb/serializer.py.
See also: