huwwp / cryptop Goto Github PK
View Code? Open in Web Editor NEWcommand line crypto portfolio
License: MIT License
command line crypto portfolio
License: MIT License
Is it possible to add a parameter to be able to call cryptop
and have the infos formatted in JSON on stdout ?
So we can use the data in various script.
It should be very easy (depend on how did you implement your cache)
Thanks in advance!
IOTA is missing.
It would be great if we could track USD (or some other fiat) with Cryptop. Sometimes I sell and have it in holding (such as on an exchange like Kraken) ready to be used to buy back in -- but I still consider it part of my "mining monies". So, it would be great if we could track it here too. Either by adding "USD" as an option or even just "CASH" or something to be non-specific to any specific currency. Then it would just track as always valued at "1".
Just a thought/suggestion. Thanks!
When adding VTC as a symbol, crashes with error:
Traceback (most recent call last):
File "/home/user/environments/py3_crypto/bin/cryptop", line 11, in
load_entry_point('cryptop==0.2.0', 'console_scripts', 'cryptop')()
File "/home/user/environments/py3_crypto/lib/python3.6/site-packages/cryptop/cryptop.py", line 269, in main
curses.wrapper(mainc)
File "/usr/lib/python3.6/curses/init.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/home/user/environments/py3_crypto/lib/python3.6/site-packages/cryptop/cryptop.py", line 223, in mainc
write_scr(stdscr, wallet, y, x)
File "/home/user/environments/py3_crypto/lib/python3.6/site-packages/cryptop/cryptop.py", line 142, in write_scr
str_formatter(coin, val, held), x, curses.color_pair(2))
File "/home/user/environments/py3_crypto/lib/python3.6/site-packages/cryptop/cryptop.py", line 108, in str_formatter
val_str = '{:>{},.{}f}'.format(float(held) * val[0], max_length, dec_place)
TypeError: can't multiply sequence by non-int of type 'float'
$ cryptop
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/cryptop-0.1.1-py3.4.egg/cryptop.py", line 116, in read_wallet
with open(datafile, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/.cryptop/wallet.json'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 9, in <module>
load_entry_point('cryptop==0.1.1', 'console_scripts', 'cryptop')()
File "/usr/local/lib/python3.4/dist-packages/cryptop-0.1.1-py3.4.egg/cryptop.py", line 219, in main
curses.wrapper(mainc)
File "/usr/lib/python3.4/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python3.4/dist-packages/cryptop-0.1.1-py3.4.egg/cryptop.py", line 174, in mainc
wallet = read_wallet()
File "/usr/local/lib/python3.4/dist-packages/cryptop-0.1.1-py3.4.egg/cryptop.py", line 118, in read_wallet
except (FileNotFoundError, json.decoder.JSONDecodeError):
AttributeError: 'module' object has no attribute 'JSONDecodeError'
installed via pip and setup.py on a raspberry pi running raspbian.
Installed with sudo pip install cryptop
on macOS 10.12.5
Then, when I run cryptop
:
$ cryptop
Traceback (most recent call last):
File "/Users/ryan/.rvm/bin/cryptop", line 11, in <module>
load_entry_point('cryptop==0.1.2', 'console_scripts', 'cryptop')()
File "/Users/ryan/.rvm/lib/python2.7/site-packages/cryptop.py", line 201, in main
os.makedirs(basedir, exist_ok=True)
TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
Do you know how I might solve this issue? Thanks!
It appears that your coin data is only saved at exit. Unfortunately, now and then it crashes on me. Or, for various reasons, I happen to kill the shell it is running in or something. When that happens, any adjustments to coin values that I made are lost.
Wouldn't it be wise to save the coin data after each coin addition, update, or removal -- instead of just at exit? Just thought that would make good sense to throw a save in there each time you update.
Thanks!
Make "q" also exit the program instead of just "0"
Other than that this is great.
Hi,
I am getting the following error running cryptop from within an alpine docker container (frolvlad/alpine-python3):
ValueError: Currency formatting is not possible using the 'C' locale.
I've tried to override the environment variables with en_US.UTF-8 but no luck.
So, now that you can specify a locale and get a comma (or whatever) added for longer numbers... Is there no way to just turn that off? I'd simply like to have the numbers printed as-is without any separator at all. The default "monetary=" is blank -- but that still adds commas. Can we have a way to specify that we don't want any such character added to the numbers?
Also, I'm confused how "dec_places" is used. It doesn't appear to have any effect when I change it. What is it supposed to be?
Thanks!
Installed with :
sudo pip install cryptop
When running :
$ cryptop
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 9, in
load_entry_point('cryptop==0.1.5', 'console_scripts', 'cryptop')()
File "/usr/local/lib/python2.7/dist-packages/cryptop/cryptop.py", line 214, in main
os.makedirs(BASEDIR, exist_ok=True)
TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
Hi,
When cryptop is installed with pip the config.ini is missing and have to be created manually.
Br
Being able to add tags or naming the different 'accounts' would be really great. That way if people have multiple 'accounts' of, say BTC, they could keep track of which amount is which a bit easier.
BTC | SAVINGS | 1.0
BTC | COLLEGE FUND | 3.0
Can't do tables on here, but I'm sure you get the idea.
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 9, in
load_entry_point('cryptop==0.1.0', 'console_scripts', 'cryptop')()
File "/usr/local/lib/python2.7/dist-packages/cryptop-0.1.0-py2.7.egg/cryptop.py", line 237, in main
wrapper(mainc)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/cryptop-0.1.0-py2.7.egg/cryptop.py", line 226, in mainc
coinl, heldl = add_coin(data, coinl, heldl)
File "/usr/local/lib/python2.7/dist-packages/cryptop-0.1.0-py2.7.egg/cryptop.py", line 181, in add_coin
if if_coin(input[0]):
File "/usr/local/lib/python2.7/dist-packages/cryptop-0.1.0-py2.7.egg/cryptop.py", line 16, in if_coin
data = t.json()
TypeError: 'dict' object is not callable
I have Python 3.6 installed on Mac OS Sierra and running pip3 install cryptop
gives me the following error:
Collecting cryptop
Using cached cryptop-0.1.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/m2/d8ct83y13dl89j8xth4jwn8r0000gn/T/pip-build-hbta5suz/cryptop/setup.py", line 7, in <module>
readme = f.read()
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1709: ordinal not in range(128)
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/m2/d8ct83y13dl89j8xth4jwn8r0000gn/T/pip-build-hbta5suz/cryptop/
Any idea on how to fix that? Thanks!
vitticus@ubuntu:~$ alias python=python3.6
vitticus@ubuntu:~$ python --version
Python 3.6.1
vitticus@ubuntu:~$ cd Documents/
vitticus@ubuntu:~/Documents$ cd cryptop-master/
vitticus@ubuntu:~/Documents/cryptop-master$ sudo pip install cryptop
[sudo] password for vitticus:
The directory '/home/vitticus/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/vitticus/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: cryptop in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: requests in /usr/local/lib/python2.7/dist-packages (from cryptop)
Requirement already satisfied: requests_cache in /usr/local/lib/python2.7/dist-packages (from cryptop)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests->cryptop)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests->cryptop)
Requirement already satisfied: idna<2.6,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests->cryptop)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python2.7/dist-packages (from requests->cryptop)
vitticus@ubuntu:~/Documents/cryptop-master$ cryptop
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 11, in <module>
load_entry_point('cryptop==0.1.5', 'console_scripts', 'cryptop')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python2.7/dist-packages/cryptop/cryptop.py", line 6, in <module>
import configparser
ImportError: No module named configparser
The screen must update when the wallet.json is changed. An example use case:
When adding/updating a coin, if you accidentally put in a proper coin and the comma -- but then no value after that -- it is accepted and written to the wallet.json file, but then causes the app to crash. When you then try to restart it, it will crash again since it has invalid data in the wallet file. You have to manually replace or edit the wallet.json file to get running again.
Example: Hit A and then just do "DOGE," by itself. It'll add this to the json:
"DOGE": ""
...which it then fails to read.
Just wanted to report it. Thanks!
So, fairly regularly (at least once every 24 hours and often every hour or so), my Cryptop will die. It dumps "Could not complete request" and just ends. It's like a temporary issue pulling the data isn't caught as an exception or something.
I'm running 0.1.9 under Windows 10. Using GitHub Desktop to grab things and Python v3.6.2.
Actually, now that I look at the code, I see that it is indeed that. In get_price(), it tries to pull the coin data from cryptocompare and, if it gets an exception there, it just exits. Wouldn't this be fairly common that there is a temporary internet issue and/or cryptocompare is having a small issue and that request might fail? Seems like it would be better to just retry again?
Thanks!
Hi, I'm trying to use cryptop but get an error after running.
$ sudo pip3 install cryptop
The directory '/Users/mota/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/mota/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting cryptop
Downloading cryptop-0.2.0.tar.gz
Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from cryptop)
Collecting requests_cache (from cryptop)
Downloading requests_cache-0.4.13-py2.py3-none-any.whl
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests->cryptop)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests->cryptop)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests->cryptop)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests->cryptop)
Installing collected packages: requests-cache, cryptop
Running setup.py install for cryptop ... done
Successfully installed cryptop-0.2.0 requests-cache-0.4.13
$ cryptop
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/cryptop", line 11, in <module>
load_entry_point('cryptop==0.1.2', 'console_scripts', 'cryptop')()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cryptop.py", line 204, in main
config = read_configuration(conffile)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cryptop.py", line 24, in read_configuration
shutil.copyfile(defaultconf, conffile)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/shutil.py", line 114, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/config.ini'
Any help is appreciated, thanks.
Shouldn't releases be here before PyPI?
Any plans to display different fiat currencies, instead of the default USD?
Hi,
I've installed it using "sudo pip install cryptop" but when I try to run it I got the following issue:
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 9, in
load_entry_point('cryptop==0.1.2', 'console_scripts', 'cryptop')()
File "/usr/local/lib/python2.7/dist-packages/cryptop.py", line 202, in main
os.makedirs(basedir, exist_ok=True)
TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
So I've investigated a little bit and I found that exist_ok is only for python >= 3.2 and in my machine was running under python 2.7 after be installed with pip.
It would be great to have a command-line option to specify either a different location for the wallet.json and config.ini files -- or just allow the actual files to be specified specifically. I sometimes want to track two different sets of coins. For example, I track the coins that I've purchased separately from the coins that I've mined. So, I'd prefer to run two copies of cryptop -- one showing purchased coins and one showing mined coins. It'd be great if I could just do something like:
$ cryptop --wallet mining.json
...and it would use that instead of "wallet.json" from my .cryptop folder.
Just a thought if someone wants to pick it up. If no one does, I'll add it later when I have some more time. Thanks!
Doesn't seem to accept ByteBall. I checked the coin ids on https://www.cryptocompare.com/api/data/coinlist and GBYTE exists so not sure why.
Just some feedback, love what you are doing with this tool so far. It would be nice if there was some way to sort the output. Maybe by coin, price, or val? Or maybe display them in order as saved in the wallet.dat file.
so much better than going to the exchanges to check prices often... running in guake so getting the prices is just 1 key stroke away.
If you have a HELD amount bigger than 4 digits to the left of the decimal, then the entire column gets shifted to the right (as well as the rest of the columns to the right). It would be good if we could expand the column sizes (or even auto-adjust them all if one is too large).
Not usually an issue with BTC -- if someone has 10000+, then they likely aren't worried about tracking it here. But, for those of us Shibes with Dogecoin, it isn't a big deal to have 5-digit or even 6-digit coins held. (100,000 Dogecoin is like $170.)
Thanks!
Adding Lunyr to the portfolio lead to a crash of cryptop.
Traceback (most recent call last): File "/home/user1/anaconda3/bin/cryptop", line 11, in <module> load_entry_point('cryptop==0.2.0', 'console_scripts', 'cryptop')() File "/home/user1/anaconda3/lib/python3.6/site-packages/cryptop/cryptop.py", line 269, in main curses.wrapper(mainc) File "/home/user1/anaconda3/lib/python3.6/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/home/user1/anaconda3/lib/python3.6/site-packages/cryptop/cryptop.py", line 223, in mainc write_scr(stdscr, wallet, y, x) File "/home/user1/anaconda3/lib/python3.6/site-packages/cryptop/cryptop.py", line 142, in write_scr str_formatter(coin, val, held), x, curses.color_pair(2)) File "/home/user1/anaconda3/lib/python3.6/site-packages/cryptop/cryptop.py", line 108, in str_formatter val_str = '{:>{},.{}f}'.format(float(held) * val[0], max_length, dec_place) TypeError: can't multiply sequence by non-int of type 'float'
Thanks a lot for this little app, very simple but powerful ;)
vitticus@kali:~/cryptop-master$ ls
config.ini img MANIFEST.in requirements.txt todo.txt
cryptop.py LICENSE.txt README.rst setup.py
vitticus@kali:~/cryptop-master$ python --version
Python 3.6.2
vitticus@kali:~/cryptop-master$ sudo python setup.py install
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from setuptools import setup, find_packages
ModuleNotFoundError: No module named 'setuptools'
vitticus@kali:~/cryptop-master$
I didn't review the code but the CPU is highly used by python3 when the script is running.
Br
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/cryptop/cryptop.py", line 270, in main
curses.wrapper(mainc)
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/curses/init.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python3.6/site-packages/cryptop/cryptop.py", line 224, in mainc
write_scr(stdscr, wallet, y, x)
File "/usr/local/lib/python3.6/site-packages/cryptop/cryptop.py", line 142, in write_scr
str_formatter(coin, val, held), x, curses.color_pair(2))
File "/usr/local/lib/python3.6/site-packages/cryptop/cryptop.py", line 108, in str_formatter
val_str = '{:>{},.{}f}'.format(float(held) * val[0], max_length, dec_place)
TypeError: can't multiply sequence by non-int of type 'float'
I can't figure out the correct setting in config.ini:
[locale]
monetary=
But with default config I get
File "/usr/lib/python3.9/locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
or
ValueError: Currency formatting is not possible using the 'C' locale.
Tried locale.LC_NUMERIC or locale.localeconv() but could get enough clue.
Thanks!
RDN (Raiden Network) is not supported in crypto compare as RDN but as RDN*
(RDN refers to another coin) however, adding symbol RDN*
doesn't work in the app and after submission nothing is shown.
After upgrading from 0.1.1 to 0.1.2 I get to following error during startup:
Traceback (most recent call last):
File "/usr/local/bin/cryptop", line 9, in <module>
load_entry_point('cryptop==0.1.2', 'console_scripts', 'cryptop')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2235, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python2.7/dist-packages/cryptop-0.1.2-py2.7.egg/cryptop.py", line 6, in <module>
import configparser
ImportError: No module named configparser
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.