Registry / data / triad
library1.0.2pypypi✓ verified 25d ago

Triad is a Python utility library primarily designed to support Fugue projects, offering a collection of common Python utilities for data processing, schema management, and function dispatching. It is currently at version 1.0.2 and maintains an active release cadence, often aligning with Fugue updates or addressing compatibility with key data science libraries like Pandas and PyArrow.

pip install triad
INSTALL
IMPORT
SIG · TRIAD
T
triad
datapythonv1.0.2
Install
9.8s avg
Import
Disk
333MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.2 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 351.1MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 9.8s · import 0.000s · 313MB
333MB installed
● package 333MB
Code
Verified usage

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

FunctionWrapper
from triad import FunctionWrapper
from triad import FunctionWrapper

This quickstart demonstrates two core utilities of Triad: `FunctionWrapper` for validating function inputs and outputs based on regex patterns of types, and `Schema` for defining and managing data schemas, including conversions to/from Pandas DataFrames.

import pandas as pd from triad.collections import FunctionWrapper, Schema # Example of FunctionWrapper for input/output validation @FunctionWrapper( params_re="(pa:pd.DataFrame,pb:pd.DataFrame)(.*)", return_re="(res:pd.DataFrame)" ) def process_dataframes(pa: pd.DataFrame, pb: pd.DataFrame, *args) -> pd.DataFrame: """A dummy function to demonstrate FunctionWrapper validation.""" print(f"[FunctionWrapper] Received dataframes with columns: {pa.columns.tolist()}, {pb.columns.tolist()}") print(f"[FunctionWrapper] Received other args: {args}") return pd.DataFrame({"sum_rows": [len(pa) + len(pb)]}) # Create some dummy dataframes df1 = pd.DataFrame({"col1": [1, 2], "col2": ["a", "b"]}) df2 = pd.DataFrame({"colA": [3, 4, 5], "colB": ["c", "d", "e"]}) # Call the wrapped function result = process_dataframes(df1, df2, "extra_param", 42) print(f"\nFunction result:\n{result}") # Example of Schema usage s = Schema("id:int,name:str,value:double") print(f"\nCreated Schema: {s.as_str}") # Convert a dictionary to a Pandas DataFrame conforming to the schema data = {"id": [101, 102], "name": ["Alice", "Bob"], "value": [1.1, 2.2]} df_from_schema = s.as_pandas_df(data) print(f"\nDataFrame from Schema:\n{df_from_schema}")
Debug
Known issues
breakingThe `fs` module and its associated functionality were removed in version 1.0.0. Projects relying on `triad`'s file system abstractions will need to refactor their code.
fix
Migrate any usage of `triad.fs` utilities to direct `fsspec` or other file system library calls, or adapt to the new I/O utilities introduced after the change.
affects: >=1.0.0
gotchaTriad frequently updates to maintain compatibility with new Pandas versions (e.g., Pandas 2.0, 2.2, 3.0). This can lead to unexpected behavior or errors if `triad` and `pandas` versions are not carefully aligned.
fix
Always check `triad`'s release notes for specific Pandas version compatibility before upgrading either library. Pinning Pandas versions in `requirements.txt` is recommended for production environments. Ensure your `triad` version is compatible with your `pandas` version, or upgrade `triad` to the latest for broader compatibility.
affects: <1.0.2
gotchaThe `ciso8601` package is an optional dependency for faster datetime parsing. If not installed, `triad` will fall back to slower Python-native parsing, which can impact performance, especially on Windows where `ciso8601` historically had specific soft-dependency behavior.
fix
For optimal performance with datetime operations, install `triad` with the `ciso8601` extra: `pip install triad[ciso8601]`.
affects: All versions
Upgrade
Version history
1.0.2latest on PyPI · released Feb 11, 2026
Audit
Dependencies
pythonrequiredRequired Python version.
pandasrequiredCore functionality relies heavily on Pandas DataFrames and their utilities.
fsspecrequiredIntegrated for flexible file system operations.
pyarrowrequiredUsed for schema handling and data type conversions.
ciso8601optionalOptional dependency for faster datetime string parsing.
Agent activity
31 hits · last 30 days
node
27
Amazon
1
OpenAI (training)
1
Resources
triad — pip install triad · libregistry