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

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"]
}

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.6.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.6.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tablepy_lib-0.6.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.6.0.tar.gz
Algorithm Hash digest
SHA256 ba25904e16dfc82bc849f77b59c2c504398650abe148b0798e2abe5dc40fec26
MD5 409c13f581fec755201d916d8fd9036f
BLAKE2b-256 03f93256d260d919cef08d902dbe1e731bea01dcb4a38b84864f023be2c855f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tablepy_lib-0.6.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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 247f1eee4dc20e50c4ab956b5ede440aaa5ad23692d9b12c158d5d8ccc2d549b
MD5 e083796ea58a51705112beabe18314ae
BLAKE2b-256 a2b1620049b1f754579387b27bea2a5d8660ef42481bd6ceb64f12d0a3817e14

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