Skip to main content

A base class for TiddlyWeb to simplify the development of serializers in particular those which exchange bags, recipes and tiddlers as representations in a _generic_ format, such as JSON, XML, YAML, etc.

The simplerizer pacakge uses the dump and load objects to implement all of the known core methods for exchanging representations with TiddlyWeb resources. This contrasts with the core TiddlyWeb SerializionInterface which throws “NotImplemented” exceptions for methods not explicity defined. Both approaches may have merit, hence this being offered as a plugin.

The following simplerizer based plugin is a replacement for the core json serializer:

from simplejson import dumps, loads from tiddlywebplugins.simplerizer import Simplerization as SerializationInterface

def init(config):

# register the serializer content_type = “text/json” config[“extension_types”][“json”] = content_type config[“serializers”][content_type] = [__name__, “text/json; charset=UTF-8”]

class Serialization(SerializationInterface):

“””Access TiddlyWeb resources using the JSON representation.”””

def dump(self, object):

“””Dump a dictionary object to a JSON string.””” return simplejson.dumps(object)

def load(self, input_string):

“””Load a dictionary object from a JSON string.””” return simplejson.loads(input_string)

To use this code install the package and add ‘tiddlywebplugins.simplerizer’ to install_requires section of setup.py for your serializer package:

install_requires = [‘setuptools’, ‘simplejson’, ‘tiddlyweb.simplerizer’, ‘tiddlyweb’],

Created by Paul Downey, <psd@osmosoft.com>. http://blog.whatfettle.com

This package is licensed under the same terms as TiddlyWeb itself.

Metadata

Release files for tiddlywebplugins.simplerizer 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tiddlywebplugins.simplerizer 0.1
File Size Uploaded
tiddlywebplugins.simplerizer-0.1.tar.gz 4.1 kB Details

Release files / tiddlywebplugins.simplerizer-0.1.tar.gz

Download URL tiddlywebplugins.simplerizer-0.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9b87dcb8959db93e064039dcc7b1cbb3d1fdd7e32c0c0d64fd82cc3f30616d22
BLAKE2b-256 checksum
How to use checksums
ddb339b75603bf889a223410f78d656e4c54d80097cd0a3100b817abb1681178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page