Skip to main content

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. │
└──────────────────────────────────────────┘
```

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

drawtable-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

drawtable-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file drawtable-0.1.0.tar.gz.

File metadata

  • Download URL: drawtable-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for drawtable-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ffe130b2753109f6bd58153934da4213e618b7fd4bf8260aeaa971c7c7907d39
MD5 6ca26f912519479a8b3eb31b0d329b0c
BLAKE2b-256 c559fe8fabd5ac3db887061ee8832b94e9138bd10d62175b2582d2451a11610d

See more details on using hashes here.

File details

Details for the file drawtable-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for drawtable-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26927c6ae57912f3117ee8cf2f8cd72b8162f38f348ca48e6bd45a711f3a809e
MD5 81be772640cc5e642b5d9b6cd41e2ad1
BLAKE2b-256 c0ae83250981dbdd68948baf9bbb0df80370cffa513f76c3a5d9aaf6acf8bed4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page