加载csv文件并输出条形图的命令行界面。

bars的Python项目详细描述


一个小的命令行实用程序,用于获取csv文件并在中打印条形图 你的终端。尤其是与CSVKit等工具结合使用时, q,和jq

$ curl -s http://www.census.gov/popest/data/national/totals/2015/files/NST-EST2015-alldata.csv | head -n 6 | bars --label NAME --value POPESTIMATE2015 --width 72 -
NAME             POPESTIMATE2015
United States        321,418,820 ▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Northeast Region      56,283,891 ▓░░░░░
Midwest Region        67,907,403 ▓░░░░░░
South Region         121,182,847 ▓░░░░░░░░░░░░
West Region           76,044,679 ▓░░░░░░░
                                 +---------+---------------------------+
                                 0    100,000,000            400,000,000

安装

pip install -e git+https://github.com/flother/bars#egg=bars

用法

Usage: bars [OPTIONS] CSV

  Load a CSV file and output a bar chart.

Options:
  --label TEXT        Name or index of the column containing the label values.
                      Defaults to the first text column.
  --value TEXT        Name or index of the column containing the bar values.
                      Defaults to the first numeric column.
  --domain NUMBER...  Minimum and maximum values for the chart's x-axis.
  --width INTEGER     Width, in characters, to use to print the chart.
                      [default: 80]
  --skip INTEGER      Number of rows to skip.  [default: 0]
  --encoding TEXT     Character encoding of the CSV file.  [default: UTF-8]
  --no-header         Indicates the CSV file contains no header row.
  --printable         Only use printable characters to draw the bar chart.
  --help              Show this message and exit.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何从不同的类向jtable添加数据?   apache flink初始化状态导致此错误“java.lang.NullPointerException:Keyed状态只能用于“Keyed流”   java从屏幕调用不同的screen thru按钮   java MySQL数据库用户权限   java JavaFX将边距添加到矩形形状   JavaSpring在集成测试中没有触及ControllerAdvice   java Apache HttpClient POST不适用于实体   安装插件后,java无法在eclipse中找到TestNG选项   web爬虫Java获取web内容跳过中间页以响应到达所需的响应   Java Android Studio libGDX Api 16崩溃   java访问类字节?   java如果要打开socket,如何中断线程?   Java中的运费计算器,得出错误的数字   java是一种事务管理应用程序,无需在方法上使用@transactional   java KeyListener在单击画布后停止工作   java新手询问Android Webview以查看网络摄像头的快照?