Canva-like library for terminal
Project description
Canvalib
by danb1551
Canvalib is library for window with diferent text and backround color in your terminal.
show video
Installation
pip install canvalib
Usage
Import library
from canvalib import Canvas
Create object:
c = Canvas(width, height, background, color)
All parameters is optional. If you are strugelling why WIDTH and HEIGHT are in default without maked with - 1 then it's because if not, it will do something strange even I don't know why.
WIDTH: default to terminal width - 1. If you add more than default (it depend on your terminal size) it will not work properly.
HEIGHT: default to terminal height - 1. If you add more than default (it depend on your terminal size) it will not work properly.
BACKGROUND: default to Back.BLACK. If you want to change it import Back from colorama and give Back.color to your char or string.
COLOR: default to Fore.GREEN. If you want to change it import Fore from colorama and give Fore.color to your char or string.
Add text to your canvas:
c.add_text(x, y, text, color, background)
X: row of the canvas where your text will be. Notice that it's starting from 0 index.
Y: column of the canvas where your text will be. Notice that it's starting from 0 index.
TEXT: whatever you want
COLOR: default to self.color. Must be Fore.color or escape sequence that setting text color
BACKGROUND: default to self.background. Must be Back.color or escape sequence that setting background color
Render it:
c.render()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file canvalib-0.0.7.tar.gz.
File metadata
- Download URL: canvalib-0.0.7.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49aaebd06eb34432553acad3bc53a63643f8462f93634cc0160adc772bdeb32f
|
|
| MD5 |
fff544c980263f2d2859d336ba1de105
|
|
| BLAKE2b-256 |
64b2a93d884c75070d9b1daf4534a5a41e4eaba70ac958839a6b30380e979d75
|
File details
Details for the file canvalib-0.0.7-py3-none-any.whl.
File metadata
- Download URL: canvalib-0.0.7-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25fce5768674cea0ef4fecb9acaa38f5aef84b178acec2403aa4ae714cf77ad4
|
|
| MD5 |
94c3c518bec54c119329fdd3da75bb81
|
|
| BLAKE2b-256 |
7f298100f49a059be524c0d0f7301ce6efe4d839cb6f66211bf7489539a6afba
|