Counting SQLite virtual machine operations
When SQLite executes a query, it does so by executing a sequence of virtual machine operations. There are mechanisms for cancelling a query after a specific number of these operations, to protect…
105 posts tagged “python”.
When SQLite executes a query, it does so by executing a sequence of virtual machine operations. There are mechanisms for cancelling a query after a specific number of these operations, to protect…
I was working with a database table that included values that were clearly in the wrong character encoding - values like this: Rue Léopold I I used my sqlite-transform tool with the ftfy Python…
For simonw/til issue 82 I needed to embed some binary content directly in a Python script. I wanted to wrap that content to fit within 80 columns.
I wanted to add a option to which could be used to change the file encoding used to read the incoming CSV or TSV file - see sqlite-utils 182.
Twitter announced today that they'll be ending free API access for bots. My @covidsewage Twitter bot posts a screenshot of the latest Covid sewage data for parts of the San Francisco Bay Area every…
in Python is a form of co-operative multitasking, where everything runs in a single thread but asynchronous tasks can yield to other tasks to allow them to execute.
I was experimenting with wasmtime-py today and found the current documentation didn't quite give me the information that I needed.
TikTok may or may not be banned in the USA within the next 24 hours or so. Here's a pattern you can use to download all of the videos from a specific account.
I needed to tell both and to ignore the same line of code. This worked: The order here mattered. This did not get picked up by both tools: noqa: F401 type: ignore But this did: type: ignore noqa: F401
I needed this for the and commands, see issue 925. My initial attempt at this resulted in weird testing errors ( 928) - while investigating them I stumbled across this comment in the source code: So I…
I noticed that a lot of my boto3 code in s3-credentials looked like this: This was enough verbosity that I was hesitating on implementing pagination properly for some method calls.
For photos-to-sqlite I needed to install as a dependency, but only if the platform is macOS - it's not available for Linux. Here's the magic incantation to do that: So in the install requires line.
Today I was evaluating if the Python cryptography package was a sensible depedency for one of my projects.
Update: Code Interpreter often claims that it can't run binaries uploaded like this, but it looks like it still works if you are are persistent enough with it.
I got my asgi-csrf Python package up to 100% code coverage. Here's the pull request. I started by installing and using the pytest-cov pytest plugin.
I ended up deploying a Datasette instance to Fly.io using my llm-clip and datasette-llm-embed plugins.
I figured out how to run a subprocess with a time limit for datasette-ripgrep, using the method. The pattern looks like this: For datasette-seaborn I wanted to render a chart using the Python seaborn…
For sqlite-utils issue 309 I had an error that looked like this: And I wanted to display the values of the and variables as part of a custom error message.
I fixed two bugs in Datasette using - a tool which lets you run an automated binary search against a commit log to find the source of a bug.
For sqlite-utils issue 464 I implemented a fix to a tiny bug in a dependency in my own fork on GitHub.