Giter Site home page Giter Site logo

coins's Introduction

coins

A script for querying your account balances from multiple cryptocurrency exchanges. It produces a data table that can be easily pasted into a spreadsheet application.

Usage:

python coins.py

Example output:

Screenshot of example output.

Configuration

Behavior can be configured via variables set in config.py. The options are below. All are optional, but the script will do nothing if EXCHANGES is not provided:

  • EXCHANGES: A list of modules implementing the exchange API (see below).
  • SYMBOL_TRANSFORM: Used to specify a mapping for correcting currency symbols.
  • CACHE_FILE: Where to store the cache. Defaults to balances.pickle.
  • TOTAL_COLUMN: The label for the column containing balance totals. Defaults to 'Subtotal'.
  • EXCLUDE_ZEROS: Whether to exclude zero balances. Defaults to True.
  • REQUIRED_ROWS: A list of currency symbols to always include.

Caching

By default, results are cached, in order to avoid unnecessary querying. An argument should be provided if you wish to override the cache, for example:

python coins.py polo,trex  # Ignore the cache for specific exchanges.
python coins.py all        # Ignore the cache entirely.

Exchange modules and API

The code for querying each exchange is separated into separate Python modules. Code is provided for querying several popular exchanges. You can provide your own modules if you want to query other exchanges.

The modules should contain the minimum code required to do the job. Each must provide the following API:

  • NAME: A string representing the full exchange name.
  • get_balances(): A function which will query and return account balances as a dictionary from currency (e.g. 'BTC', 'ETH') to an amount, as a float. Zero balances are not expected to be filtered out by this function.

Authentication

As a convention, API credentials are stored in config.py under the variables {SHORT_NAME}_KEY and {SHORT_NAME}_SECRET for each exchange.

It is recommended that you give the API keys the minimum permissions required to query account balances.

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.