Giter VIP home page Giter VIP logo

beancount-coinmarketcap's Introduction

Coinmarketcap price source for Beancount

If you use the beancount cli accounting tool (http://furius.ca/beancount/), this price source will let you fetch cryptocurrency prices from coinmarketcap.com. This tool originally worked by scraping the website, but now queries a JSON API (the same API the website itself uses to populate the historical prices table).

This is only intended for personal use and not for scraping at scale. Coinmarketcap will likely block you if you query too frequently and, for this reason, the code is set by default to query no more than 1 time per 15 seconds. I encourage you to be a good internet citizen and not go any quicker than that or use this tool for anything but limited personal use.

To use this you should:

  1. Start by adding the "price_sources" folder here into some location defined in your $PYTHONPATH
  2. Go to the commodity definition of your cryptocurrency and add a "price" attribute to refer to this price source. For example, for bitcoin you would add USD:price_sources.coinmarketcap/bitcoin
  3. You should now be able to use the bean-price tool to fetch prices!

On step 2, please note that the last part that says "bitcoin" is based on the URL used to get the historical prices, not the ticker symbol (in that example, the URL is https://coinmarketcap.com/currencies/bitcoin/historical-data/).

Credit to this post for the idea: https://medium.com/@danielcimring/downloading-historical-data-from-coinmarketcap-41a2b0111baf

beancount-coinmarketcap's People

Contributors

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