Python script to tabulate data formats like json, csv, html, etc

Related tags

Command-line ToolspyT
Overview

pyT

PyT is a a command line tool and as well a library for visualising various data formats like:

  • JSON
  • HTML Table
  • CSV
  • XML, etc.

Features

  • Print table of any size without distortions.
  • Support multiple file formats.
  • Better presentation of various data structures, types.

Usage

JSON data

{
  "squadName": "Super hero squad",
  "homeTown": "Metro City",
  "formed": 2016,
  "secretBase": "Super tower",
  "active": true,
  "members": [
    {
      "name": "Molecule Man",
      "age": 29,
      "secretIdentity": "Dan Jukes",
      "powers": "Turning tiny"
    },
    {
      "name": "Madame Uppercut",
      "age": 39,
      "secretIdentity": "Jane Wilson",
      "powers": "Million punch"
    },
    {
      "name": "Eternal Flame",
      "age": 1000000,
      "secretIdentity": "Unknown",
      "powers": "Immortality"
    }
  ]
}
import pyT.Table as table
table = Table(*item["members"])
json_table.draw()

JSON file

import pyT.Table as table
json = table.JSON('./tab.json', "members")
json_table = Table(*json)
json_table.draw()

Output

+----------------+----------------+----------------+----------------+
|      name      |      age       | secretIdentity |     powers     |
+----------------+----------------+----------------+----------------+
|  Molecule Man  |       29       |   Dan Jukes    |  Turning tiny  |
+----------------+----------------+----------------+----------------+
|Madame Uppercut |       39       |  Jane Wilson   | Million punch  |
+----------------+----------------+----------------+----------------+
| Eternal Flame  |    1000000     |    Unknown     |  Immortality   |
+----------------+----------------+----------------+----------------+

HTML

Name and surname Profession Salary Mobolaji Abdsalam Elect Technician 55,000 Ibraheem Abdsalam Software Engineer 700,000 IBM Abdsalam Elect Engineer 500, 000 Mobolaji Abdsalam Elect. Technician 55, 000 Ibraheem Abdsalam Software Engineer 700, 000 IBM Abdsalam Elect Engineer 500, 000 ">
 <!doctype html>
    <head>
    </head>
    <body>
        <table border = "1" cellpadding = "5" cellspacing = "5">
             <tr>
                <th>Name and surname</th>
                <th>Profession</th>
                <th>Salary</th>
             </tr>
             <tr>
                <td>Mobolaji Abdsalam</td>
                <td>Elect Technician</td>
                <td>55,000</td>
             </tr>
             <tr>
                <td>Ibraheem Abdsalam</td>
                <td>Software Engineer</td>
                <td>700,000</td>
             </tr>
             <tr>
                <td>IBM Abdsalam</td>
                <td>Elect Engineer</td>
                <td>500, 000</td>
             </tr>
             <tr>
                <td>Mobolaji Abdsalam</td>
                <td>Elect. Technician</td>
                <td>55, 000</td>
             </tr>
             <tr>
                <td>Ibraheem Abdsalam</td>
                <td>Software Engineer</td>
                <td>700, 000</td>
             </tr>
             <tr>
                <td>IBM Abdsalam</td>
                <td>Elect Engineer</td>
                <td>500, 000</td>
             </tr>
        </table>
    </body>
</html>

HTML file

import pyT.Table as table
html = table.HTML('./tab.html', n=0)# n specifies which table to be parsed and rendered.
n = 0 => First table on the page.
n = 1 => Second table on the page.
html_table = Table(*html)
html_table.draw()

Output

+------------------+------------------+------------------+
| Name and surname |    Profession    |      Salary      |
+------------------+------------------+------------------+
|Mobolaji Abdsalam | Elect Technician |      55,000      |
+------------------+------------------+------------------+
|Ibraheem Abdsalam |Software Engineer |     700,000      |
+------------------+------------------+------------------+
|   IBM Abdsalam   |  Elect Engineer  |     500, 000     |
+------------------+------------------+------------------+
|Mobolaji Abdsalam |Elect. Technician |     55, 000      |
+------------------+------------------+------------------+
|Ibraheem Abdsalam |Software Engineer |     700, 000     |
+------------------+------------------+------------------+
|   IBM Abdsalam   |  Elect Engineer  |     500, 000     |
+------------------+------------------+------------------+
Owner
Mobolaji Abdulsalam
Mobolaji Abdulsalam
instant coding answers via the command line

howdoi instant coding answers via the command line Sherlock, your neighborhood command-line sloth sleuth. Are you a hack programmer? Do you find yours

Benjamin Gleitzman 9.8k Jan 08, 2023
A powerful, colorful, beautiful command-line-interface for pypi.org

pypi-command-line pypi-command-line is a colorful, powerful, and beautiful command line interface for pypi.org that is actively maintained Detailed Do

Wasi Master 32 Jun 23, 2022
Tncli - TON smart contract command line interface

Tncli TON smart contract command line interface State Not working, in active dev

Disintar IO 100 Dec 18, 2022
🌈 Beautify your command line interfaces.

Basics Install: pip install iridi Usage: import iridi # Create gradient text # iridi.print(message, colors, options) # Ask for input with gradient

Conrad Crawford 39 Oct 20, 2022
Management commands to help backup and restore your project database and media files

Django Database Backup This Django application provides management commands to help backup and restore your project database and media files with vari

687 Jan 04, 2023
A Command Line Error Parser Built using Python.

"Stalk Overflow with debuggy" Error Parser Everything is done in Python so it's extremely easy to install and use. Supports Python 3. Debuggy is used

Derhnyel 22 Nov 10, 2022
Simple script to download OTA packages from Realme's endpoint.

Realme OTA Downloader CLI tool (based on this C# program) to create requests to the Realme's endpoint. Requirements Python 3.9. pycryptodome. Installa

Roger Ortiz 64 Dec 28, 2022
A 3D engine powered by ASCII art

3D engine powered by ASCII art

Lingdong Huang 48 Nov 16, 2022
📦 A command line utility to put text in a box.

boxie A command line utility to put text in a box. Installation pip install boxie If you are on Linux you may need to use sudo to access this globally

Eliaz Bobadilla 10 Jun 30, 2022
GDBIGtools: A command line tools for GDBIG varaints browser

GDBIGtools: A command line tools for GDBIG varaints browser Introduction Born in Guangzhou Cohort Study Genome Research Database is based on thousands

广州市出生队列基因组学研究(The genomics study of BIGCS) 7 Sep 14, 2022
A simple command line tool for changing the icons of folders or files on MacOS.

Mac OS File Icon Changer Description A small and simple script to quickly change large amounts or a few files and folders icons to easily customize th

Eroxl 3 Jan 02, 2023
A linux-like remote terminal for Micropython

A linux-like remote terminal for Micropython

Christian Köver - Draxl 2 Nov 14, 2021
A Julia library for solving Wordle puzzles.

Wordle.jl A Julia library for solving Wordle puzzles. Usage julia import Wordle: play julia play("panic") 4 julia play("panic", verbose = true) I

John Myles White 3 Jan 23, 2022
tiptop is a command-line system monitoring tool in the spirit of top.

Command-line system monitoring. tiptop is a command-line system monitoring tool in the spirit of top. It displays various interesting system stats, gr

Nico Schlömer 1.3k Jan 08, 2023
A user-friendly python CLI for Fmask 4.3 software (GERS Lab, UCONN).

pyFmask What is pyFmask pyFmask is a user-friendly python CLI for Fmask 4.3 software (GERS Lab, UCONN; https://github.com/GERSL/Fmask). Fmask (Zhu et

1 Jan 05, 2022
Kubernetes shell: An integrated shell for working with the Kubernetes

kube-shell Kube-shell: An integrated shell for working with the Kubernetes CLI Under the hood kube-shell still calls kubectl. Kube-shell aims to provi

CloudNative Labs 2.2k Jan 08, 2023
A simple terminal-based localhost chat application written in python

Chat House A simple terminal-based localhost chat application written in python How to Use? Clone the repo git clone https://github.com/heksadecimal/c

Heks 10 Nov 09, 2021
This is a repository for collecting global custom management extensions for the Django Framework.

Django Extensions Django Extensions is a collection of custom extensions for the Django Framework. Getting Started The easiest way to figure out what

Django Extensions 6k Jan 03, 2023
A cli tool , which shows you all the next possible words you can guess from in the game of Wordle.

wordle-helper A cli tool , which shows you all the next possible words you can guess from the Game Wordle. This repo has the code discussed in the You

1 Jan 17, 2022
Loading animation; a progress bar

Loading animation; a progress bar. When you know the remaining time or task completion percentage, then you’re able to show an animated progress bar:

Goldy 1 Jan 23, 2022