Skip to main content

A stand alone package for making string tables from 2D string arrays

Project description

Tableparse


A stand alone library which parses an array and a set of headers into a text based table

Features

  • tableparse.tablify(2D array of strings) Takes a 2D array of strings and returns a string containing the table

e.g.

>>> array = [
>>> ["Title", "Description"],
>>> ["Macbeth", "A play by Shakespear"]
>>> ]

>>> print(tableparse.tablify(array))
╔═══════╦═════════════════════╗
║Title  ║Description          ║
╠═══════╬═════════════════════╣
║Macbeth║A play by Shakespeare║
╚═══════╩═════════════════════╝

Usage

import tableparse

array = [
    ["Name", "Description", "URL"],
    ["TableParse", "A stand alone table generators", "https://github.com/TommyGymer/Tableparse"],
    ["JSChess", "A stand alone JS chess implementation", "https://github.com/TommyGymer/JS-Chess"],
    ["Dijkstra Pathfinding", "An implementation of Dijkstra's pathfinding algorithm", "https://github.com/TommyGymer/Dijkstra-pathfinding"]
]

result = tableparse.tablify(array)

tablify

Turns a 2D array into a table string

Tablify

tablify_str

length = 2000
result = tableparse.tablify_str(array, length)

Returns a list of strings containing a table split in the 'length' characters

Tablify_str

inv_array

inv_array = tableparse.inv_array(array)

result = tableparse.tablify(inv_array)

Flips an array's columns and rows

array inverse

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

TableParse-0.3.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file TableParse-0.3.tar.gz.

File metadata

  • Download URL: TableParse-0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.1

File hashes

Hashes for TableParse-0.3.tar.gz
Algorithm Hash digest
SHA256 4ab19f743077ca2e02a77ef66cf6334d426f4564f8054567dc1b4dafc5bbce2b
MD5 57f470b1b3c76ac429bbfac8e7291ad0
BLAKE2b-256 c8e9d151f49e821ec84ceb22cb1666da3381f5c105a88452a789ee29899c5beb

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