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

Usage - Markdown

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

formatter = consoleFormatter(data)
table = formatter.to_table()
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   | 

Usage - SQL Insert

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

table = consoleFormatter(data_frame).to_sql('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.5.0.tar.gz (3.1 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.5.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tablepy_lib-0.5.0.tar.gz
  • Upload date:
  • Size: 3.1 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.5.0.tar.gz
Algorithm Hash digest
SHA256 3ae644129f970caf5986b85fd638f5edd1c6ccd9e3043e062642291a80d0f880
MD5 a85a0712f2b24c5adf81cd8ed718ae7a
BLAKE2b-256 d5be70df2c578cc1c9c4795c78f4d7cfb93f5ed970a79e73c71ad6a9c9397934

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tablepy_lib-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 514fa0c549b8965c168e3da0f30ede832a5f14a0e7eda3b99e46951d36ebafc9
MD5 dc4ed65bec341971aaa1d4d6bdc5c3f9
BLAKE2b-256 7e3f877ca6fe8e584b4018c5911ebe1c38af4cb64666b4bc8dd7f82cfd835426

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