turbot/hypothesis
steampipe plugin install hypothesis

Hypothesis + Steampipe

Hypothesis is a web annnotation system.

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

List annotations on www.example.com, with at least one tag, by a user other than judell:

select
username,
tags
from
hypothesis_search
where
query = 'uri=https://www.example.com'
and jsonb_array_length(tags) > 0
and username !~ 'judell'
+----------+--------------------------------------------------------------+
| username | tags |
+----------+--------------------------------------------------------------+
| ryany25 | ["asdf;","asdfaasdf"] |
| ryany25 | ["T-cell acute lymphoblastic leukemia-associated antigen 1"] |
| robins80 | ["rikersierra1"] |
| robins80 | ["HypothesisTest","3219099"] |
| robins80 | ["HypothesisTest","3219099"] |
+----------+--------------------------------------------------------------+

Documentation

Get started

Install

Download and install the latest Hypothesis plugin:

steampipe plugin install hypothesis

Credentials

ItemDescription
CredentialsGet your API token from the Hypothesis service (you must be logged in to Hypothesis to view this page). The token is optional. Without it, you can still query the Hypothesis public layer.

Configuration

Installing the latest hypothesis plugin will create a config file (~/.steampipe/config/hypothesis.spc) with a single connection named hypothesis:

If you are a Hypothesis user wanting to query your own private notes, or notes in private groups you belong to, then uncomment #token and provide your API token.

connection "hypothesis" {
plugin = "hypothesis"
#token = "6879-35....3df5"
}

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- hypothesis

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_hypothesis;
CREATE SERVER steampipe_hypothesis FOREIGN DATA WRAPPER steampipe_postgres_hypothesis OPTIONS (config '<your_config>');
CREATE SCHEMA hypothesis;
IMPORT FOREIGN SCHEMA hypothesis FROM SERVER steampipe_hypothesis INTO hypothesis;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- hypothesis

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_hypothesis function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_hypothesis.so
sqlite> select steampipe_configure_hypothesis('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- hypothesis

You can pass the configuration to the command with the --config argument:

steampipe_export_hypothesis --config '<your_config>' <table_name>