Generated a summary of nested JSON data
I was trying to figure out the shape of the JSON object from https://github.com/simonw/coronavirus-data-gov-archive/blob/master/data latest.json?raw=true - which is 3.2MB and heavily nested, so it's…
105 posts tagged “python”.
I was trying to figure out the shape of the JSON object from https://github.com/simonw/coronavirus-data-gov-archive/blob/master/data latest.json?raw=true - which is 3.2MB and heavily nested, so it's…
Once you have installed the "command line tools" for Catalina using the following terminal command: xcode-select –install will run Python 3.7.3: % which python3 /usr/bin/python3 % python3 Python 3.7.3…
Xeophon suggested that E5-large-v2 as an embedding model that was worth a closer look. It's an interesting model. It's trained to match queries against passages of text.
I wrote this test to exercise some httpx code today, using pytest-mock. The key was to use which patches the module that was imported by the module.
My csvs-to-sqlite README includes a section that shows the output of the command (relevant issue). I had been manually copying this in, but I decided to try using cog to automate the process.
This tip is for when you are working on a Python command-line application that runs using that program's name, as opposed to typing .
datasette-leaflet-geojson outputs GeoJSON geometries in HTML pages in a way that can be picked up by JavaScript and used to plot a Leaflet map.
Rhet Turnbull shared this short script for looking up the named timezone for a given location from Python on macOS using and the framework. It uses the package and pyobjc-framework-CoreLocation.
I wanted my datasette-plugin cookiecutter template to create empty and directories if the user replied to the and prompts.
If you ever run into instructions that tell you to do this: Do not try to do this . It is a trap. For some reason attempting to install this runs a compilation process which can take multiple hours .
While parsing a CSV file using today I noticed the following surprising result: This output the following: I had expected to preserve the order of keys from the CSV file, since Python has defaulted to…
First, checkout the cpython repo: $ git clone git@github.com:python/cpython cd into the directory: $ cd cpython/Doc To get a virtual environment with Sphinx and other required tools, run like this: $…
For https://github.com/simonw/datasette/issues/581 I want to be able to inspect a Python function to determine which named parameters it accepts and send only those arguments.
I wanted to use a fixture with that was itsef as function, so that it could execute statements. Since I'm using a file containing I had to use the fixture to get this to work.
I decided to have a poke around and see if I could figure out how the HTTP streaming APIs from the various hosted LLM providers actually worked. Here are my notes so far.
I spotted a neat looking project links section on https://pypi.org/project/ExifReader/ Turns out that's added using a key in setup.py, e.g.
I wanted to convert a datetime object (from GitPython) to UTC without adding the dependency.
:warning: The OOB flow described in this document has been scheduled for deprecation by Google. See issue 39 for notes on how to replace it.
I built a new API reference page today for , using the Sphinx autodoc extension to extract docstrings from the code and use them to build a full class reference.
I helped build the tide chart visualizations for Rocky Beaches. I wanted to generate an SVG line representing 24 hours of tide levels.