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()
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.
Release files for fstrent-charts 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fstrent_charts-1.1.0.tar.gz | 87.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fstrent_charts-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 176.3 kB
Release files / fstrent_charts-1.1.0.tar.gz
| Download URL | fstrent_charts-1.1.0.tar.gz |
|---|---|
| Size | 87.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5430ca8d8c007812367f5faeef959a10b4041e204a99a7d7221b03781d2789d5
|
|
BLAKE2b-256 checksum How to use checksums |
9187647aa1b528637a5c667927c1adcf50939df0abb5dde4fa9a28ceca262ba2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / fstrent_charts-1.1.0-py3-none-any.whl
| Download URL | fstrent_charts-1.1.0-py3-none-any.whl |
|---|---|
| Size | 89.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f6c35c03b6879ff7828e151e3d74ce399ea00c2692503c016fb765f901b0b75
|
|
BLAKE2b-256 checksum How to use checksums |
972464170abfc6f33b893024efe34476d638247dc48b157ce0d4838cbacd2aaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|