Registry / observability / table-logger

table-logger

JSON →
library0.3.6pypypiunverified

TableLogger is a Python utility designed for logging tabular data to either a console or a file. It provides features like sane default formatting for standard Python types, automatically includes row numbers, timestamps, and time deltas, and supports CSV output. Users can also customize column widths and formatting. The library is currently active, with version 0.3.6 being the latest official release on PyPI, though recent GitHub activity shows version 0.3.7. The release cadence appears to be infrequent based on PyPI update history.

pip install table-logger
INSTALL
IMPORT
SIG · TABLE-LOGGER
T
table-logger
observabilitypythonv0.3.6
Install
3.7s avg
Import
Disk
89MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 89.4MB
glibc
py 3.103.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.
fix
Upgrade `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.
fix
Upgrade 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.
fix
Reinstall `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.
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
table-logger — pip install table-logger · libregistry