Skip to main content

Tremshape is a minimalistic Python packgage, that only prints basic shapes on terminal.

Project description

PyPI version fury.io codecov Tests

termshape

Termshape is a minimalistic Python package, that only prints basic shapes on terminal. It does not have any dependencies.

You're welcome to add any shapes!

Installation

pip install termshape

Explain:

The get_* functions has (x,y) ranges, and some equations and print the lines.

Example:

from termshape import get_square
print(get_square(5,5))

so: x-range is between 0 and 4 y-range is between 0 and 4 and the equations are: x=0, y=0, x=5 and y=5.

See below the output.

Usage

  • Print a square:
from termshape import get_square
print(get_square(5))
* * * * *
*       *
*       *
*       *
* * * * *
  • Print a rectangle:
from termshape import get_rectangle 
print(get_rectangle(10,5))
* * * * * * * * * *
*                 *
*                 *
*                 *
* * * * * * * * * *
  • Print a circle:
from termshape import get_circle
print(get_circle(10))
                  * * * * *                
              *               *            
          *                       *        
        *                           *      
      *                               *    

    *                                   *  

  *                                       *
  *                                       *
  *                                       *
  *                                       *
  *                                       *

    *                                   *  

      *                               *    
        *                           *      
          *                       *        
              *               *            
                  * * * * *                
  • Print a triangle:
from termshape import get_triangular
print(get_triangular(10))
*                  
* *                
*   *              
*     *            
*       *          
*         *        
*           *      
*             *    
*               *  
* * * * * * * * * *
  • Print a shape with custom character:
from termshape import get_rectangle
print(get_rectangle(10,5,'$'))
$ $ $ $ $ $ $ $ $ $
$                 $
$                 $
$                 $
$ $ $ $ $ $ $ $ $ $
  • Print a shape with background:
from termshape import get_rectangle
print(get_square(10,bgc='.'))
* * * * * * * * * *
* . . . . . . . . *
* . . . . . . . . *
* . . . . . . . . *
* . . . . . . . . *
* . . . . . . . . *
* . . . . . . . . *
* . . . . . . . . *
* . . . . . . . . *
* * * * * * * * * *

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

termshape-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

termshape-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file termshape-1.0.0.tar.gz.

File metadata

  • Download URL: termshape-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for termshape-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2cfa0bd64fbac0fc54c7257ecd07a295294b2f2e22c04ab375d46aa3adb9a530
MD5 8fa1f1cf28b84c183a92f4c119643584
BLAKE2b-256 ea7c35f75415ac5cc995ace468c63bb25040e84215d21c00008bb3c4943f923d

See more details on using hashes here.

File details

Details for the file termshape-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: termshape-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for termshape-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b61db2bc682b632ecdbdf3c851cfdb1cb1593586cc81ec33018dac8874e5a04c
MD5 d5cef97bdd2a323123060f9feec5d322
BLAKE2b-256 e3033fe8955cc3a8f14bbd94553283e6e7b9aa2963653650626736c2f21a1cdd

See more details on using hashes here.

Supported by

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