Package ascii_graph

class ascii_graph.__init__.Pyasciigraph(line_length=79, min_graph_length=50, separator_length=2, graphsymbol=None, multivalue=True, human_readable=None, float_format=u'{0:.0f}')

Constructor of Pyasciigraph

  • line_length (int) – the max number of char on a line if any line cannot be shorter, it will go over this limit. Default: 79
  • min_graph_length (int) – the min number of char used by the graph itself. Default: 50
  • separator_length (int) – the length of field separator. Default: 2
  • graphsymbol (str or unicode (length one)) – the symbol used for the graph bar. Default: ‘█’
  • multivalue (boolean) – displays all the values if multivalued when True. displays only the max value if False Default: True
  • human_readable (string (si, cs, none)) –

    trigger human readable display (K, G, etc) Default: None (raw value display)

    • ‘si’ for power of 1000
    • ‘cs’ for power of 1024
    • any other value for raw value display)
  • float_format – formatting of the float value Default: ‘{0:.0f}’ (convert to integers). expample: ‘{:,.2f}’ (2 decimals, ‘.’ to separate decimal and int, ‘,’ every three power of tens).
graph(label=None, data=[])

function generating the graph

  • label (string) – the label of the graph
  • data (iterable) – the data (list of tuple (info, value)) info must be “castable” to a unicode string value must be an int or a float
Return type:

a list of strings (each lines of the graph)