Registry / data / tables

tables

JSON →
library3.11.1pypypi✓ verified 23d ago

PyTables is a Python library for managing hierarchical datasets, designed for efficient handling of extremely large amounts of data. It builds on the HDF5 library and NumPy, providing high-performance I/O for scientific data. The current version is 3.11.1, and it maintains an active release cadence with regular updates.

pip install tables
INSTALL
IMPORT
SIG · TABLES
T
tables
datapythonv3.11.1
Install
8.0s avg
Import
470ms
Disk
157MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.10.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 8.0s · import 0.376s · 146MB
157MB installed
● package 157MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tables
import tables
The primary module for PyTables.
open_file
tables.open_file
tables.openFile
As of PyTables 3.10.0, the `open_file` function (snake_case) is the preferred method for opening HDF5 files, aligning with Python style guides. `openFile` (camelCase) is still supported but discouraged.
IsDescription
tables.IsDescription
Base class for defining the structure (description) of tables.

This quickstart demonstrates how to create an HDF5 file, define a table structure using `IsDescription`, create a table, append data, and read data using PyTables. It also shows the importance of using context managers (`with`) for file handling to ensure proper closing.

import tables as tb import numpy as np import os # Define a table description class MyTableDescription(tb.IsDescription): col1 = tb.StringCol(16, pos=1) col2 = tb.Int32Col(pos=2) col3 = tb.Float64Col(pos=3) filename = "mytable.h5" if os.path.exists(filename): os.remove(filename) try: # Open the HDF5 file in write mode with tb.open_file(filename, mode="w", title="Test File") as h5f: # Create a group for organization group = h5f.create_group(h5f.root, "data") # Create a table within the group table = h5f.create_table(group, 'table1', MyTableDescription, "My First Table") # Append data to the table table.append([("row_a", 1, 1.1), ("row_b", 2, 2.2)]) table.flush() # Ensure data is written to disk print("\nData in table1 after first append:") for row in table.iterrows(): print(f" col1: {row['col1']}, col2: {row['col2']}, col3: {row['col3']}") # Add more data table.append([("row_c", 3, 3.3), ("row_d", 4, 4.4)]) table.flush() print("\nAll data in table1 (as NumPy record array):") print(table[:]) # Read all data into a NumPy record array print(f"\nSuccessfully created and written to {filename}") # Re-open the file in read mode to verify with tb.open_file(filename, mode="r") as h5f_read: read_table = h5f_read.root.data.table1 print("\nData read from file:") for row in read_table.iterrows(): print(f" col1: {row['col1']}, col2: {row['col2']}, col3: {row['col3']}") except Exception as e: print(f"An error occurred: {e}") finally: # Clean up the created file if os.path.exists(filename): os.remove(filename) print(f"Cleaned up {filename}")
ptdump --version
Debug
Known issues
breakingThe `File.rename_node()` and `File.move_node()` methods no longer return the new node. They now return `None`.
fix
Update code that relies on the return value of these methods. Access the newly renamed or moved node through its parent group or by directly referring to its new path.
affects: >=3.7.0
deprecatedThe `obj` argument for `File.create_table()` is deprecated.
fix
Instead of `obj=MyObject`, use `description=MyDescriptionClass` with a `tables.IsDescription` subclass to define the table's structure. This improves clarity and consistency.
affects: >=3.10.0
gotchaThe default compression level for `zlib` and `blosc` filters changed from `zlib.Z_DEFAULT_COMPRESSION` to `1`.
fix
If specific compression ratios or performance characteristics are critical, explicitly set the `complevel` parameter within the `Filters` object when creating extendable arrays (EArray) or tables with compression enabled.
affects: >=3.5.0
gotchaAlways ensure `tables.File` objects are properly closed to prevent data corruption, resource leaks, or incomplete writes.
fix
Use a `with tables.open_file(...) as h5f:` statement, which automatically handles closing the file even if errors occur. Alternatively, explicitly call `h5f.close()` when the file is no longer needed.
affects: All versions
Errors
Common errors & fixes
fatal error: hdf5.h: No such file or directory
PyTables requires the HDF5 C library development headers to be installed on your system for successful compilation during `pip install`.
fix
Install the HDF5 development package for your OS: `sudo apt-get install libhdf5-dev` (Debian/Ubuntu), `sudo yum install hdf5-devel` (CentOS/RHEL), or `brew install hdf5` (macOS) before running `pip install tables`.
ModuleNotFoundError: No module named 'tables'
The `tables` library or its dependencies were not installed successfully or are not accessible in the current Python environment.
fix
Install the library using pip: `pip install tables`. If installation fails, address any underlying HDF5 dependency issues first.
IOError: unable to open file (file is not an HDF5 file)
You are attempting to open a file that is either corrupted, empty, or not a valid HDF5 file recognized by PyTables.
fix
Ensure the file specified is a properly created HDF5 file; verify its integrity, or create a new one using `tables.open_file()`.
KeyError: 'group path does not exist'
You are trying to access a node (group or array) within the HDF5 file using a path that does not exist in the file's structure.
fix
Check the existing structure of your HDF5 file using `file.walk_nodes()` or `file.root._v_children` to find the correct path.
Upgrade
Version history
3.11.1latest on PyPI · released Mar 1, 2026
Audit
Dependencies
numpyrequiredFundamental for array operations and defining data structures.
Agent activity
21 hits · last 30 days
node
16
OpenAI (training)
1
Resources
tables — pip install tables · libregistry