FixedDataTablePy
Python utilities for building and rendering FixedDataTable components that can easily be sorted, filtered, and exported to Excel.
Installation
Install the python package:
pip install fixeddatatable
Install the javascript libary with bower:
bower install fixed-data-table-py
Usage Overview
Build table rows as a list of lists or a list of dicts
Build Column objects with arguments that match the column props in the fixed-data-table column API
Create a Table object and pass the rows and columns as arguments
In your template, create the FixedDataTablePy React component and pass in the Table.json as the options property.
Other Functionality
number formatting: give the column a num_format property with a numeral.js format string
filtering: pass the Table constructor the data key to filter by and a placeholder to enable filtering
exporting: pass the Table constructor the filename and the table header will include a button to export the table data to a .xlsx file
Example
See the sample_project for a full example of a Flask app.
In your view:
from fixeddatatable import Table, Column
rows = [
{'col1': 'a1', 'col2': 'b1', 'col3': '0.99'},
{'col1': 'a2', 'col2': 'b2', 'col3': '0.12313'},
{'col1': 'a3', 'col2': 'b3', 'col3': '1.04'},
]
cols = [
Column(label='Col 1', key='col1', width=100),
Column(label='Col 2', key='col2', width=100),
Column(label='Col 3', key='col3', width=100, num_format='0.0%'),
]
tbl = Table(row_height=50, width=300, height=500, columns=cols, rows=rows,
filter={'key': 'col2', 'placeholder': 'Filter by Col 2'},
export_filename='SampleProject.xlsx')
In your template:
<div id="datatable"></div>
<script type="text/javascript">
var tableData = tbl.json|safe;
React.render(
React.createElement(FixedDataTablePy, {options: tableData}),
document.getElementById('yourid')
);
</script>
Metadata
Release files for fixeddatatable 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fixeddatatable-0.0.2.tar.gz | 2.9 kB | Without provenance | Details for fixeddatatable-0.0.2.tar.gz |
Release files / fixeddatatable-0.0.2.tar.gz
| Download URL | fixeddatatable-0.0.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1c68e74ccf311baa03f9b0471b3e6c31960abd95b46cec85ca9a1986231d7e8
|
|
BLAKE2b-256 checksum How to use checksums |
3c57df683a54638ed5c43a5668cb8a9c115e37def23155dd5f75cc3a8c63b658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for fixeddatatable 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.