Color Chart options for terminal output
Project description
FSTrent Colors and Charts
Enhanced terminal color and charting library providing extensive color combinations, charting utilities, and demos for Python applications.
Features
- 🎨 16 Base colors (including light variants)
- 📊 Charting utilities for terminal display
- 🖼️ Background colors for all combinations
- 🌈 Color on color support (e.g., red text on blue background)
- 🛠️ Utility functions for string coloring
- 📝 Simple API for color and chart manipulation
- 🔧 Cross-platform support via colorama
Installation
pip install fstrent_charts
Basic Usage
from fstrent_charts import (
# Utility functions
cs, cp,
# Basic colors
R, G, B, W # Red, Green, Blue, White
)
# Print colored text
cp("This is red text", R)
cp("This is green text", G)
cp("This is blue text", B)
# Create colored strings
colored_text = cs("Custom colored text", B)
print(colored_text)
Charting with FSTrent Charts
The fstrent_charts library provides utilities for creating and displaying charts in the terminal. Below are examples from the demo functions included in the library.
Demo 1: Basic Chart
from fstrent_charts import CHRT
chrt = CHRT()
title = "Basic Chart Example"
chrt.chart_top(in_str=title)
chrt.chart_row(in_str="This is a row in the chart", align='left', font_color='white', bg_color='blue')
chrt.chart_bottom()
Demo 2: Market Collection
from fstrent_charts import CHRT
chrt = CHRT()
title1 = "Sell Market Collection"
subtitle1 = "adding markets with open positions (44) :"
markets1 = [
"POLS-USDC", "SUI-USDC", "POL-USDC", "FLOKI-USDC", "SHIB-USDC"
# ... more markets
]
chrt.chart_top(in_str=title1)
chrt.chart_title(in_str=subtitle1)
for market in markets1:
chrt.chart_row(in_str=market, align='left', font_color='white', bg_color='green')
chrt.chart_bottom()
Demo 3: Opened Positions
from fstrent_charts import CHRT
chrt = CHRT()
title = "Last 25 Opened Positions - Live"
headers = "mkt | T | pos_id | strat | freq | age | open @ est | buy_val | buy_prc | curr_prc | high_prc | gain_pct % | gain_top % | drop_pct % | gain_loss | gain_loss_high"
rows = [
"MOBILE-USDC | | 32919 | drop | 1d | 0 | 12-01-2024 | 3.000000 | 0.00151779| 0.00151400| 0.00151400| -0.20 % | 0.00 % | -0.10 % | 0.00000000 | 0.02360239",
# ... more rows
]
chrt.chart_top(in_str=title)
chrt.chart_headers(in_str=headers)
for row in rows:
chrt.chart_row(in_str=row, align='left', font_color='white', bg_color='black')
chrt.chart_bottom()
Available Colors
Basic Colors
from fstrent_charts import (
K, # Black
R, # Red
G, # Green
Y, # Yellow
B, # Blue
M, # Magenta
C, # Cyan
W, # White
LGy, # Light Gray
DGy, # Dark Gray
LR, # Light Red
LG, # Light Green
LY, # Light Yellow
LB, # Light Blue
LM, # Light Magenta
LC, # Light Cyan
)
Development
- Clone the repository:
git clone https://github.com/wrm3/fstrent_charts.git
cd fstrent_charts
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
License
MIT License - see LICENSE file for details.
Author
Warren R Martel III (wrmartel3@gmail.com)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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 fstrent_charts-1.0.2.tar.gz.
File metadata
- Download URL: fstrent_charts-1.0.2.tar.gz
- Upload date:
- Size: 87.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84c96be39cfafdc13639b96915f6ceb44d3c084b14f26c97278e23167b66daa1
|
|
| MD5 |
0610a8ada21fbbd825e2c531e556c358
|
|
| BLAKE2b-256 |
9d49e65ff280c8ce8d14458bfb861a6a64dfdaec78800b1257d251a05da584c5
|
File details
Details for the file fstrent_charts-1.0.2-py3-none-any.whl.
File metadata
- Download URL: fstrent_charts-1.0.2-py3-none-any.whl
- Upload date:
- Size: 89.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
355c0d676f51f020c667345421868cf12de5dd139fa1a3362dfc67f58017b32c
|
|
| MD5 |
4c02b3eaf32bfd1e3d81f694b322320f
|
|
| BLAKE2b-256 |
3f6013126f2943fe8c800104ac4f9036c64f391614b08fdc43476167c3a3ab01
|