No project description provided
Project description
# Drawtable (csvless)
Drawtable is a python library for drawing ASCII table with text data.
It also contains a command line tool called `csvless`
that helps you view csv files without hassle.
## Installation
```
pip install drawtable
```
## Usage
### CLI tool
For details please see `csvless -h`, here are some typical examples:
```
$ csvless samples/foo.csv
$ csvless -s markdown samples/foo.csv
$ csvless -s markdown --cat samples/foo.csv
$ csvless -s box -N samples/foo.csv
$ csvless -s box -N -n samples/foo.csv
$ csvless -H samples/foo.csv
$ csvless -w 10 --no-wrap samples/foo.csv
```
### Library
Draw table box for list data:
```python
>>> from drawbox import Table
>>> tb = Table(
... margin_x=1,
... margin_y=0,
... align='left',
... col_max_width=40,
... )
>>> tb.draw([
... ['project', 'url'],
... ['drawbox', 'https://github.com/reorx/drawbox'],
>>> ])
┌─────────┬──────────────────────────────────┐
│ project │ url │
├─────────┼──────────────────────────────────┤
│ drawbox │ https://github.com/reorx/drawbox │
└─────────┴──────────────────────────────────┘
```
Draw a simple one cell box:
```python
>>> from drawbox import Table
>>> tb = Table(
... margin_x=1,
... margin_y=0,
... align='center',
... col_max_width=40,
... )
>>> tb.draw([[
... """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."""
... ]])
┌──────────────────────────────────────────┐
│ Lorem ipsum dolor sit amet, consectetur │
│ adipiscing elit, sed do eiusmod tempor i │
│ ncididunt ut labore et dolore magna aliq │
│ ua. Ut enim ad minim veniam, quis nostru │
│ d exercitation ullamco laboris nisi ut a │
│ liquip ex ea commodo consequat. │
└──────────────────────────────────────────┘
```
Drawtable is a python library for drawing ASCII table with text data.
It also contains a command line tool called `csvless`
that helps you view csv files without hassle.
## Installation
```
pip install drawtable
```
## Usage
### CLI tool
For details please see `csvless -h`, here are some typical examples:
```
$ csvless samples/foo.csv
$ csvless -s markdown samples/foo.csv
$ csvless -s markdown --cat samples/foo.csv
$ csvless -s box -N samples/foo.csv
$ csvless -s box -N -n samples/foo.csv
$ csvless -H samples/foo.csv
$ csvless -w 10 --no-wrap samples/foo.csv
```
### Library
Draw table box for list data:
```python
>>> from drawbox import Table
>>> tb = Table(
... margin_x=1,
... margin_y=0,
... align='left',
... col_max_width=40,
... )
>>> tb.draw([
... ['project', 'url'],
... ['drawbox', 'https://github.com/reorx/drawbox'],
>>> ])
┌─────────┬──────────────────────────────────┐
│ project │ url │
├─────────┼──────────────────────────────────┤
│ drawbox │ https://github.com/reorx/drawbox │
└─────────┴──────────────────────────────────┘
```
Draw a simple one cell box:
```python
>>> from drawbox import Table
>>> tb = Table(
... margin_x=1,
... margin_y=0,
... align='center',
... col_max_width=40,
... )
>>> tb.draw([[
... """Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."""
... ]])
┌──────────────────────────────────────────┐
│ Lorem ipsum dolor sit amet, consectetur │
│ adipiscing elit, sed do eiusmod tempor i │
│ ncididunt ut labore et dolore magna aliq │
│ ua. Ut enim ad minim veniam, quis nostru │
│ d exercitation ullamco laboris nisi ut a │
│ liquip ex ea commodo consequat. │
└──────────────────────────────────────────┘
```
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 Distribution
drawtable-0.2.0.tar.gz
(9.3 kB
view details)
Built Distribution
drawtable-0.2.0-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file drawtable-0.2.0.tar.gz
.
File metadata
- Download URL: drawtable-0.2.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58f98f02f06dfe1efe101a57eead4c8eae8ac042f9117b1e1b93c2ed195db92 |
|
MD5 | 41c895e37995a5080292ce5fd6a31cd8 |
|
BLAKE2b-256 | 927c0510a08d9e5c6a17335d6eac8c2df6a94da499e483118aa7ab51455fd647 |
File details
Details for the file drawtable-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: drawtable-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28a11f996db2a3691c0ce5db8bff59f4c038e9457e31d522cd2e91bff850952f |
|
MD5 | e4b992497c46a883c04c468ff560c69e |
|
BLAKE2b-256 | 98c0615862422f7621e9110663a96c15532e4a95c2b606d4e71d3f1be9d959a2 |