跳到正文
每分钟自动更新
11月18日周三
  1. Simon Willison

    Running the full server-side Datasette Python app in the browser with service workers and Pyodide

    中文摘要

    Datasette Lite是我将Datasette Python应用程序移植到浏览器中运行的版本,使用的是WebAssembly和Pyodide。我使用service workers发布了Datasette Lite的完整重写版本,现在它几乎与真正的服务器端应用程序无法区分。现在你可以使用精心设计的URL lite.datasette.io完成以下所有操作:加载客户端的Datasette来浏览任何SQLite数据库、JSON文件、CSV文件或SQL脚本;从PyPI中选择一个发布的Datasette版本进行加载;从Datasette GitHub仓库中选择特定的提交、标签或分支名称;从超过100个SQLite版本中进行选择,与Datasette一起使用;从PyPI或wheel文件的URL中安装额外的Datasette插件,包括JavaScript可视化工具。能够加载特定的Datasette引用、插件和SQLite版本,使这成为一种极好的工具,可以链接到正在进行中的功能演示或错误复现,而无需启动完整的Web服务器来提供该演示。例如,考虑以下URL:https://lite.datasette.io/?install=datasette-maplibre&url=https://gist.githubusercontent.com/simonw/39fa5d399465766039549912e2b3d291/raw/f6dfba9

    英文原文

    Datasette Lite is my port of the Datasette Python application to run directly in the browser using WebAssembly and Pyodide . I've released a complete rewrite of Datasette Lite using service workers, and it's now almost indistinguishable from the real server-side application. You can now do all of the following, using a carefully crafted URL to lite.datasette.io : Load client-side Datasette to browse any SQLite database, JSON file, CSV file or SQL script Select a released version of Datasette to load from PyPI Load a specific commit, tag, or branch name from the Datasette GitHub repository Pick from over 100 versions of SQLite to use with Datasette Install additional Datasette plugins from PyPI or URLs to wheel files, including JavaScript visualization tools The ability to load specific Datasette references, plugins, and SQLite versions makes this a fantastic tool for linking to demos of work-in-progress features or bug reproductions, without needing to spin up a full web server to serve that demo. As an example, consider the following URL: https://lite.datasette.io/?install=datasette-maplibre&url=https://gist.githubusercontent.com/simonw/39fa5d399465766039549912e2b3d291/raw/f6dfba9