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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cli-grid-0.0.1.tar.gz.

File metadata

  • Download URL: cli-grid-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for cli-grid-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8fee1db0c5302fd5280f08be443ef288b2f22a05def823e2c2e0e192ec6eb750
MD5 a6f91d6909f5f0b389acb485f1562c8a
BLAKE2b-256 322cf3656ec263269c08dc9458689761a56787e94e0324afdba4bb3816b2ea53

See more details on using hashes here.

File details

Details for the file cli_grid-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cli_grid-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for cli_grid-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09d19467a7f2c88209a5f22e42581fee6219704ef744c6fbe7357530e83302de
MD5 f6cafb6b925d97c834e93f2c07f5dbff
BLAKE2b-256 ebb0a91503f1271bb043ff5d760606590687f9986e55b233687a93517a109178

See more details on using hashes here.

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