加载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如何拆分字符串(基于各种分隔符),但不保留空格?   解析。Json格式的txt文件和knime中的java   java Spring rest api为什么在rest api调用的响应中更改了数据类型   升华文本3抛出java。lang.ClassNotFoundException,而记事本++不存在   java Android指纹扫描仪在尝试5次后停止工作?   java Android如何设置精确的重复报警?   java如何使用HTTPGET connect为access API输入用户名和密码   java当测试报告显示没有测试失败时,Gradle为什么说“有失败的测试”?   用Gson实现java获取响应   MapReduce程序中函数错误的java不可映射参数   java spring安全性不符合自动代理的条件   java GWT使用异步回调进行同步/阻塞调用   java奇怪的类数组问题无法在jsp中显示   如何在java中使用PrinterJob使用epl打印条形码   java如何在JTable中居中单元格   将Java Mockito测试转换为Kotlin   html Java正则表达式模式匹配到多个相同标记   testCompile中缺少java Gradle(Android)多项目依赖项   在输入提示后输入字符串时发生java FileNotFoundException