A client CLI utility for Datasette instances
  • Python 99.7%
  • Just 0.3%
Find a file
Simon Willison 92c0d2a5ba Tests and docs for v2 introspection commands and alias features
Add test_commands_v2.py with 28 tests covering databases, tables,
plugins, schema, default_query, upsert, auth status, actor, and
get commands.

Add test_alias_v2.py with 5 tests for alias default, alias default-db,
and removing the default alias.

Update aliases.md and authentication.md docs for v2 API.

refs #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:21:58 -08:00
.github/workflows setup.py to pyproject.toml plus upgraded actions 2026-02-23 16:50:33 -08:00
dclient v2 config system, CLI rewrite, and updated core commands 2026-02-24 15:21:52 -08:00
docs Tests and docs for v2 introspection commands and alias features 2026-02-24 15:21:58 -08:00
specs Spec for v2, refs #29 2026-02-24 14:57:54 -08:00
tests Tests and docs for v2 introspection commands and alias features 2026-02-24 15:21:58 -08:00
.gitignore setup.py to pyproject.toml plus upgraded actions 2026-02-23 16:50:33 -08:00
.readthedocs.yaml Create .readthedocs.yaml 2024-02-24 17:44:06 -08:00
Justfile Documentation on ReadTheDocs using MyST 2023-07-17 16:48:50 -07:00
LICENSE Initial library structure 2022-11-22 01:57:06 +00:00
pyproject.toml v2 config system, CLI rewrite, and updated core commands 2026-02-24 15:21:52 -08:00
README.md Demonstrate aliases directly in the README 2023-07-24 21:33:46 -07:00

dclient

PyPI Changelog Tests License

A client CLI utility for Datasette instances.

Much of the functionality requires Datasette 1.0a2 or higher.

Things you can do with dclient

  • Run SQL queries against Datasette and returning the results as JSON
  • Run queries against authenticated Datasette instances
  • Create aliases and store authentication tokens for convenient access to Datasette
  • Insert data into Datasette using the insert API (Datasette 1.0 alpha or higher)

Installation

Install this tool using pip:

pip install dclient

If you want to install it in the same virtual environment as Datasette (to use it as a plugin) you can instead run:

datasette install dclient

Running a query

dclient query https://latest.datasette.io/fixtures "select * from facetable limit 1"

To shorten that, create an alias:

dclient alias add fixtures https://latest.datasette.io/fixtures

Then run it like this instead:

dclient query fixtures "select * from facetable limit 1"

Documentation

Visit dclient.datasette.io for full documentation on using this tool.

Development

To contribute to this tool, first checkout the code. Then create a new virtual environment:

cd dclient
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest