Giter Club home page Giter Club logo

hg-bigquery-export's Introduction

HG-BigQuery-Export

Export your Honeygain balance to a BigQuery database!

Setting up

1. Creating the BigQuery database

Create a new GCP Project (if desired) and create a new database + table with the following schema:

img.png

2. Downloading access credentials

Create a new service account in GCP, give it permission to modify your BigQuery database, and download its service account key in JSON format. Drop it into the root of this project and save its name somewhere.

3. Configuring

Copy config.py.example to config.py and open it in a text editor.

Next, set the following variables:

  • HG_EMAIL: Email for your Honeygain account
  • HG_PASS: Password for your Honeygain account
  • GOOGLE_APP_CREDENTIALS: Path to your service account key, relative to the root of this project. Use the file from the previous step for this value.
  • TARGET_DB: Resource name of the database table you created in step 1.

Running

Run the following commands to install dependencies:

# Create venv
$ python3 -m virtualenv venv
$ source ./venv/bin/activate

# install deps
(venv) $ pip3 install -U -r requirements.txt

To run the program:

(venv) $ python3 export.py
Logging in with saved token
Retrieving account balance...
Inserting data into BigQuery...
Done!

(venv) $ deactivate

The program will store a single row in your database table, if you want it to monitor for extended periods of time, please use a solution such as cron to run it once every x minutes.

hg-bigquery-export's People

Contributors

imgbotapp avatar malmeloo avatar

Watchers

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