wxyz.core#

Isomorphic JSON widgets

class wxyz.core.Fn(**kwargs: Any)[source]#

Bases: Base

Turns a source into a value

This is a foundational class with a number of implementations throughout wxyz.

The simplest Fn subclass might implement the identity function:

class Identity(Fn):
    def the_function(self, source):
        return source
mode#

whether to execute transformations on the client and/or the kernel

source: any#

the source

the_observer(*_)[source]#

Base observer that updates value and/or error

value: any#

the value produced by evaluating the function

class wxyz.core.JSON(**kwargs: Any)[source]#

Bases: Fn

A JSON parsing functional widget

mode#

whether to execute transformations on the client and/or the kernel

source: any#

the source

the_function(source)[source]#

parse some JSON

the_observer(*_)#

Base observer that updates value and/or error

value: any#

the value produced by evaluating the function

class wxyz.core.JSONPointer(**kwargs: Any)[source]#

Bases: Fn

A JSON pointer resolver

mode#

whether to execute transformations on the client and/or the kernel

source: any#

the source

the_function(source, pointer)[source]#

point at some json

the_observer(*_)#

Base observer that updates value and/or error

value: any#

the value produced by evaluating the function

class wxyz.core.JSONSchema(**kwargs: Any)[source]#

Bases: Fn

A JSON schema validator

mode#

whether to execute transformations on the client and/or the kernel

source: any#

the source

the_function(source, schema)[source]#

validate some JSON

the_observer(*_)#

Base observer that updates value and/or error

value: any#

the value produced by evaluating the function

class wxyz.core.UnJSON(**kwargs: Any)[source]#

Bases: Fn

A JSON dumping functional widget

mode#

whether to execute transformations on the client and/or the kernel

source: any#

the source

the_function(source, indent)[source]#

dump some JSON

the_observer(*_)#

Base observer that updates value and/or error

value: any#

the value produced by evaluating the function