Skip to main content

The simple console version of a drawing program!

Project description


Build Status

Travis Continuous Integration Appveyor Continuous Integration Code coverage Scrutinizer Code Quality

Package information Documentation Status


The simple console version of a drawing program!


At this time, the functionality of the program is quite limited but this might change in the future. In a nutshell, the program should work as follows:

  1. Create a new canvas
  2. Start drawing on the canvas by issuing various commands
  3. Quit

At the moment, the program supports the following commands:

  • Create the Canvas
  • Draw a Line (Only horizontal and vertical lines are supported!)
  • Draw a Rectangle
  • Fill a Region with a given Color
  • Erase the Canvas
  • Quit

If you want to resize the Canvas after it has been created you can run the create command again, but you will be asked for confirmation as the previous canvas will be replaced by the new one!


You can install with pip:

$ pip install canvascli


After installation you can run from the terminal/cli by executing

$ canvascli


$ canvascli

Enter command: C 20 4
|                    |
|                    |
|                    |
|                    |

Enter command: L 1 2 6 2
|                    |
|xxxxxx              |
|                    |
|                    |

Enter command: L 6 3 6 4
|                    |
|xxxxxx              |
|     x              |
|     x              |

Enter command: R 16 1 20 3
|               xxxxx|
|xxxxxx         x   x|
|     x         xxxxx|
|     x              |

Enter command: B 10 3 o
|xxxxxx.........x   x|
|     x.........xxxxx|
|     x..............|

Enter command: E
|                    |
|                    |
|                    |
|                    |

Enter command: Q

Lowercase commands are also valid!


When running canvascli at any moment the help can be viewed typing H

$ canvascli

Enter command: H

CanvasCLI: the simple console version of a drawing program!

Program commands:

    H               Display help

    C width height  Create a new canvas of given size
                        width: Canvas width
                        height: Canvas height

    L x1 y1 x2 y2   Draw a Line from (x1,y1) to (x2,y2)
                        x1: Point 1 x coordinate
                        y1: Point 1 y coordinate
                        x2: Point 2 x coordinate
                        y2: Point 2 y coordinate

    R x1 y1 x2 y2   Draw a Rectangle given by (x1,y1) and (x2,y2)
                        x1: Upper left corner x coordinate
                        y1: Upper left corner y coordinate
                        x2: Lower right corner x coordinate
                        y2: Lower right corner y coordinate

    B x y color     Fill the area connected to (x,y) with color
                        x: Point x coordinate
                        y: Point y coordinate
                        color: Expressed as an ASCII single character

    E               Erase the contents of the canvas.

    Q               Quit program

- Currently only horizontal or vertical lines are supported.
- Horizontal and vertical lines will be drawn using the 'x' character.


To run the test suite you need to install pytest and pytest-cov and run:

$ pip install pytest pytest-cov
$ pytest tests/ --cov=canvascli

Currently the canvas and utils modules have 100% code coverage. The parser and the cli modules have only partial coverage but we are working hard on improving this!

Code style

We try to follow PEP8 and use Flake8 to check code style.

To run the code style check you need to install flake8 and run:

$ pip install flake8
$ flake8 canvascli/



0.1.0 (2018-03-18)

  • First release on PyPI.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for canvascli, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size canvascli-0.1.0.tar.gz (23.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page