Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

TonyTheTaiga/pycap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyCap V0.2

A simple python CLI using Click with Coinmarketcap's API.

API Keys can be obtained from the link below.

sandbox = https://sandbox.coinmarketcap.com/ live = https://pro.coinmarketcap.com/

sandbox/live API keys are NOT interchangable.

By default the app uses the LIVE VERSION of the site, make sure you have a LIVE API_KEY.

App can be changed to the sandbox version by changing __base in api.py. Refer Below. https://pro.coinmarketcap.com/api/v1#section/Quick-Start-Guide

Installation

First, clone this repository and open up the directory in a terminal.

API_KEY can be exported by running "export API_KEY='include-the-(')'" in the terminal.

Run 'pip install --editable .' (<--- dont forget the period) and this should install the script in the virtual enviroment.

Usage

commands : price | portoflio | btc | update

Supported Currency Codes are here: https://pro.coinmarketcap.com/api/v1#section/Standards-and-Conventions

btc

prints price of btc

'pycap btc' -> {'btc': '6580.44960555'}

price

'pycap price ada' -> [{'Cardano': '0.00001529'}]

price also supports different currencies as well as chaining mulitple coins.

'pycap price --curr=usd ada hot' -> [{'Cardano': '0.09934988'}, {'Holo': '0.00060517'}]

--curr=XYZ where XYZ is the currency code.

update

pycap update allows you to add coins to your porfolio

portfolio

please edit the portfolio.json with your own balances.

Format is {"symbol": units}

'pycap portfolio' -> {'btc': 649.302288075, 'ada': 99349.88, 'iotx': 218.7848, 'hot': 6051.700000000001}

you can also get the sum of total balance by doing

'pycap portfolio --total=y' -> $106269.667088075

Like with price, --curr option is supported

'pycap portfolio --curr=jpy' -> {'btc': 71885.40007175, 'ada': 10999200.22, 'iotx': 24222.056200000003, 'hot': 669992.7}

'pycap portfolio --curr=jpy --total=y' -> ¥11765300.376271749

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages