Convert from JSON in restricted python

Is there a way to convert JSON to a dict / list (or something I can use in a tal:template) in restricted python ?

I have this (unicode object) string:

{'fragment': u'richtext_list', 
"[{u'data': u'<p>ABC</p>', u'encoding': u'utf-8'}, {u'content-type': u'text/html', u'output-content-type': u'text/x-html-safe', 
u'data': u'<p>QQQ</p>', u'encoding': u'utf-8'}]"}

Which I want to show as





You could register a view and "loads" the JSON in this view.

Write a browser view or add a related method to your existing browser view.


The (mosaic) fragment views are running with restricted python, as far as I know.

I was hoping to add a 'tuple' or 'list' richtext tile to make this:

As @zopyx has suggested, the browser view may be the way.
There's a pattern explained here:
Unless I'm misunderstanding how it works, it looks like you would have to register a browser view which could then be called from restricted python.

Browser view is an ugly way.

Please add it to

It is simple to add and helps everyone using restrictedpython in the future. Once added then you can use the normal import which is more intuitive and what a first time user is likely to try.

Still, I have no clue about what to 'actually do'
It looks to me that something needs to be changed in:

How many working solutions do you need? Why do you need look into a 3rd or 4th option?


that is for @djay 's answer.

I know how to do it with a browser view, but I try to avoid it since this is in a theme.
Why? … because the whole point of the theme is to make it possible for everybody to 'use whatever they find there in their own theme', without having to install add-ons etc.

I dont 'need' anything: I am just trying to make something for the community to help with the lack of themes etc. in Plone 5.

@espenmn I've updated the readme with more detail on how to whitelist something. Let me know if I can improve it.

Great, thanks.