Skip to main content

A simple python package for generating, managing and visualizing grids

Project description

cli-grid

cli-grid is a simple Python package for creating, managing, and visualizing grids.

This library allows you to create a grid with any number of rows and columns. Each cell in the grid can then be accessed and updated. By default, a visual representation of the grid can be displayed, but this can be disabled.

Usage

To start, simply initialize the library like so:

from py_grid import Grid

grid = Grid()

This creates a 3*3 grid by default.

Parameters:

> row(int) => The number of rows
> columns(int) => The number of columns
> no_visual(bool) => Boolean flag to indicate if visualization of the grid is disabled (set to False by default)
> no_border(bool) => Boolean flag to indicate if borders are disabled when visualizing the grid (set to False by default). Note that this will have no effect if `no-viual` is set to True

To get a particular cell:

grid.get_cell(3, 2)

This returns the value of the cell on row 3, column 2 of the grid

To update a particular cell:

grid.update(3, 2, 'X')

This updates the value of the cell on row 3, column 2 of the grid to the string 'X'

To display the grid:

grid.show_grid()

This prints outs a visual reprsentation of the grid and returns the string value of this reepresentation

Project details


Download files

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

Source Distribution

cli-grid-0.0.1.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

cli_grid-0.0.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page