All Projects → toaco → Tablereport

toaco / Tablereport

Licence: mit
A python library for making table report.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tablereport

lazyExcel
a simply software like MS-Excel.it can be running muiti-platform...
Stars: ✭ 37 (-27.45%)
Mutual labels:  excel, office, report
Phpspreadsheet
A pure PHP library for reading and writing spreadsheet files
Stars: ✭ 10,627 (+20737.25%)
Mutual labels:  excel, libreoffice, office
Corexlsx
Excel spreadsheet (XLSX) format parser written in pure Swift
Stars: ✭ 481 (+843.14%)
Mutual labels:  excel, office
React Handsontable
React Data Grid with Spreadsheet Look & Feel. Official React wrapper for Handsontable.
Stars: ✭ 511 (+901.96%)
Mutual labels:  excel, table
Desktopeditors
An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
Stars: ✭ 1,008 (+1876.47%)
Mutual labels:  excel, office
React Spreadsheet Grid
An Excel-like grid component for React with custom cell editors, performant scroll & resizable columns
Stars: ✭ 996 (+1852.94%)
Mutual labels:  excel, table
Pytablewriter
pytablewriter is a Python library to write a table in various formats: CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV.
Stars: ✭ 422 (+727.45%)
Mutual labels:  excel, table
Zettlr
A Markdown Editor for the 21st century.
Stars: ✭ 6,099 (+11858.82%)
Mutual labels:  libreoffice, office
Online
Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
Stars: ✭ 278 (+445.1%)
Mutual labels:  libreoffice, office
Rows
A common, beautiful interface to tabular data, no matter the format
Stars: ✭ 739 (+1349.02%)
Mutual labels:  excel, table
Sheetjs
📗 SheetJS Community Edition -- Spreadsheet Data Toolkit
Stars: ✭ 28,479 (+55741.18%)
Mutual labels:  excel, table
Vue Handsontable Official
Vue Data Grid with Spreadsheet Look & Feel. Official Vue wrapper for Handsontable.
Stars: ✭ 751 (+1372.55%)
Mutual labels:  excel, table
Legacytableview
simple light weight android library for displaying tabulated data
Stars: ✭ 39 (-23.53%)
Mutual labels:  excel, table
Laravel Report Generator
Rapidly Generate Simple Pdf, CSV, & Excel Report Package on Laravel
Stars: ✭ 380 (+645.1%)
Mutual labels:  excel, report
Nghandsontable
Official AngularJS directive for Handsontable
Stars: ✭ 438 (+758.82%)
Mutual labels:  excel, table
Reactgrid
Add spreadsheet-like behavior to your React app
Stars: ✭ 289 (+466.67%)
Mutual labels:  excel, table
Locktableview
Android自定义表格,支持锁双向表头,自适应列宽,自适应行高,快速集成。Android custom table, support two-way lock header, adaptive column width, adaptive line width, rapid integration.
Stars: ✭ 520 (+919.61%)
Mutual labels:  excel, table
Excel Io
A utility library that makes it easy to read and write Excel workbooks using C#
Stars: ✭ 35 (-31.37%)
Mutual labels:  excel, office
phpspreadsheet-bundle
A Symfony bundle to integrate with PHPOffice's PhpSpreadsheet library
Stars: ✭ 47 (-7.84%)
Mutual labels:  excel, office
compareGroups
R package to easily build publication-ready univariate or bivariate descriptive tables from a data set.
Stars: ✭ 23 (-54.9%)
Mutual labels:  table, report

tablereport

Python Version Build Status Coverage Status Code Health

A python library for making table report. Now supports exporting to Excel.

Install

pip install git+https://github.com/DevineLiu/tablereport.git@master

Example

Basic

from tablereport import Table
from tablereport.shortcut import write_to_excel

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4]])

write_to_excel('basic.xlsx', table)

Style

from tablereport import Table, Style
from tablereport.shortcut import write_to_excel

table_style = Style({
    'background_color': 'fff0f0f0',
})
title_style = Style({
    'background_color': 'ff87cefa',
    'font_weight': 'blod'
}, extend=table_style)

header_style = Style({
    'background_color': 'ff87cefa',
}, extend=table_style)
table = Table(header=[[('TEST', title_style), None, None, None],
                      [('HEADER1', header_style),
                       ('HEADER2', header_style),
                       ('HEADER3', header_style),
                       ('HEADER4', header_style)]],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4]],
              style=table_style)

write_to_excel('style.xlsx', table)

Column Selector

from tablereport import Table, ColumnSelector, Style
from tablereport.shortcut import write_to_excel

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4]])

style = Style({
    'background_color': 'fff0f0f0',
})
areas = table.body.select(ColumnSelector(lambda col: col % 2))
areas.set_style(style)
write_to_excel('column_selector.xlsx', table)

Row Selector

from tablereport import Table, RowSelector, Style
from tablereport.shortcut import write_to_excel

header_style = Style({
    'background_color': 'FF87CEFA',
})
even_row_style = Style({
    'background_color': 'FFF0F0F0',
})

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4],
                    ['One', 'B', 1, 2], ])

table.header.set_style(header_style)
rows = table.body.select(RowSelector(lambda line: not line % 2))
rows.set_style(even_row_style)
write_to_excel('row_selector.xlsx', table)

Cell Selector

from tablereport import Table, Style, ColumnSelector, CellSelector
from tablereport.shortcut import write_to_excel

good_score_style = Style({
    'background_color': 'ff00cc33',
})
bad_score_style = Style({
    'background_color': 'ffcc0000',
})

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 90, 70],
                    ['One', 'A', 50, 40],
                    ['One', 'B', 93, 59],
                    ['Two', 'A', 78, 23],
                    ['Two', 'B', 28, 66]])
area = table.body.select(ColumnSelector(lambda col: col == 3, width=2)).one()
good_score_cells = area.select(CellSelector(lambda cell: cell.value >= 90))
bad_score_cells = area.select(CellSelector(lambda cell: cell.value < 60))
good_score_cells.set_style(good_score_style)
bad_score_cells.set_style(bad_score_style)

Merge

from tablereport import Table, ColumnSelector
from tablereport.shortcut import write_to_excel

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4]])

column = table.body.select(ColumnSelector(lambda col: col == 1)).one()
column.merge()
write_to_excel('merge.xlsx', table)

Group

from tablereport import Table, ColumnSelector
from tablereport.shortcut import write_to_excel

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4],
                    ['Two', 'A', 1, 2],
                    ['Two', 'B', 2, 3]])

column = table.body.select(ColumnSelector(lambda col: col == 1)).one()
column.group().merge()
write_to_excel('group.xlsx', table)

Summary

from tablereport import Table, Style
from tablereport.shortcut import write_to_excel

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4]])

style = Style({
    'background_color': 'ffe6e6e6',
})
table.body.summary(label='Total', label_span=2, label_style=style,
                   value_style=style)
write_to_excel('summary.xlsx', table)

Horizontal Summary

from tablereport import Table, Style, ColumnSelector
from tablereport.shortcut import write_to_excel

table = Table(header=[['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4],
                    ['Two', 'A', 1, 2],
                    ['Two', 'B', 2, 3]])

header_style = Style({
    'background_color': 'ff87cefa',
})
summary_style = Style({
    'background_color': 'ffe6e6e6',
})

areas = table.select(ColumnSelector(lambda col: col == 3, width=2))
summary_style = Style({
    'background_color': 'ffe6e6e6',
})
areas.summary(label_span=1, label='TOTAL', location='right',
              value_style=summary_style, label_style=header_style)
table.header.set_style(header_style)
write_to_excel('horizontal_summary.xlsx', table)

Complex

from tablereport import Table, ColumnSelector, Style
from tablereport.shortcut import write_to_excel

title_style = Style({
    'font_size': 15,
    'background_color': 'ff87cefa',
    'font_weight': 'blod'
})

header_style = Style({
    'background_color': 'ff87cefa',
})

left_total_style = Style({
    'background_color': 'fff0f0f0',
})

bottom_total_style = Style({
    'background_color': 'ffe6e6e6',
})

table = Table(header=[['TEST', None, None, None],
                      ['HEADER1', 'HEADER2', 'HEADER3', 'HEADER4']],
              body=[['One', 'A', 1, 2],
                    ['One', 'A', 2, 3],
                    ['One', 'B', 3, 4],
                    ['Two', 'A', 1, 2],
                    ['Two', 'B', 2, 3]])

table.header[0].set_style(title_style)
table.header[1].set_style(header_style)

column = table.body.select(ColumnSelector(lambda col: col == 1)).one()
column.group().merge().left.summary(label_span=1, label='Total',
                                    label_style=left_total_style,
                                    value_style=left_total_style)

table.summary(label_span=2, label='Total',
              label_style=bottom_total_style,
              value_style=bottom_total_style)

write_to_excel('complex.xlsx', table)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].