rbonvall / python-boxea

ASCII-art to Unicode box-drawing characters converter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Boxea

Convert ASCII-art box drawings to prettier versions by using box-drawing Unicode symbols (ANSI-art).

Usage

The script uses standard input and output:

$ cat example
+-----+-----+
| abc | def |
+-----+-----+
|  12 |   0 |
|   4 |  72 |
+-----+-----+

$ boxea.py < example
┌─────┬─────┐
│ abc │ def │
├─────┼─────┤
│  12 │   0 │
│   4 │  72 │
└─────┴─────┘

It can also be used as a Python module:

>>> import boxea
>>> s = u'''
... +---+
... | a |
... +---+'''
>>> print boxea.ascii_to_box(s)

┌───┐
│ a │
└───┘

To do

  • Support double lines (═══).
  • Support thicker lines (━━━).
  • Allow to use characters other than +, - and |.
  • Better command-line interface (options, file name arguments).
  • Create setup.py script.
  • Upload to PyPI.
  • Choose a license.

Patches are welcome. Please use the issue tracker for bug reports and feature requests.

Author

Roberto Bonvallet <rbonvall@gmail.com>

About

ASCII-art to Unicode box-drawing characters converter


Languages

Language:Python 100.0%