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

  • Run SQL queries against Datasette and return the results as JSON
  • 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 alias default latest
dclient alias default-db 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

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.5a1.tar.gz (10.5 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.5a1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dclient-0.5a1.tar.gz
Algorithm Hash digest
SHA256 8d4f9626652005167d36f074fc5ad5de79de57c409d6f3d38dfafcf4355c047c
MD5 b40cc32c3d95415ceca42f46d4257855
BLAKE2b-256 ec639052841fc4a0a1c4568aa85c6aab3388a5c6d8481420e4faa360a3a0acd3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: dclient-0.5a1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 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.5a1-py3-none-any.whl
Algorithm Hash digest
SHA256 69f004fc0935752c7b4582534c523a879c2143e6febedd28491732859e98753d
MD5 f6411560f103b1a17f54db789f646026
BLAKE2b-256 a331108b1b3c45e558ea1a7b16a3e2a3599f5ff88933643e447c63252b2eabbd

See more details on using hashes here.

Provenance

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