Skip to main content

pyexcel-text

https://travis-ci.org/chfw/pyexcel-text.svg?branch=v0.0.2 https://coveralls.io/repos/chfw/pyexcel-text/badge.png?branch=v0.0.2 https://pypip.in/d/pyexcel-text/badge.png https://pypip.in/py_versions/pyexcel-text/badge.png https://pypip.in/implementation/pyexcel-text/badge.png

It is a plugin to pyexcel and extends its capbility to present and write data in text fromats mainly through tabulate:

  • “plain”

  • “simple”

  • “grid”

  • “pipe”

  • “orgtbl”

  • “rst”

  • “mediawiki”

  • “latex”

  • “latex_booktabs”

  • “json”

Usage

>>> import pyexcel as pe
>>> import pyexcel.ext.text as text
>>> content = [
...     ["Column 1", "Column 2", "Column 3"],
...     [1, 2, 3],
...     [4, 5, 6],
...     [7, 8, 9]
... ]
>>> sheet = pe.Sheet(content)
>>> sheet
Sheet Name: pyexcel
--------  --------  --------
Column 1  Column 2  Column 3
1         2         3
4         5         6
7         8         9
--------  --------  --------
>>> sheet.name_columns_by_row(0)
>>> sheet
Sheet Name: pyexcel
  Column 1    Column 2    Column 3
----------  ----------  ----------
         1           2           3
         4           5           6
         7           8           9
>>> multiple_sheets = {
...      'Sheet 1':
...          [
...              [1.0, 2.0, 3.0],
...              [4.0, 5.0, 6.0],
...              [7.0, 8.0, 9.0]
...          ],
...      'Sheet 2':
...          [
...              ['X', 'Y', 'Z'],
...              [1.0, 2.0, 3.0],
...              [4.0, 5.0, 6.0]
...          ],
...      'Sheet 3':
...          [
...              ['O', 'P', 'Q'],
...              [3.0, 2.0, 1.0],
...              [4.0, 3.0, 2.0]
...          ]
...  }
>>> book = pe.Book(multiple_sheets)
>>> text.TABLEFMT = "rst"
>>> text.save_as(book, "myfile.rst")
>>> myfile = open("myfile.rst")
>>> print(myfile.read())
Sheet Name: Sheet 1
=  =  =
1  2  3
4  5  6
7  8  9
=  =  =
Sheet Name: Sheet 2
===  ===  ===
X    Y    Z
1.0  2.0  3.0
4.0  5.0  6.0
===  ===  ===
Sheet Name: Sheet 3
===  ===  ===
O    P    Q
3.0  2.0  1.0
4.0  3.0  2.0
===  ===  ===

Dependencies

  • tabulate

Metadata

Release files for pyexcel-text 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyexcel-text 0.0.2
File Size Uploaded
pyexcel-text-0.0.2.tar.gz 3.1 kB Details

Release files / pyexcel-text-0.0.2.tar.gz

Download URL pyexcel-text-0.0.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ab463bf6844c66bfab9d7a9f65cc473c713c23d8ae15202860f4b1051e255ce7
BLAKE2b-256 checksum
How to use checksums
6e35891c637c2bd36f7058fe3b7f280f5532c1d2851b5b8e42f2ea08e104f2a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2.6

2 release files

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.3

1 release file

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page