This is a versatile and user-friendly Python table library that can quickly render any Dictionary<TV, T> 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.4.0.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tablepy_lib-0.4.0.tar.gz.
File metadata
- Download URL: tablepy_lib-0.4.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a4682483c039b3791d6f03b3ecff81cbea4e47aa5de7c7b4fb7f1b3813c5542
|
|
| MD5 |
4c73fdb8ad7a85831879c593d1eb3cca
|
|
| BLAKE2b-256 |
16f0aea85751a070b061db03fd718d8c92e7a740c562029b3374e3bf0caec305
|
File details
Details for the file tablepy_lib-0.4.0-py3-none-any.whl.
File metadata
- Download URL: tablepy_lib-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.9.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7277b6633068fe657695341d63d513e6e93d348b839368863083a1fa549210a
|
|
| MD5 |
a05adc307f3b672702c1c1f11f87a148
|
|
| BLAKE2b-256 |
d7f8215f8217fa733a9bcb945fae1be5648b3c1f5fad06c137d402af1866d6e1
|