Install & Compatibility
Where this runs
tested against v0.3.6 · 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
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 89.4MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 3.7s · import 0.000s · 86MB
89MB installed
● package 89MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TableLogger
✓ from table_logger import TableLogger
✗ from table_logger import TableLogger
Initialize a TableLogger instance with specified columns and then log rows. The `flush()` method is implicitly called when the object is garbage collected or the program exits, but can be called explicitly to ensure output. Examples also show enabling row numbers, timestamps, and time deltas.
from table_logger import TableLogger
from datetime import datetime
import math
import random
tbl = TableLogger(columns='a,b,c,d')
tbl(1, 'Row1', datetime.now(), math.pi)
tbl(2, 'Row2', datetime.now(), 1/3)
tbl(3, 'Row3', datetime.now(), random.random())
# Example with additional columns
import time
tbl_extended = TableLogger(columns='data', rownum=True, time_delta=True, timestamp=True)
for e in 'abcde':
time.sleep(random.uniform(0.1, 0.5)) # Use uniform for more realistic varying delays
tbl_extended(e)
print('\nStandard Table:')
tbl.flush()
print('\nExtended Table:')
tbl_extended.flush()
Debug
Known issues
breakingVersion 0.3.7 (GitHub release) removed deprecated `numpy` aliases `np.float` and `np.int`. If you are using an older version of `table-logger` with a very new `numpy` version (e.g., NumPy 2.0+), or your code relies on these aliases in conjunction with `table-logger`, you may encounter errors related to these removed types.fixUpgrade `table-logger` to 0.3.7 or newer once available on PyPI, and ensure your code adapts to modern NumPy type handling (e.g., using `float` or `int` directly where appropriate). Ensure all `numpy` dependent packages are compatible with your `numpy` version.
affects: 0.3.6 and older when used with newer NumPy versions that have removed these aliases.
gotchaPrior to version 0.3.5, users reported logging issues when `table-logger` was used within Jupyter notebooks, where output might not display correctly or consistently.fixUpgrade to `table-logger` version 0.3.5 or newer to resolve known Jupyter notebook logging inconsistencies.
affects: <0.3.5
gotchaNumPy 2.0 (released June 2024) introduced significant breaking changes, including an ABI break and API cleanups. If `table-logger` (or other libraries it depends on) was compiled against an older NumPy 1.x version and then run with NumPy 2.0, this can lead to `ImportError` due to binary incompatibility.fixReinstall `table-logger` and its dependencies after upgrading NumPy to ensure they are compiled against the correct NumPy version. Check for `table-logger` releases that explicitly support NumPy 2.0.
affects: All versions of `table-logger` when used with NumPy 2.0 if not compiled against it.
Upgrade
Version history
0.3.6latest on PyPI · released Aug 26, 2019
Audit
Dependencies
numpyrequiredRequired for internal operations; explicitly added as a requirement in v0.3.6.