Documentation
Plugins
Sources
Homebrew
Overview

Homebrew Source Plugin

Latest: v3.0.12

The Homebrew Source plugin for CloudQuery extracts configuration from the Homebrew Analytics API (opens in a new tab) and loads it into any supported CloudQuery destination (e.g. PostgreSQL, BigQuery, Snowflake, and more).

The Homebrew Analytics API exposes data for the top 10,000 Homebrew formula installs, aggregated over 30-day, 90-day, and 365-day periods. The plugin can fetch data for any of these periods. When synced on a regular basis, the plugin can be used to track the popularity of Homebrew formulae over time.

Configuration

The following configuration syncs from Homebrew to a Postgres destination. The (top level) source spec section is described in the Source Spec Reference. The config for the postgresql destination is not shown here. See our Quickstart if you need help setting up the destination.

kind: source
spec:
  name: "homebrew"
  path: "cloudquery/homebrew"
  registry: cloudquery
  version: "v3.0.12"
  tables: ["*"]
  destinations:
    - "postgresql"
  backend_options:
    table_name: "cq_state_homebrew"
    connection: "@@plugins.postgresql.connection"
  spec:

Note that if backend_options is omitted, by default no backend will be used. This will result in all items being fetched on every sync.

For more information about managing state for incremental tables, see Managing Incremental Tables.

Homebrew Spec

This is the (nested) spec used by the Homebrew source plugin:

  • concurrency (integer) (optional) (default: 50000):

    The best effort maximum number of Go routines to use. Lower this number to reduce memory usage.

Example Queries

List the most popular Homebrew formulae by number of installs in the last 30 days

select number, formula, count, percent from homebrew_analytics_installs_30d order by number asc limit 10;
number  formula          count   percent
------  ---------------  ------  -------
1       openssl@1.1      991372  2.03
2       ca-certificates  946778  1.93
3       xz               903305  1.85
4       icu4c            764268  1.56
5       jpeg-turbo       742750  1.52
6       fontconfig       652903  1.33
7       sqlite           633506  1.29
8       pcre2            633417  1.29
9       glib             603405  1.23
10      libx11           600437  1.23