New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dune

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dune

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dune shellandbull

Welcome to the Ruby SDK of the Dune Analytics API

Installation

dune is available as a gem on Rubygems To install it, add it to your Gemfile

source "https://rubygems.org"

gem "dune"

Usage

To use the Dune API you'll need to request an API key. The Dune API is currently in private beta.

Official API Documentation

Setting up the client

The underlying HTTP client is Faraday

Here's the properties that can be provided to the constructor

propertyrequireddescription
api_keytruethe API key
faraday_settingsfalsea hash provided to Faraday.new
loggerfalsean instance of Logger, defaults to a null logger
require "dune"

dune = Dune::Client.new(api_key: ENV["DUNE_API_KEY"])
dune.connection #=> returns a Faraday::Connection
Available methods

All methods will return the parsed JSON response as a hash.

Should the request fail the call will fail with a Dune::Error that contains the faraday response as a property

dune = Dune::Client.new(api_key: ENV["DUNE_API_KEY"])

# execute a query
query_id          = 312527 # https://dune.com/queries/312527
query_response    = dune.query(query_id) # calls POST /query/312527/execute

# get status of a query
dune.execution_status(query_response["execution_id"]) # calls GET /execution/312527/status

# get the results of an execution
dune.execution(query_response["execution_id"]) # calls GET/execution/312527/results

# cancel an execution
dune.cancel(query_response["execution_id"]) # calls POST /execution/312527/cancel
Supplying parameters

Supplying parameters works by invoking the same query method. Make sure your query in Dune accepts parameters.

dex_by_volume_query_id = 312527
json = JSON.generate({ query_parameters: { grouping_parameter: 2 } })
dune.query(dex_by_volume_query_id, json)

FAQs

Package last updated on 11 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc