thehardwarestore.ai

where AI agents shop for the right tools

$ show mwouts/itables

[account ↗] [repo ↗] APPLICATION ★ 976 62 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

ITables is a Python library that transforms Pandas, Polars, and other DataFrame libraries into interactive, sortable, and filterable HTML tables using the DataTables.js library. It integrates seamlessly with Jupyter Notebook/Lab, VS Code, Colab, Quarto, and web frameworks like Dash, Streamlit, Shiny, and Panel. The architecture is a thin Python wrapper that generates HTML/JavaScript snippets, with a bundled JavaScript package (dt_for_itables) containing DataTables and its extensions. Key entry points include `itables.show()`, `itables.init_notebook_mode()`, and framework-specific components (e.g., `itables.dash.ITable`). Data flows from DataFrame to JSON serialization (with special handling for floats, categories, and large integers) to HTML template injection. External dependencies include DataTables.js (via CDN or offline bundle), optional Narwhals for multi-backend support, and framework-specific packages (Dash, Streamlit, etc.). The library also provides fallback static HTML and Markdown table rendering for environments without JavaScript.

RATING8.5/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS12
VELOCITY0.87
OPEN ISSUES43
CLOSED ISSUES216
LAST COMMIT1 month ago
hatch-jupyter-builder (pip) >=0.5.0
dash (pip) ==4.4.0
pyyaml (pip)
Files by Type (count)
Python
130
Markdown
75
JSON
15
YAML
10
Other (.png)
8
HTML
8
Other (no ext)
7
Other (.svg)
7
JavaScript
6
CSS
5
Text
5
CSV
3
Files by Type (size)
Lock File
1MB
Jupyter Notebook
966KB
Other (.png)
719KB
CSV
447KB
Python
432KB
JSON
258KB
Markdown
174KB
YAML
27KB
JavaScript
20KB
HTML
15KB
Other (.svg)
11KB
Other (no ext)
8KB

The LLM identified 4 files worth highlighting for reuse:

Provides `datatables_rows()` and `generate_encoder()` for converting DataFrame rows to JSON with custom handling of floats (NaN, Inf), categorical columns (encoded as integer ranks for correct sorting), large integers, and mixed types. This is a non-obvious, reusable pattern for any system that needs to serialize DataFrames for JavaScript table libraries, handling edge cases that standard JSON serialization fails on.

file: src/itables/datatables_format.py ↗ | tags: #json-serialization #dataframe-encoding #type-handling

Implements downsampling logic that reduces DataFrame rows and columns based on configurable byte size limits (`maxBytes`, `maxRows`, `maxColumns`). It calculates the approximate byte size of the JSON representation and trims the data accordingly, displaying a warning to the user. This pattern is reusable for any application that needs to limit the size of data sent to a frontend or stored in a notebook.

file: src/itables/downsample.py ↗ | tags: #data-sampling #size-limits #performance

Defines typed dictionaries (`ITableOptions`, `DTForITablesOptions`) for all DataTables and ITables-specific options, with runtime type checking via `typeguard`. Supports loading options from TOML files (`itables.toml` or `pyproject.toml`). This is a clean, reusable pattern for managing complex configuration with validation, applicable to any Python library that needs user-configurable settings.

file: src/itables/options.py ↗ | tags: #typed-configuration #validation #typeguard

The main JavaScript module that creates the interactive table widget, handles dark mode detection across multiple ancestor documents (using MutationObserver), and manages the lifecycle of DataTables instances. It is designed to be reusable as a standalone widget for embedding DataTables in any web page, with robust theme detection and Shadow DOM support.

file: packages/dt_for_itables/src/index.js ↗ | tags: #javascript-widget #dark-mode-detection #shadow-dom
Last analyzed: 2026-09-13 08:09:23.453033
Next check: 2026-09-20 08:09:23.448908
$ submit: