code: def history(ctx, account, limit, type, csv, exclude, raw):
      
      from peerplaysbase.operations import getOperationNameForId
  
      header = ["#", "time (block)", "operation", "details"]
      if csv:
          import csv
  
          t = csv.writer(sys.stdout, delimiter=";")
          t.writerow(header)
      else:
          t = PrettyTable(header)
          t.align = "r"
          t.align["details"] = "l"
  
      for a in account:
          account = Account(a, peerplays_instance=ctx.peerplays)
          for b in account.history(limit=limit, only_ops=type, exclude_ops=exclude):
              row = [
                  b["id"].split(".")[2],
                  "%s" % (b["block_num"]),
                  "{} ({})".format(getOperationNameForId(b["op"][0]), b["op"][0]),
                  pprintOperation(b) if not raw else json.dumps(b, indent=4),
              ]
              if csv:
                  t.writerow(row)
              else:
                  t.add_row(row)
      if not csv:
          click.echo(t)
docs: Show history of an account