Skip to main content

A client CLI utility for Datasette instances

Project description

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

  • Browse table data with filtering, sorting, and pagination — no SQL required
  • Run SQL queries against Datasette and return the results as JSON, CSV, TSV, or an ASCII table
  • Introspect databases, tables, plugins, and schema
  • Run queries against authenticated Datasette instances
  • Create aliases and set default instances/databases for convenient access
  • Insert and upsert data using the write 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

Quick start

Add an alias for a Datasette instance:

dclient alias add latest https://latest.datasette.io
dclient default instance latest
dclient default database latest fixtures

Now run queries directly:

dclient "select * from facetable limit 1"

Or be explicit:

dclient query fixtures "select * from facetable limit 1" -i latest

Output as a table with -t, or use --csv, --tsv, --nl:

dclient "select pk, state from facetable limit 3" -t

Browse table rows without SQL:

dclient rows facetable -f state eq CA --sort _city_id -t

Introspection

dclient databases
dclient tables
dclient plugins
dclient schema facetable

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dclient-0.5a3.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dclient-0.5a3-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file dclient-0.5a3.tar.gz.

File metadata

  • Download URL: dclient-0.5a3.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dclient-0.5a3.tar.gz
Algorithm Hash digest
SHA256 293ebb95cdaba979bb12c71af370ce4b2bd1aeecb148eb86fa33b0a9e0fdeb24
MD5 87e2b8afbd64c7ce4cfab6bf8ff990ae
BLAKE2b-256 a2dbc22fc07f317a74a1a632827e115900db09891dde99d2ea5c80e0beefac04

See more details on using hashes here.

Provenance

The following attestation bundles were made for dclient-0.5a3.tar.gz:

Publisher: publish.yml on simonw/dclient

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dclient-0.5a3-py3-none-any.whl.

File metadata

  • Download URL: dclient-0.5a3-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dclient-0.5a3-py3-none-any.whl
Algorithm Hash digest
SHA256 46b557e37bdb67e4e2cfa0444005685ed0dd01d0f2965facf80545a70bc41997
MD5 168ea35c1bd86cddc3385023574c19b5
BLAKE2b-256 6356e116f8d4022668725fabb6d13d24115fbad9caefb0c4ec970583bb645760

See more details on using hashes here.

Provenance

The following attestation bundles were made for dclient-0.5a3-py3-none-any.whl:

Publisher: publish.yml on simonw/dclient

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page