Giter Site home page Giter Site logo

bashplotlib's People

Contributors

aluriak avatar asbjorn avatar bbbbbrie avatar bobotig avatar bryant1410 avatar glamp avatar gregoryashton avatar iiseymour avatar kennethgoodman avatar sboysel avatar tijko avatar timgates42 avatar xiongchiamiov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bashplotlib's Issues

ImportError: No module named bashplotlib.histogram

In a virtualenv:

$ pip install bashplotlib
$ ... | hist
...
ImportError: No module named bashplotlib.histogram

Here is my environment on a Ubuntu 12.04:

$ python --version
Python 2.7.6
$ pip --version
pip 1.5.6 from /var/local/virtualenvs/ipython/local/lib/python2.7/site-packages (python 2.7)
$ pip uninstall bashplotlib
Uninstalling bashplotlib:
  /var/local/virtualenvs/ipython/bin/hist
  /var/local/virtualenvs/ipython/bin/scatter
  /var/local/virtualenvs/ipython/lib/python2.7/site-packages/bashplotlib-0.6.4-py2.7.egg-info

It looks like there should be directory /var/local/virtualenvs/ipython/lib/python2.7/site-packages/bashplotlib but there isn't.

Console candlestick plot

Hello,

I'm looking for a python script to draw candlestick plot inside a text user interface (ncurses or urwid).

Could you help me to do that ?

For now I've done a script which download from Yahoo Finance
GOOG OHLCV data (and put data into a SQLite cache)

You need pandas, requests and requests-cache

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import requests

import requests_cache

expire_after = None #15*60 # expire_after=delay_second or None
requests_cache.install_cache('req_cache', backend='sqlite', expire_after=expire_after)

from StringIO import StringIO

import pandas as pd

def get_ohlcv_data(size, offset=0):
    url = "http://ichart.finance.yahoo.com/table.csv?s=GOOG"
    req = requests.get(url)
    #print(req.content)
    io = StringIO(req.content)
    df = pd.read_csv(io, sep=',', parse_dates=['Date'])
    df = df.rename(columns={
        'Date': 'date',
        'Open': 'open',
        'High': 'high',
        'Low': 'low',
        'Close': 'close',
        'Volume': 'volume',
        'Adj Close': 'adj close',
    })
    df = df.set_index('date')
    df = df[offset:size+offset][::-1]
    return(df)

def main():
    df = get_ohlcv_data(50, 0)
    print(df)
    print(df.dtypes)

    inc = df['close'] > df['open']
    dec = df['close'] < df['open']

if __name__ == "__main__":
    main()

An other sofware provide something similar
http://prof7bit.github.io/goxtool/

but I really want to isolate plot to be standalone.

It will be nice if bashplotlib could provide such feature.

Kind regards

--nosummary doesn't hide the summary

Observe:

[$]> git shortlog -s -n | awk '{print $1}' | hist --nosummary

 33|   o
 32|   o
 30|   o
 28|   o
 27|   o
 25|   o
 23|   o
 22|   o
 20|   o
 18|   o
 16|   o
 15|   o
 13|   o
 11|   o
 10|   o
  8|   o
  6|   o
  5|   o
  3|   o o     o
  1|   o o     o o       o
  0|   o o o o o o       o
    ----------------------

-----------------------
|       Summary       |
-----------------------
|   observations: 50  |
| min value: 1.000000 |
|  mean : 519.140000  |
|max value: 3207.000000|
-----------------------

Change the name

"bashplotlib" doesn't figure well what is it, it's not written in bash but in Python.
"pyplotlib" or "asciiplotlib" would be better names.

Making histogram

I am trying to display a histogram, and it doesn't work, but instead prints -----------... My code is

with open("cpuhistory.txt", "r") as n:

    plot_hist(n)
    n.close()

and cpuhistory.txt is https://pastebin.com/vPMBTxzJ .

How can I get it working?

pip installation issues re 0.5.3 or 0.6.0

As of the submission of this issue, it seems that bashplotlib can't be installed from pypi via pip in a virtualenv; when I do so, pip attempts to install 0.6.0 but fails with the following error:

 IOError: [Errno 2] No such file or directory: 'LICENSE.txt'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/home/lev/Work/virtualenvs/PYTHON/build/bashplotlib/setup.py", line 11, in <module>

    license=open("LICENSE.txt").read(),

IOError: [Errno 2] No such file or directory: 'LICENSE.txt'

Moreover, I noticed that pypi appears to list 0.5.3 as a later release than 0.6.0.

ImportError: No module named 'bashplotlib'

Hi,

I'm using Python 3.4.2 and run into the following error when trying to import 'bashplotlib':

ImportError: No module named 'bashplotlib'

It happens when importing it in my project with the example of the README as follows:

from bashplotlib.histogram import plot_hist

I installed the package with the following command:

sudo pip3 install bashplotlib

And it's listed under the installed packaged.

Could you help me with this?

Rename `hist` command to something less likely to be a shell builtin

My shell (ksh93) informs me that

$ type -a hist
hist is a shell builtin
hist is /Library/Frameworks/Python.framework/Versions/3.6/bin/hist
hist is an undefined function

in other words, if I try to run hist I will get the shell builtin first. I can circumvent that by using the env program, but this is not obvious right away.

Is the library maintained?

Hello,
I've seen Bashplotlib.
it seems this piece of software is inactive since long ago.
is it right?
Thanks

Life feed ploting

Hi

I wish I could do some "live" ploting. Let's say I'm migrating stuff from server, I'ld like to keep an eye on disk space, I'ld like to do something like

while true; do sleep 1; df -k / --output=used | tail -n1; done | hist -n

Or maybe

hist --command 'df -k / --output=used | tail -n1'

Which would draw a simple plot "in place", I mean refreshing it instead of a new one. With a couple of option like rate (plot every X seconds), and horizontal rule (in my example, a value I don't wanna cross)

I know nowadays it's all about prometheus grafana etc, but a good CLI tool is still priceless for smaller team

Best regards,

Running bin/texas on python 3.x returns syntax error.

I was going through some of the code and attempted to run the texas program on python 3.5.1 and got:

(bashplotlib) [tijko@arch bin]$ ./texas 
  File "./texas", line 10
    print open(texas).read().strip()
             ^
SyntaxError: invalid syntax

Python3 Support

Nice library, but because of prints without parenthesis, doesn't work in python3. I suggest adding print_function future import and using () after all prints to support both 2 and 3.

Outdated docs in README

The documentation in the README shows nosummary as a keyword argument for plot_hist, but it seems as though this was changed to showSummary (and the meaning of the flag inverted). Not sure if there are other inconsistencies.

trouble on CentOS 6.7 with python 2.6

After installling I am getting following error:

 git clone https://github.com/glamp/bashplotlib.git
 cd bashplotlib
 python setup.py install


bashplotlib]$ hist --demo
Traceback (most recent call last):
  File "/usr/bin/hist", line 9, in <module>
    load_entry_point('bashplotlib==0.6.3', 'console_scripts', 'hist')()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.6/site-packages/bashplotlib-0.6.3-py2.6.egg/bashplotlib/histogram.py", line 125
    hist = {i: 0 for i in range(len(bins))}
                   ^
SyntaxError: invalid syntax

Error Messages on build?

I'm getting the following errors when trying to build using Python3.8

davidjackson@VirtualBox:/bashplotlib$ python3 setup.py install
Traceback (most recent call last):
File "setup.py", line 3, in
from setuptools import find_packages, setup
ModuleNotFoundError: No module named 'setuptools'
davidjackson@VirtualBox:
/bashplotlib$

Include LICENSE in the tarball

Currently the LICENSE is not distributed within the tarball. Can you please include the LICENSE in future distributions?

Unicode?

Shall i implement unicode to make it beatifull, also wanted to know if this project is dead

Plot using Python variables

I think it'd be nice and not really complicated to add support to plot from two variables in lists/np.array's. This would be useful when e.g. debugging in a command-line in a remote server.

I can contribute if no one else volunteers to do it and the authors agree on adding this

realtime plot two parameter in python

hello
first sorry my english is not that good , hope you understand
thank you

i tryng to realtime plot two parameter in python

exemple i do have this two parameter , time and a value from a sensor

print 'time ' ,time2
print 'sensor1 ' ,sensor1

this parameter is well 'print'
so i want to plot it
i have tried several conbination , without success

exemple
plot_scatter('',time2,sensor1,3,'','','')
plot_hist(r2, height=20.0, bincount=None, pch='o', colour='white', title='', xlab=None, nosummary='')

can you help me to go on
i am using it in raspberry

OptParse: Command line parser deprecated

Hello,

I just send you this message to say you that OptParse is now deprecated
http://docs.python.org/2/library/optparse.html

You should use ArgParse
http://docs.python.org/2/library/argparse.html#module-argparse

Some other python command line parsers are
docopt http://docopt.org/
docstring oriented

clize https://pypi.python.org/pypi/clize/
decorator oriented

argh https://pythonhosted.org/argh/

see also https://pythonhosted.org/argh/similar.html

Kind regards

pip install produces IOError: [Errno 2] No such file or directory: 'LICENSE.txt'

Here's what I get!

pip 1.4.1 from /usr/lib/python2.7/dist-packages (python 2.7)

: minisub ~tmp%; pip install bashplotlib
Downloading/unpacking bashplotlib
  Downloading bashplotlib-0.5.1.tar.gz
  Running setup.py egg_info for package bashplotlib
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/tmp/pip_build_danny/bashplotlib/setup.py", line 10, in <module>
        license=open("LICENSE.txt").read(),
    IOError: [Errno 2] No such file or directory: 'LICENSE.txt'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/tmp/pip_build_danny/bashplotlib/setup.py", line 10, in <module>

    license=open("LICENSE.txt").read(),

IOError: [Errno 2] No such file or directory: 'LICENSE.txt'

Unicode Braille characters

I have to confess that I haven't played with your library yet, I just looked at the README on GitHub. Still, your project reminded me of drawille, which is meant to draw stuff on terminal using Unicode Braille characters.

Maybe your project could support such characters in some drawings. Maybe you could link to drawille as a related project that might be useful for other use-cases.

Not supported on Python < 2.7

bashplotlib uses a dictionary comprehension, which was added in 2.7 (and 3.0).

On 2.6, this produces a syntax error:

Traceback (most recent call last):
  File "/usr/bin/hist", line 6, in <module>
    from bashplotlib.histogram import plot_hist
  File "/usr/lib/python2.6/site-packages/bashplotlib/histogram.py", line 84
    hist = {i: 0 for i in range(len(bins))}
                   ^
SyntaxError: invalid syntax

2.6 is still relatively recent (it is, for instance, the "new" Python available on CentOS 5, as python is 2.4), so it'd be nice to include support for it.

Add median to hist summary

Hi and thanks for this very useful tiny tool!

In addition to min/mean/max, could you also add the median to the hist summary?

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.