Thanks to visit codestin.com
Credit goes to simonwillison.net

Simon Willison’s Weblog

Subscribe

May 2020

60 posts: 4 entries, 19 links, 5 quotes, 32 beats

May 1, 2020

Release sqlite-utils 2.7.1 — Python CLI utility and library for manipulating SQLite databases

May 2, 2020

TIL Constant-time comparison of strings in Node — When comparing secrets, passwords etc it's important to use a constant-time compare function to avoid timing attacks.
Release datasette-render-markdown 1.1.2 — Datasette plugin for rendering Markdown
Release sqlite-utils 2.7.2 — Python CLI utility and library for manipulating SQLite databases
Release github-to-sqlite 2.2 — Save data from GitHub to a SQLite database

github-to-sqlite 2.2 highlights thread. I released github-to-sqlite 2.2 today with a new “stargazers” command for importing users who have starred one or more specific repositories. This Twitter thread lists highlights of recent releases and links to a live Datasette demo that shows what the tool can do.

# 10:16 pm / github, projects, datasette, dogsheep

May 3, 2020

Release sqlite-utils 2.8 — Python CLI utility and library for manipulating SQLite databases

May 4, 2020

TIL Installing and upgrading Datasette plugins with pipx — If you installed `datasette` using `pipx install datasette` you can install additional plugins with `pipx inject` like so:

How to install and upgrade Datasette using pipx (via) I’ve been using pipx to run Datasette for a while now—it’s a neat Python packaging tool which installs a Python CLI command with all of its dependencies in its own isolated virtual environment. Today, thanks to Twitter, I figured out how to install and upgrade plugins in the same environment—so I added a section to the Datasette installation documentation about it.

# 7:23 pm / pip, python, datasette

How to get Rich with Python (a terminal rendering library). Will McGugan introduces Rich, his new Python library for rendering content on the terminal. This is a very cool piece of software—out of the box it supports coloured text, emoji, tables, rendering Markdown, syntax highlighting code, rendering Python tracebacks, progress bars and more. “pip install rich” and then “python -m rich” to render a “test card” demo demonstrating the features of the library.

# 11:27 pm / cli, python, will-mcgugan, rich

May 5, 2020

A hands-on introduction to static code analysis. Useful tutorial on using the Python standard library tokenize and ast modules to find specific patterns in Python source code, using the visitor pattern.

# 12:15 am / compilers, python, static-analysis

TIL Search across all loaded resources in Firefox — You can search for a string in any resource loaded by a page (including across HTML, JavaScript and CSS) in the Debugger pane by hitting Command+Shift+F.
Release dogsheep-photos 0.3a — Upload your photos to S3 and import metadata about them into a SQLite database
TIL Use setup.py to install platform-specific dependencies — For [photos-to-sqlite](https://github.com/dogsheep/photos-to-sqlite) I needed to install `osxphotos` as a dependency, but only if the platform is macOS - it's not available for Linux.

May 6, 2020

TIL List all columns in a SQLite database — Here's a devious trick for listing ALL columns in a SQLite database, using a SQL query that generates another SQL query.
Release datasette 0.41 — An open source multi-tool for exploring and publishing data

May 7, 2020

Release datasette-publish-vercel 0.5.1 — Datasette plugin for publishing data using Vercel

Weeknotes: Datasette 0.41, photos breakthroughs

Visit Weeknotes: Datasette 0.41, photos breakthroughs

Shorter weeknotes this week, because my main project for the week warrants a detailed write-up on its own (coming soon... update 21st May here it is).

[... 867 words]

html-to-svg (via) ‪This is absolutely ingenious: 50 lines of JavaScript which uses Puppeteer to get headless Chrome to grab a PDF screenshot of a page, then shells out to Inkscape to convert the PDF to SVG. Wraps the whole thing up in a Docker container and ships it to Cloud Run as a web service you can call by passing it a URL.

# 6:01 am / chrome, svg, cloudrun, puppeteer

May 8, 2020

Release datasette-media 0.1a — Datasette plugin for serving media based on a SQL query

Datasette table diagram, now with a DOT graph (via) Thomas Ballinger shared a huge improvement to my Observable notebook for rendering a diagram of a collection of Datasette tables. He showed how to use the DOT language to render a full schema digram with arrows joining together the different tables. I’ve applied his changes to my notebook.

# 3:23 am / visualization, datasette, observable

Release datasette 0.42 — An open source multi-tool for exploring and publishing data
Release datasette-media 0.1 — Datasette plugin for serving media based on a SQL query

May 9, 2020

TIL Converting HTML and rich-text to Markdown — If you copy and paste from a web page - including a full table - into a GitHub issue comment GitHub converts it to the corresponding Markdown for you. Really quick way to construct Markdown tables.

pyp: Easily run Python at the shell (via) Fascinating little CLI utility which uses some deeply clever AST introspection to enable little Python one-liners that act as replacements for all manner of pipe-oriented unix utilities. Took me a while to understand how it works from the README, but then I looked at the code and the entire thing is only 380 lines long. There’s also a useful --explain option which outputs the Python source code that it would execute for a given command.

# 9:05 pm / cli, python, shell

May 11, 2020

And for what? Again - there is a swath of use cases which would be hard without React and which aren’t complicated enough to push beyond React’s limits. But there are also a lot of problems for which I can’t see any concrete benefit to using React. Those are things like blogs, shopping-cart-websites, mostly-CRUD-and-forms-websites. For these things, all of the fancy optimizations are optimizations to get you closer to the performance you would’ve gotten if you just hadn’t used so much technology.

Tom MacWright

# 12:03 am / react, tom-macwright

Release sqlite-utils 2.9 — Python CLI utility and library for manipulating SQLite databases

Data Journalism Academy (via) MaryJo Webster is the data editor for the Star Tribune in Minneapolis, and a 2019 Pulitzer nominee. She’s has a huge amount of experience teaching data journalism and has just released her accumulated teaching materials in the form of the Data Journalism Academy.

# 4:45 am / data-journalism

TIL Adding project links to PyPI — I spotted a neat looking project links section on https://pypi.org/project/ExifReader/

2020 » May

MTWTFSS
    123
45678910
11121314151617
18192021222324
25262728293031