Skip to main content

This is a versatile and user-friendly Python table library that can quickly render any Dictionary{key, []} or DataFrame into a visually appealing markdown or sql insert

Project description

tablepy Lib

This is a versatile and user-friendly Python table library that can quickly render any Dictionary{key, []} or DataFrame into a visually appealing markdown or sql insert

Download Stats

https://pypistats.org/packages/tablepy-lib

Notebook for testing

https://github.com/JordiCorbilla/tablepy-lib/blob/main/Test%20Package.ipynb

Usage: Output as Markdown/console

from tablepy_lib import markdown

data = {
    "Name": ["John", "Emily", "Tom", "JC"],
    "Age": [-28, 3002.6, 25, 2],
    "Country": ["USA", "Canada", "UK", "DE"],
    "Data": ["USA", "Canada", "UK", "3434243"]
}

table = markdown(data)
print(table)    

Sample output:

| Name    | Age      | Country   | Data      | 
| ------- | -------- | --------- | --------- | 
| John    | -28.0    | USA       | USA       | 
| Emily   | 3002.6   | Canada    | Canada    | 
| Tom     | 25.0     | UK        | UK        | 
| JC      | 2.0      | DE        | 3434243   | 
Name Age Country Data
John -28.0 USA USA
Emily 3002.6 Canada Canada
Tom 25.0 UK UK
JC 2.0 DE 3434243

Usage: Output as SQL Insert

from tablepy_lib import sql_insert

data = {
    "Name": ["John", "Emily", "Tom", "JC"],
    "Age": [-28, 3002.6, 25, 2],
    "Country": ["USA", "Canada", "UK", "DE"],
    "Data": ["USA", "Canada", "UK", "3434243"]
}

data_frame = pd.DataFrame(data)
table = sql_insert(data_frame, 'dd')
print(table)

Sample output:

INSERT INTO dd (Name, Age, Country, Data) VALUES ('John', -28.0, 'USA', 'USA');
INSERT INTO dd (Name, Age, Country, Data) VALUES ('Emily', 3002.6, 'Canada', 'Canada');
INSERT INTO dd (Name, Age, Country, Data) VALUES ('Tom', 25.0, 'UK', 'UK');
INSERT INTO dd (Name, Age, Country, Data) VALUES ('JC', 2.0, 'DE', 3434243);

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

tablepy_lib-0.8.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

tablepy_lib-0.8.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file tablepy_lib-0.8.0.tar.gz.

File metadata

  • Download URL: tablepy_lib-0.8.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.9.7 Windows/10

File hashes

Hashes for tablepy_lib-0.8.0.tar.gz
Algorithm Hash digest
SHA256 db1ac0353b6ab7fdd9d6f997f2e8dbbd4193bee95f66321f0ebba7697e9df474
MD5 a494a962ea3761cfe57f553832d3cc79
BLAKE2b-256 ce2bd5ad72a520ae4756b5e08b1e22a607c2dbd3c3ca73824a6814871d82027b

See more details on using hashes here.

File details

Details for the file tablepy_lib-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: tablepy_lib-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.9.7 Windows/10

File hashes

Hashes for tablepy_lib-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b304bfa6f681943022e07af3cfaa0ece6e07daea49432f0da82b677073187a6
MD5 0936f41e3425587dc0f2b37f8e31dbfc
BLAKE2b-256 0e1cb625e7ea54ce9d452116a844391cb592319d9bc9fed79012f3153933458e

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