Skip to content

Latest commit

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

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

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages