Closed simonw closed 10 months ago
shot-scraper
: given a URL, goes and runs shot-scraper javascript
against that URL and executes JavaScript and returns the result - https://shot-scraper.datasette.io/en/stable/javascript.htmlshot-scraper
)Datasette should ship with some default enrichments that don't require any extra plugins.
Some ideas for those
2023-02-05T00:14:24+00:00
json_extract()
function and a path to extract some data from a JSON column into a separate columnThe "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!
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
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/
I'm going to build these:
re2
for safety) - https://github.com/datasette/datasette-enrichments-re2
To inform:
1