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.5a2.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.5a2-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dclient-0.5a2.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.5a2.tar.gz
Algorithm Hash digest
SHA256 8cba4deb8ed0060821b38da9044a1f243c86f388a5479be8c130c5f3f2e90ff8
MD5 e4b81ede4a4ddc14796dbb1d1aedae2e
BLAKE2b-256 eec37dcc97c436f47f49258adeb69216316d34118ffee1c0b5780f7015a71817

See more details on using hashes here.

Provenance

The following attestation bundles were made for dclient-0.5a2.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.5a2-py3-none-any.whl.

File metadata

  • Download URL: dclient-0.5a2-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.5a2-py3-none-any.whl
Algorithm Hash digest
SHA256 82ef98673d27e547757b3e42f05660154a98dfde8db38b93aa75752736c76349
MD5 1af4c76fdfb59d8f8decafc903e60118
BLAKE2b-256 84129eac1e98c561742835669b04a3932fc410f562542adf07bc93936e595cf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dclient-0.5a2-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