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

Usage - Markdown

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 - 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.7.0.tar.gz (3.2 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.7.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tablepy_lib-0.7.0.tar.gz
  • Upload date:
  • Size: 3.2 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.7.0.tar.gz
Algorithm Hash digest
SHA256 3d884959d2d58e893eef7ec3b0fc4ead4a9df2c41f22f4b6be2be4797e9fd755
MD5 08025105efe86cf91b0f6fd524ae3f6b
BLAKE2b-256 ccf5a9a65ba2d44c0875cd1658d687f9e7447deb1ab627deac3f72201ff246e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tablepy_lib-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 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.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eeef3d87377eb992e17d628f0a607b488672d81f6c8c0c7b99eed81f008b767c
MD5 0931cdb739eda73edc8c1dcb5f14ab7a
BLAKE2b-256 f59b41662e83ab39b30b3b50ef73a53a3fd29e47372da63a2a173c677563aa6f

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