Dispositio Logo

Dispositio - Script Shell POSIX

POSIX Shell Tabular Data Display

Dispositio - Résumé du Projet Shell POSIX

Dispositio is a POSIX-compliant shell script designed for displaying tabular data from CSV, JSON, and YAML files in the terminal. It offers advanced formatting, color support, and can be used as a standalone command-line tool or as a shell library for programmatic table generation. Key features include multiple input/output formats (Terminal, Markdown, Textile), rich terminal output with customizable alignment and styling, header support, and intelligent color mixing. It depends on jq, yq, and auxilium.sh.

Fonctionnalités - Script Shell Données Tabulaires

Multiple Input Formats

Support for CSV, JSON, and YAML files.

Library Usage

Can be sourced and used programmatically with dispositio_add_* functions.

Colorized Output

Colored table output with customizable alignment options.

Output Formats

Terminal display, Markdown (with CSS, not for Github) and Textile (Redmine) output formats.

Advanced Formatting

  • Multi-line cell content support
  • Column and row color customization
  • Text alignment (left, center, right)
  • Vertical alignment (top, center, bottom)
  • Text styling (bold, italic, underline)

Header Support

Optional header processing for CSV files.

Color Mixing

Intelligent color combination for row and column intersections.

POSIX Compliance

Works across different Unix-like systems.

Installation Dispositio - Script Shell POSIX

Installation
$ # Ensure you have the required dependencies:
$ # jq for JSON processing
$ # yq for YAML processing
$ # auxilium.sh library (should be available at /usr/share/auxilium/auxilium.sh)
$ # Download from: https://codeberg.org/spn109/auxilium
$ 
$ # Make the script executable:
$ chmod +x dispositio.sh
$ 
$ # Optionally, create a symlink or copy to a directory in your PATH:
$ ln -s /path/to/dispositio.sh /usr/local/bin/dispositio

Utilisation - Guide Dispositio Shell

Command Line Usage

Basic Usage

Basic Usage
$ ./dispositio.sh [OPTIONS] 

Command Line Options

  • -H, --with_header: Treat the first line of CSV as column headers
  • -s, --noseparate: Disable separator lines between rows
  • -m, --markdown: Output in Markdown format
  • -t, --textile: Output in Textile format
  • file: Input file path (required)

Examples

Display a CSV file with headers
CSV Example
$ ./dispositio.sh -H examples/example.csv
Export to Markdown format
Markdown Export Example
$ ./dispositio.sh -m examples/example.json > output.md
Display a YAML file
YAML Example
$ ./dispositio.sh examples/example.yml

Library Usage

Dispositio can be sourced and used as a library to programmatically create tables in your shell scripts.

Basic Library Setup

Library Setup
#!/bin/bash

# Source the dispositio library
. ./dispositio.sh

# Initialize dispositio
dispositio_init

# Create your table programmatically
# ... (see examples below)

# Clean up
dispositio_close

Dispositio - Script Shell POSIX

Affichage de Données Tabulaires Shell POSIX

Dispositio - Résumé Script Shell POSIX

Dispositio est un script shell conforme à POSIX conçu pour afficher des données tabulaires provenant de fichiers CSV, JSON et YAML dans le terminal. Il offre un formatage avancé, un support des couleurs, et peut être utilisé comme un outil en ligne de commande autonome ou comme une bibliothèque shell pour la génération programmatique de tableaux. Ses principales caractéristiques incluent la prise en charge de multiples formats d'entrée/sortie (Terminal, Markdown, Textile), une sortie terminale riche avec alignement et style personnalisables, la gestion des en-têtes et un mélange intelligent des couleurs. Il dépend de jq, yq et auxilium.sh.

Fonctionnalités Script Shell Données Tabulaires

Formats d'Entrée Multiples

Support des fichiers CSV, JSON et YAML.

Utilisation en Bibliothèque

Peut être sourcé et utilisé de manière programmatique avec les fonctions dispositio_add_*.

Sortie colorisée

Sortie de tableau colorée avec options d'alignement personnalisables.

Formats de sortie

Affichage terminal, formats de sortie Markdown (avec CSS donc non-compatible Github) et Textile (Redmine).

Formatage Avancé

  • Support du contenu de cellule multi-lignes
  • Personnalisation des couleurs de colonnes et de lignes
  • Alignement du texte (gauche, centre, droite)
  • Alignement vertical (haut, centre, bas)
  • Style de texte (gras, italique, souligné)

Support des En-têtes

Traitement optionnel des en-têtes pour les fichiers CSV.

Mélange de Couleurs

Combinaison intelligente des couleurs pour les intersections de lignes et de colonnes.

Conformité POSIX

Fonctionne sur différents systèmes de type Unix.

Installation Dispositio Shell POSIX

Installation
$ # Assurez-vous d'avoir les dépendances requises :
$ # jq pour le traitement JSON
$ # yq pour le traitement YAML
$ # bibliothèque auxilium.sh (devrait être disponible à /usr/share/auxilium/auxilium.sh)
$ # Télécharger depuis : https://codeberg.org/spn109/auxilium
$ 
$ # Rendre le script exécutable :
$ chmod +x dispositio.sh
$ 
$ # Optionnellement, créer un lien symbolique ou copier vers un répertoire dans votre PATH :
$ ln -s /chemin/vers/dispositio.sh /usr/local/bin/dispositio

Guide Utilisation Dispositio Shell

Utilisation en Ligne de Commande

Utilisation Basique

Utilisation Basique
$ ./dispositio.sh [OPTIONS] 

Options en Ligne de Commande

  • -H, --with_header: Traiter la première ligne du CSV comme en-têtes de colonne
  • -s, --noseparate: Désactiver les lignes de séparation entre les lignes
  • -m, --markdown: Sortie au format Markdown
  • -t, --textile: Sortie au format Textile
  • fichier: Chemin du fichier d'entrée (requis)

Exemples

Afficher un fichier CSV avec en-têtes
Exemple CSV
$ ./dispositio.sh -H examples/example.csv
Exporter au format Markdown
Exemple d'Exportation Markdown
$ ./dispositio.sh -m examples/example.json > output.md
Afficher un fichier YAML
Exemple YAML
$ ./dispositio.sh examples/example.yml

Utilisation en Bibliothèque

Dispositio peut être sourcé et utilisé comme une bibliothèque pour créer des tableaux de manière programmatique dans vos scripts shell.

Configuration de Base de la Bibliothèque

Configuration de la Bibliothèque
#!/bin/bash

# Sourcer la bibliothèque dispositio
. ./dispositio.sh

# Initialiser dispositio
dispositio_init

# Créer votre tableau de manière programmatique
# ... (voir exemples ci-dessous)

# Nettoyage
dispositio_close