datasette / datasette-enrichments

Tools for running enrichments against data stored in Datasette
https://enrichments.datasette.io
Apache License 2.0
20 stars 0 forks source link

Examples of enrichments to help guide the design #6

Closed simonw closed 10 months ago

simonw commented 1 year ago

To inform:

simonw commented 1 year ago
simonw commented 1 year ago
simonw commented 1 year ago
simonw commented 1 year ago

Datasette should ship with some default enrichments that don't require any extra plugins.

Some ideas for those

simonw commented 1 year ago

The "date from timestamp" one is interesting because it might not even involve writing to a new column - it would work more like https://sqlite-utils.datasette.io/en/stable/cli.html#converting-data-in-columns in that it would convert the data and save the updated value back to the same column. Still an enrichment!

simonw commented 1 year ago

I'd love to be able to offer an enrichment plugin that lets you safely execute arbitrary JSON or Python code to manipulate values. I think server-side WebAssembly is the way to do that. https://til.simonwillison.net/webassembly/python-in-a-wasm-sandbox

simonw commented 1 year ago
simonw commented 1 year ago

Jinja2 has a "safe sandboxing" option which I'd be willing to trust for authenticated users at least - protects them from making dumb mistakes, and it looks like the most harm it can cause is running out of memory: https://jinja.palletsprojects.com/en/3.1.x/sandbox/

simonw commented 1 year ago

I'm going to build these: