Skip to main content

Python library to print tables and line charts in Terminal.

Project description

outfancy

Table printing and Line plotting in Terminal

What is it?

Outfancy is a Python library for printing tables and charts in the terminal. It's a quick way to visualize data when you don't have a GUI, and it integrates easily into your programs. You can install it with uv or pip and use it anywhere.

This was the first library I ever built when I was 16 :). It's been modernized to support Python 3.10+, fix bugs, add type hints, improve logging, and enhance performance, but the original style is still there: raw, exploratory teenage code.

Documentation

Installation

Install with uv

pip install outfancy

Install with pip

pip install outfancy

Features

  • Quick table printing - Print formatted tables in the terminal with automatic column width detection
  • LineChart plotting - Create line charts with linear interpolation
  • Customizable formatting - Configure separators, widths, and column priorities
  • Real-time column rearrangement - Dynamically reorder columns
  • Auto-generated labels - Automatic label creation above tables
  • Oneline printing - Single-line updates for real-time applications
  • Color support - Add ANSI colors to table fields
  • Type hints - Full type annotation support for better IDE integration
  • Configurable logging - Flexible logging system with multiple severity levels
  • Data type auto-detection - Automatic detection of ID, name, date, time, value, and description columns

Quick Start

Basic Table

import outfancy.table

table = outfancy.table.Table()
dataset = [(1, 'Marie'), (2, 'Joseph')]
print(table.render(dataset))

Line Chart

import outfancy.chart
from math import sin

line_chart = outfancy.chart.LineChart()
dataset = [(i, sin(i)) for i in range(10)]
line_chart.plot(dataset)
print(line_chart.render(color=True))

Large Table with Pagination

from outfancy.table import LargeTable

large_table = LargeTable()
large_dataset = [(i, f'User {i}', f'user{i}@example.com') for i in range(100)]
print(large_table.render(large_dataset))

Empty State Customization

from outfancy.table import Table, LargeTable

t = Table()
t.set_empty_string('No data available')

lt = LargeTable()
lt.set_empty_string('No data available')

This sets the string displayed when a table cell has no value.

Development

Development installation (pip)

git clone https://github.com/carlosplanchon/outfancy.git
cd outfancy
pip install -e .

Development installation (uv)

git clone https://github.com/carlosplanchon/outfancy.git
cd outfancy
uv venv
uv pip install -e ".[dev]"

Running tests

The project includes a comprehensive test suite covering all major functionality:

# Run all tests
pytest

# Run with verbose output
pytest -v

# Run specific test file
pytest tests/test_table.py

# Run tests with coverage
pytest --cov=outfancy

The test suite includes:

  • 79 test functions covering Table, Oneline, and LargeTable classes
  • Unit tests for initialization, configuration, and rendering
  • Integration tests for complex workflows
  • Regression tests for documented bug fixes
  • Edge case validation for data integrity

Logging Configuration

Outfancy uses a configurable logging system. By default, only WARNING and above messages are shown:

import logging
import outfancy.table

# Enable debug logging
logging.getLogger('outfancy').setLevel(logging.DEBUG)

# Create table with debug output
table = outfancy.table.Table()

See LOGGING.md for detailed logging configuration options.

Contributing

Contributions are welcome! Here's how you can help:

  1. Report bugs - Open an issue describing the problem
  2. Suggest features - Share your ideas for improvements
  3. Submit pull requests - Fix bugs or implement features
  4. Improve documentation - Help make the docs clearer
  5. Write tests - Add test coverage for edge cases

Code style

  • Follow existing code patterns
  • Add type hints to new functions
  • Include tests for new features
  • Update documentation as needed

Examples & Demos

Line Chart Example

License

MIT License - see LICENSE file for details

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

outfancy-0.9.8.tar.gz (30.7 kB view details)

Uploaded Source

Built Distribution

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

outfancy-0.9.8-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file outfancy-0.9.8.tar.gz.

File metadata

  • Download URL: outfancy-0.9.8.tar.gz
  • Upload date:
  • Size: 30.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for outfancy-0.9.8.tar.gz
Algorithm Hash digest
SHA256 e24ae333e9a9c9d603e8ca9daf128cda9f780d3fc0c1fc7fbb2f1d230bd3add4
MD5 a81070c573d2f95eb22f309ee42b993b
BLAKE2b-256 0c34d9171cc782ca24757bdaeda802ad79fddaa2b3b8f869fdebdd297f1ff925

See more details on using hashes here.

File details

Details for the file outfancy-0.9.8-py3-none-any.whl.

File metadata

  • Download URL: outfancy-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for outfancy-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c6ed486e7d035745796d8e81a1d44d338fd5d6c372e8109186609c7f93c67def
MD5 1fde6eb66198eb086a1cded12d742ff5
BLAKE2b-256 dc626ef92698c00b3a7873a958d6ae9f0b4b22a06d376ec1ab8032e02e965f2e

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