GithubHelp home page GithubHelp logo

isabella232 / modejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapbox/modejs

0.0 0.0 0.0 4 KB

node module and cli for interacting with the mode analytics api

License: ISC License

JavaScript 100.00%

modejs's Introduction

In many cases it makes more sense to query the database directly, for data in Athena, you can use the node module https://github.com/mapbox/athena to help with polling for results, or the Athena REST API directly.


modejs is a library and cli for interacting with the modeanalytics.com api. Its not really documented, and might break. But this make it easier fetch data from mode and run more analysis locally.

  1. Get a token from https://modeanalytics.com/settings/access_tokens
  2. username is your mode username
  3. org is the mode org to use (defaults to username)
  4. token is the "password" that you get when creating a token on the access_tokens page... yeah its confusing.

Use as a library

// MODEJS_USERNAME  and MODEJS_TOKEN
var mode = require('modejs')({
    username: '',
    token: '',
    org: '' //optional
});


mode.reports(function(err, reports) {

  // list of reports

});

mode.report({id: '1oisdflsdf'}, function(err, report) {

  // details about a report

});

// gets data from the most recent run of the report
mode.reportData({reportId: '1oisdflsdf', org: 'myorg'}, function(err, data) {

    // data = JS array with an object per row.
});


// lists past runs of a report
mode.reportRuns({reportId: '1oisdflsdf'}, function(err, runs) {
    // list of runs of this report.
});

Use as a cli

npm install modejs -g

modejs data <org>/<reportid> // gets last report run. org is optional

modejs runs <org>/<reportid> // lists runs of a report org is optional

modejs's People

Contributors

mick avatar tmcw 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.