functions help for print tabular data
Project description
# Printable
Functions help for printing tabular data.
## Install
`pip3 install printable`
## Usage Example
```python
from printable import readable, styles
print(readable(list_of_dict, **styles['full']))
```
```
$ printable -f x.json
symbol desp last change changeper turnover changesign lastupdate
HSI 恆指 26,623 -468 1.73% 802億 - 2018/10/04 16:09
HSCEI 國指 10,547 -239 2.21% 257億 - 2018/10/04 16:08
000001.SH 上證指數 2,821 29 1.06% 1,254億 + 2018/09/28 15:10
000300.SH 滬深 300 3,438 35 1.04% 949億 + 2018/09/28 15:10
USDHKD 港匯 7.8337 -0.0037 -0.0472% -
$ printable -f x.json --grid inner
symbol │ desp │ last │ change │ changeper │ turnover │ changesign │ lastupdate
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
HSI │ 恆指 │ 26,623 │ -468 │ 1.73% │ 802億 │ - │ 2018/10/04 16:09
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
HSCEI │ 國指 │ 10,547 │ -239 │ 2.21% │ 257億 │ - │ 2018/10/04 16:08
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
000001.SH │ 上證指數 │ 2,821 │ 29 │ 1.06% │ 1,254億 │ + │ 2018/09/28 15:10
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
000300.SH │ 滬深 300 │ 3,438 │ 35 │ 1.04% │ 949億 │ + │ 2018/09/28 15:10
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
USDHKD │ 港匯 │ 7.8337 │ -0.0037 │ -0.0472% │ │ - │
$ printable -f x.json --grid full
┌───────────┬──────────┬────────┬─────────┬───────────┬──────────┬────────────┬──────────────────┐
│ symbol │ desp │ last │ change │ changeper │ turnover │ changesign │ lastupdate │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ HSI │ 恆指 │ 26,623 │ -468 │ 1.73% │ 802億 │ - │ 2018/10/04 16:09 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ HSCEI │ 國指 │ 10,547 │ -239 │ 2.21% │ 257億 │ - │ 2018/10/04 16:08 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ 000001.SH │ 上證指數 │ 2,821 │ 29 │ 1.06% │ 1,254億 │ + │ 2018/09/28 15:10 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ 000300.SH │ 滬深 300 │ 3,438 │ 35 │ 1.04% │ 949億 │ + │ 2018/09/28 15:10 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ USDHKD │ 港匯 │ 7.8337 │ -0.0037 │ -0.0472% │ │ - │ │
└───────────┴──────────┴────────┴─────────┴───────────┴──────────┴────────────┴──────────────────┘
```
Functions help for printing tabular data.
## Install
`pip3 install printable`
## Usage Example
```python
from printable import readable, styles
print(readable(list_of_dict, **styles['full']))
```
```
$ printable -f x.json
symbol desp last change changeper turnover changesign lastupdate
HSI 恆指 26,623 -468 1.73% 802億 - 2018/10/04 16:09
HSCEI 國指 10,547 -239 2.21% 257億 - 2018/10/04 16:08
000001.SH 上證指數 2,821 29 1.06% 1,254億 + 2018/09/28 15:10
000300.SH 滬深 300 3,438 35 1.04% 949億 + 2018/09/28 15:10
USDHKD 港匯 7.8337 -0.0037 -0.0472% -
$ printable -f x.json --grid inner
symbol │ desp │ last │ change │ changeper │ turnover │ changesign │ lastupdate
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
HSI │ 恆指 │ 26,623 │ -468 │ 1.73% │ 802億 │ - │ 2018/10/04 16:09
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
HSCEI │ 國指 │ 10,547 │ -239 │ 2.21% │ 257億 │ - │ 2018/10/04 16:08
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
000001.SH │ 上證指數 │ 2,821 │ 29 │ 1.06% │ 1,254億 │ + │ 2018/09/28 15:10
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
000300.SH │ 滬深 300 │ 3,438 │ 35 │ 1.04% │ 949億 │ + │ 2018/09/28 15:10
───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────
USDHKD │ 港匯 │ 7.8337 │ -0.0037 │ -0.0472% │ │ - │
$ printable -f x.json --grid full
┌───────────┬──────────┬────────┬─────────┬───────────┬──────────┬────────────┬──────────────────┐
│ symbol │ desp │ last │ change │ changeper │ turnover │ changesign │ lastupdate │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ HSI │ 恆指 │ 26,623 │ -468 │ 1.73% │ 802億 │ - │ 2018/10/04 16:09 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ HSCEI │ 國指 │ 10,547 │ -239 │ 2.21% │ 257億 │ - │ 2018/10/04 16:08 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ 000001.SH │ 上證指數 │ 2,821 │ 29 │ 1.06% │ 1,254億 │ + │ 2018/09/28 15:10 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ 000300.SH │ 滬深 300 │ 3,438 │ 35 │ 1.04% │ 949億 │ + │ 2018/09/28 15:10 │
├───────────┼──────────┼────────┼─────────┼───────────┼──────────┼────────────┼──────────────────┤
│ USDHKD │ 港匯 │ 7.8337 │ -0.0037 │ -0.0472% │ │ - │ │
└───────────┴──────────┴────────┴─────────┴───────────┴──────────┴────────────┴──────────────────┘
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for printable-0.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47ce5de8e21a9fbaa22dbd18767760f225880110a7a810ecec2cb8ecbf38c292 |
|
MD5 | 789d98919f8a77b147103612f9c5125c |
|
BLAKE2b-256 | 06b348ee34a3fdcfbfc2a3c38a4f6c8f0e9a52f0dbfb1385860b5be00b3219bc |