Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xophmeister/quicktick
Simple cryptocurrency ticker
https://github.com/xophmeister/quicktick
cryptocurrency fiat-money ticker
Last synced: 6 days ago
JSON representation
Simple cryptocurrency ticker
- Host: GitHub
- URL: https://github.com/xophmeister/quicktick
- Owner: Xophmeister
- License: gpl-3.0
- Created: 2017-11-20T17:16:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-24T12:51:37.000Z (about 7 years ago)
- Last Synced: 2024-12-07T02:47:49.732Z (26 days ago)
- Topics: cryptocurrency, fiat-money, ticker
- Language: Python
- Size: 35.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
quicktick
=========
Output a cryptocurrency price ticker to stdout based on the
configuration found, by default, in ``~/.quicktick``. Options can be
provided at the command line to override any part of the ticker
configuration.Installation
------------
quicktick requires Python 3.6, or newer, and can be installed using
``pip``:::
pip install quicktick
Usage
-----
::quicktick [-h] [-V] [--config CONFIG] [--crypto CRYPTO] [--fiat FIAT] [--template TEMPLATE] [--source SOURCE]
Options are as follows:
-h, --help Show this help message and exit
-V, --version Show version and license information
--config CONFIG Use alternative configuration file
--crypto CRYPTO Symbol to use as the cryptocurrency
--fiat FIAT Symbol to use as the fiat currency
--template TEMPLATE Template name or raw Jinja2 template
--source SOURCE Source for the price dataConfiguration
-------------
The configuration is a YAML file, which will be created in your home
directory on first run (if it doesn't already exist), which defines the
default ticker, how to output price data and how data sources are
defined. Jinja2 templating is used to make this very adaptable to your
needs.The default configuration only defines a data source for the
`CoinMarketCap `_ API with support for::Cryptocurrencies:
* Bitcoin
* Bitcoin Cash
* Ethereum
* Litecoin:Fiat currencies:
* US Dollars
* Euros
* Chinese Yuan
* British Pounds:Price data:
* Exchange rate
* Change in the last hourCoinMarketCap's API supports many more options and these can be added to
your configuration, as needed. Alternatively, other JSON-based HTTP APIs
can be defined as data sources.Ticker
~~~~~~
The default ticker is defined under the ``ticker`` section in the
configuration. It takes four attributes:``source``
The data source to use, defined in the ``sources`` section.``crypto``
The cryptocurrency symbol to use, as defined by the ``source``.``fiat``
The fiat currency symbol to use, as defined by the ``source``.``template``
The template to use to render the ticker, defined in the ``templates``
section (n.b., this must be a predefined template; a raw Jinja2
template string can only be used at the command line).Templates
~~~~~~~~~
The ``templates`` section is used to define named Jinja2 templates. By
default, there is ``simple`` and ``ansi`` (which is the same as
``simple``, with ANSI escape sequences used for colour output). When the
templates are rendered, they have access to three sets of data:``fiat``
The fiat currency symbol (see `Data Sources`_ for details).``crypto``
The cryptocurrency symbol (see `Data Sources`_ for details).Price data
The price data variables returned by the data source (see `Data
Sources`_ for details).Data Sources
~~~~~~~~~~~~
The ``sources`` section is used to define named data sources; that is,
JSON-based HTTP APIs. Each data source takes four attributes:``url``
The URL for the data source; again, a Jinja2 template that is supplied
with the ``fiat`` and ``crypto`` symbols.``data``
This subsection allows you to define the price data variables that are
available to the output template. These are again Jinja2 templates
that describe the mapping from the API's ``json`` response, along with
the ``crypto`` and ``fiat`` symbols.``cryptos`` and ``fiats``
These subsections allow you to define cryptocurrencies and fiat
currencies, respectively. Conventionally, you would use the symbol
name as the currency's identifier, which take a dictionary of named
parameters. These parameters are then available to the templates that
use the symbols.License
-------
Copyright (c) 2017 Christopher HarrisonThis program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.You should have received a copy of the GNU General Public License along
with this program. If not, see .