Giter Club home page Giter Club logo

dataclips-cli's Introduction

dataclips-cli

A tool for managing Heroku Dataclips programmatically.

Background

Dataclips are a great tool for BI and data analysis tasks on top of Heroku Postgres, but are limited by their web-only interface. With dataclips-cli you can easily manage these queries as flat files instead, enabling dataclips updates as part of a CI workflow, tracking revision history, etc.

Getting Started

Requires deno and the Heroku CLI;

First, create a dataclip via the web interface. It will have a URL similar to https://data.heroku.com/dataclips/vgntjcbwfakfsxhdmrmzmliwftts.

vgntjcbwfakfsxhdmrmzmliwftts is the "slug" of the dataclip.

Queries should be stored as flat .sql files, with a little metadata at the beginning. Here's an example.

$ cat example.sql
-- clip_slug: vgntjcbwfakfsxhdmrmzmliwftts
-- title: A Test Dataclip

select count(*) from pg_user;

Usage

# Update some query files
$ deno run --allow-read --allow-env --allow-net https://deno.land/x/dataclips_cli/index.ts file.sql file2.sql

Authentication

dataclips-cli reads your Heroku API key from ~/.netrc (where the Heroku CLI writes it), or uses the environment variable HEROKU_API_KEY if available, e.g:

$ HEROKU_API_KEY=mykey deno run ... etc

CLI Development / Release Process

Uses version for version management

$ deno run -A https://deno.land/x/version/index.ts patch
$ git push --follow-tags

โ€” will be automatically deployed to https://deno.land/x/dataclips_cli

Disclaimers

This tool was created by emulating Heroku's browser APIs. It's not officially supported or endorsed by Heroku, and may break at any time. Community participation in keeping it running is strongly encouraged.

License

MIT

dataclips-cli's People

Contributors

dylanpyle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.