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_str
length = 2000
result = tableparse.tablify_str(array, length)
Returns a list of strings containing a table split in the 'length' characters
inv_array
inv_array = tableparse.inv_array(array)
result = tableparse.tablify(inv_array)
Flips an array's columns and rows
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.5.tar.gz
(3.5 kB
view details)
File details
Details for the file tableparse-0.5.tar.gz.
File metadata
- Download URL: tableparse-0.5.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d746b5e53d3effba60245820cb46be33f445e184a47b0748784d1aa780787812
|
|
| MD5 |
82c9b73834b115b429b2865cb7dd4e85
|
|
| BLAKE2b-256 |
c1340cc63fb46181c44d29cca1e50b88450a14e5db9d316ba399b0b9e7da570d
|