Giter Site home page Giter Site logo

crypto-script's Introduction

Crypto-script

Powered by CoinGecko

This script aims to be simple and to be used for any project. The script simply displays informations about the selected crypto.

Dependencies

How to use

Clone the repository and configure json settings in crypto_settings.json as follows:

  • Required

  • currency: string ("eur", "usd",...)
  • Optional

  • polybar: bool (set to true for 100% compatibility with polybar)
  • balance: int (amount of coins you have)
  • balance_precision: int (digits after decimal)
  • name: bool (true or false)
  • image: bool
  • current_price: bool
  • price_precision: int
  • market_cap: bool
  • market_cap_rank: bool
  • fully_diluted_valuation: bool
  • total_volume: bool
  • high_24h: bool
  • low_24h: bool
  • price_change_24h: bool
  • price_change_24h_precision: int (digits after decimal)
  • price_change_percentage_24h: bool
  • price_change_percentage_24h_precision: int (digits after decimal)
  • market_cap_change_24h: bool
  • market_cap_change_percentage_24h: bool
  • circulating_supply: bool
  • total_supply: bool
  • max_supply: bool
  • ath: bool
  • ath_change_percentage: bool
  • ath_date: bool
  • atl: bool
  • atl_change_percentage: bool
  • atl_date: bool
  • roi: bool
  • last_updated: bool

Example

{
    "polybar": true,
    "url": "https://api.coingecko.com/api/v3/coins/markets?",
    "currency": "eur",
    "crypto-list":[
        {
            "id": "bitcoin",
            "symbol": true,
            "current_price": true,
            "price_precision": 0
        },
        {
            "id": "ripple",
            "symbol": true,
            "current_price": true,
            "price_precision": 3,
            "balance": 10,
            "balance_precision": 0,
            "price_change_percentage_24h": true,
            "price_change_percentage_24h_precision": 2
        }
    ]
}

Use with Polybar

Set polybar value to true in crypto_settings.json and add the following config in polybar config:

[module/crypto]
type = custom/script
interval = 1
exec = python /path/to/crypto/script

For more information on values(like available currencies or available crypto) or anything else, take a look here.

Important note: keep in mind that the coingecko API has a limit of 100 requests per minute so an interval of 0.5(120 requests per minute) in polybar will not work but an interval of 1(60 requests per minute) is perfectly fine.

crypto-script's People

Contributors

flipflop133 avatar

Watchers

James Cloos 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.