SkillAgentSearch skills...

Coinwatch

Coinmarketcap console client to keep track of your crypto currency trades - are you winning or losing?

Install / Use

/learn @cytopia/Coinwatch

README

coinwatch

Installation | Usage | Screenshots | Features | Columns | Configuration | Options | API | Requirements | License

PyPI PyPI - Status PyPI - Python Version PyPI - Format PyPI - Implementation

Build Status Build Status Build Status

Coinwatch is a low-dependency python-based console client client to keep track of your crypto trades and easily let's you see if you are winning or losing.

All you have to do is enter all of your purchases: When, How many coins and price per coin. Then each time you launch coinwatch, it will show your current status and will make you happy or sad.

Installation

pip install coinwatch

Usage

# Default run
coinwatch

# Specify different profile/config
coinwatch -c ~/path/to/conf.yml

# Different columns and order
coinwatch -r "name buyprice nowprice wealth invest profit"
coinwatch -r "name date nowprice wealth profit percent"

# Specify sort and order
coinwatch -s profit -o desc

# Sort and group by name
coinwatch -s name -g name

# Disable colorized output
coinwatch -n

# Different table border
coinwatch -t ascii
coinwatch -t thin
coinwatch -t thick

# Alternative number format
coinwatch -h

# Text output wrapped in watch
watch --interval=10 'coinwatch -n'

Screenshots

The example shows the usage of an alternative configuration file. normal

The example shows an alternative number format normal

The example shows how it looks in text mode normal

The example shows coinwatch wrapped into watch and refresh every 10 seconds. watcher

Features

  • Keep track of all of your trades
  • Trades are grouped by each crypto currency
  • Different trading profiles can be used by specifying different configuration files
  • Pure text-based output is available for further processing in other tools

Columns

coinwatch offers many columns that can be displayed in any order. A sane limited default is set in the configuration file which does not display all columns. You are free to alter that and adjust coinwatch to your needs directly in the configuration file (see Configuration) or quickly enabled/disable columns via command arguments (-r). Sorting, ordering and grouping will also work on columns that are not being displayed. Have a look at the following table which shows you all available columns:

| Column name | Default display | Description | |-------------|-----------------|-------------| | name | no | Name of the cryptocurrency. | | symbol | yes | Abbreviation name of the cryptocurrency. | | buyprice | yes | Price in USD at which the currency was bought. | | diffprice | yes | Price difference in USD between buy time and now. | | nowprice | yes | Current price in USD of the currency. | | amount | yes | Total number of coins you have bought. | | invest | yes | Total amount in USD you have invested for all coins bought. | | wealth | yes | Current amount in USD your coins are worth now. | | profit | yes | How much profit in USD did you make on that currency. | | percent | yes | Percent of profit between buy time and now. | | percent1h | no | Percent of price change in the last hour of that currency. | | percent24h| no | Percent of price change in the last 24 hours of that currency. | | percent7d | no | Percent of price change in the last 7 days of that currency. | | vol_24h | no | Volume in USD in the last 24 hours. | | marketcap | no | Market capacity in USD. | supply_a | no | Currently available supply of coins. | | supply_t | no | Total supply of coins. | | supply_m | no | Maximum supply of coins. | | cust1 | no | Custom field (see Configuration)| | cust2 | no | Custom field (see Configuration)| | cust3 | no | Custom field (see Configuration)|

Note about custom fields:

Headline and column width of custom fields can be set in the configuration file. The values itself can be added to your trade array and can contain any information you wish to display for a given trade. As an example they could contain information such as:

  • At what date did you buy that currency
  • At what market did you buy that currency
  • The wallet address where the coins are
  • Are the coins still online or already downloaded to a cold wallet

Configuration

When starting coinwatch for the first time, it will create a default configuration file in ~/.config/coinwatch/config.yml with no trades to watch. To get a quick overview, have a look at the example config.

Configuration is done in yaml format. If you have never heard about yaml before, have a look at its official example: http://yaml.org/start.html

Structure

The configuration file is build up like this:

# Configure coinwatch
config:
  # Specify the default column to sort this table by or leave empty for unsorted.
  # Overwrite via -s <column>
  sort:
  # Specify the sort order (asc or desc)
  # Overwrite via -o desc
  order: asc
  # Configure what columns to display and in what order.
  # To see all available columns view help: $ coinwatch --help
  # Columns specified via command line (-r) take precedence
  #
  # There are also three other columns which are off by default: 'cust1', 'cust2' and 'cust3'.
  # Enable them here or via (-r).
  # Those three columns can be added to your trades in order to display custom information,
  # such as which market they were bought from or on what date they were bought.
  columns: name symbol date buyprice diffprice nowprice amount invest wealth profit percent
  # Define your custom columns here.
  # Set column headline and width.
  cust:
    cust1:
      headline: BUY DATE
      width: 10
    cust2:
      headline: MARKET
      width: 10
    cust3:
      headline: EXAMPLE
      width: 10
  # Specify your table border style
  # Available values: thin, thick and ascii
  # Use ascii if you want to further process the output of this application
  table: thin

# Configure your purchases
trades:
  # CURRENCY_ID is found by looking up the 'id' key from
  # https://api.coinmarketcap.com/v1/ticker/?limit=0
  CURRENCY_ID:  # <-- [array]       Each currency will hold a list of trades
    - amount:   # <-- [decimal]     [1] How many coins for that currency were bought
      invest:   # <-- [decimal]     [1] How much money in total was invested
      price:    # <-- [decimal]     [1] Price for 1 coin of that currency
      cust1:    # <-- [string]      Custom column
      cust2:    # <-- [string]      Custom column
      cust3:    # <-- [string]      Custom column

[1] amount, invest and price at the same time? Yes that's right there is duplication, however only always two of those three can be specified at the same time. This gives the possibility to record you trades in three different ways:

Option-1: amount and invest

How many coins did you buy and how much money in total did you spent on that?

This option is most useful when having done a real purchase. Enter the total money spent and the coins received. That way you don't have to calculate any market fees or transaction fees yourself.

# Bought 0.4 coins
# Total cost of that: 3742.35 $
trades:
  bitcoin:
    - amount: 0.4
      invest: 3742.35

Option-2: amount and price

How many coins did you buy and how much did one coin cost?

This option is most useful when doint dry-run trades - What would have happened if. Enter how many coins you had bought at what price per coin.

# Bought 0.4 coins
# 1 Bitcoin had a price of: 9355.875 $
trades:
  bitcoin:
    - amount: 0.4
      price:  9355.875

Option-3: invest and price

How much money in total did you spend and how much did one coin cost?

This option is most useful when doint dry-run trades - What would have happened if. Enter how much money you would have spent and what the price per coin was.

# Total cost of that: 3742.35 $
# 1 Bitcoin had a price of: 9355.875 $
trades:
  bitcoin:
    - invest: 3742.35
      price:  9355.875

Get currency names

When adding new cryptocurrencies, you need to make sure that you use the correct name to add to the configuration file. Names can be retrieved from https://api.coinmarketcap.com/v1/ticker/?limit=0.

| Screenshot | Explanation | |------------|-------------| | api | When visiting the coinmarketcap API page, look for the id field of a currency and use its value to add to the configu

View on GitHub
GitHub Stars82
CategoryDevelopment
Updated3mo ago
Forks16

Languages

Python

Security Score

97/100

Audited on Dec 9, 2025

No findings