Skip to main content

functions help for print tabular data

Project description

Printable

Functions help for printing tabular data.

Install

pip3 install printable

Usage Example

from printable import readable, styles
print(readable(list_of_dict, **styles['full']))
$ python -m printable -t csv -f sample.csv
 symbol     desp      last    change   changeper  turnover  changesign  lastupdate
 HSI        恆指      26623   -468     1.73%      802億     -           2018/10/04 16:09
 HSCEI      國指      10547   -239     2.21%      257億     -           2018/10/04 16:08
 000001.SH  上證指數  2821    29       1.06%      1254億    +           2018/09/28 15:10
 000300.SH  滬深 300  3438    35       1.04%      949億     +           2018/09/28 15:10
 USDHKD     港匯      7.8337  -0.0037  -0.0472%             -

$ python -m printable -t csv -f sample.csv --grid inner
 symbol    │ desp     │ last   │ change  │ changeper │ turnover │ changesign │ lastupdate
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
 HSI       │ 恆指     │ 26623  │ -468    │ 1.73%     │ 802億    │ -          │ 2018/10/04 16:09
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
 HSCEI     │ 國指     │ 10547  │ -239    │ 2.21%     │ 257億    │ -          │ 2018/10/04 16:08
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
 000001.SH │ 上證指數 │ 2821   │ 29      │ 1.06%     │ 1254億   │ +          │ 2018/09/28 15:10
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
 000300.SH │ 滬深 300 │ 3438   │ 35      │ 1.04%     │ 949億    │ +          │ 2018/09/28 15:10
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
 USDHKD    │ 港匯     │ 7.8337 │ -0.0037 │ -0.0472%  │          │ -          │

$ python -m printable -t csv -f sample.csv --grid full
┌───────────┬──────────┬────────┬─────────┬───────────┬──────────┬────────────┬──────────────────┐
│ symbol    │ desp     │ last   │ change  │ changeper │ turnover │ changesign │ lastupdate       │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ HSI       │ 恆指     │ 26623  │ -468    │ 1.73%     │ 802億    │ -          │ 2018/10/04 16:09 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ HSCEI     │ 國指     │ 10547  │ -239    │ 2.21%     │ 257億    │ -          │ 2018/10/04 16:08 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ 000001.SH │ 上證指數 │ 2821   │ 29      │ 1.06%     │ 1254億   │ +          │ 2018/09/28 15:10 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ 000300.SH │ 滬深 300 │ 3438   │ 35      │ 1.04%     │ 949億    │ +          │ 2018/09/28 15:10 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ USDHKD    │ 港匯     │ 7.8337 │ -0.0037 │ -0.0472%  │          │ -          │                  │
└───────────┴──────────┴────────┴─────────┴───────────┴──────────┴────────────┴──────────────────┘

$ python -m printable -t csv -f sample.csv --grid markdown
| symbol    | desp     | last   | change  | changeper | turnover | changesign | lastupdate       |
|-----------|----------|--------|---------|-----------|----------|------------|------------------|
| HSI       | 恆指     | 26623  | -468    | 1.73%     | 802億    | -          | 2018/10/04 16:09 |
| HSCEI     | 國指     | 10547  | -239    | 2.21%     | 257億    | -          | 2018/10/04 16:08 |
| 000001.SH | 上證指數 | 2821   | 29      | 1.06%     | 1254億   | +          | 2018/09/28 15:10 |
| 000300.SH | 滬深 300 | 3438   | 35      | 1.04%     | 949億    | +          | 2018/09/28 15:10 |
| USDHKD    | 港匯     | 7.8337 | -0.0037 | -0.0472%  |          | -          |                  |

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

printable-0.3.7.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

printable-0.3.7-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file printable-0.3.7.tar.gz.

File metadata

  • Download URL: printable-0.3.7.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for printable-0.3.7.tar.gz
Algorithm Hash digest
SHA256 749634c9b57f71d694d5d961e046caa241e8c5acbd11828b48d1a0220efe353e
MD5 30b3f25647b2117b6ed2dcdd1ba4eb70
BLAKE2b-256 86cbcee27af091887a2d91cb3a8648b09a813c6f1baff68fd59b77b77b5f7383

See more details on using hashes here.

File details

Details for the file printable-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: printable-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for printable-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 26c339688d9c96775623daf40cc28443932b5a5e1eadf1ef77b508a752b46d1b
MD5 9e9d4ce5db1d659c6f2916386cca70d5
BLAKE2b-256 52fdf01272004bc2189f9b8f6859ffbdc1eec80bcf7fbc4df76f675f27b5ff34

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