Registry / data / fasttransform

fasttransform

JSON →
library0.0.2pypypi✓ verified 23d ago

Fasttransform is a Python library designed for creating reusable, reversible, and extensible data transformations. It is a core building block for data pipelines, particularly within the fastai ecosystem, and leverages multiple dispatch for type-based specialization of transforms. The current version is 0.0.2, and it appears to have a low release cadence with infrequent updates.

pip install fasttransform
INSTALL
IMPORT
SIG · FASTTRANSFORM
F
fasttransform
datapythonv0.0.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.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
glibc
py 3.10
1/2 runs
1/2 runs
py 3.11
1/2 runs
1/2 runs
py 3.12
1/2 runs
1/2 runs
py 3.13
1/2 runs
1/2 runs
py 3.9
1/2 runs
1/2 runs
Code
Verified usage

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

Transform
from fasttransform import Transform
from fasttransform import Transform

This quickstart demonstrates how to define a simple transform using the `@Transform` decorator, create a reversible transform by passing encode and decode functions, and compose multiple transforms into a `Pipeline`.

from fasttransform import Transform, Pipeline # Create a simple transform using a decorator @Transform def add_one(x: int) -> int: return x + 1 # Create a reversible transform def multiply_by_two_encodes(x: int) -> int: return x * 2 def multiply_by_two_decodes(x: int) -> int: return x // 2 MultiplyByTwo = Transform(multiply_by_two_encodes, multiply_by_two_decodes) # Use a Pipeline to chain transforms my_pipeline = Pipeline([add_one, MultiplyByTwo]) # Demonstrate usage result_encoded = my_pipeline(5) print(f"Encoded result: {result_encoded}") # Expected: (5 + 1) * 2 = 12 result_decoded = MultiplyByTwo.decode(result_encoded) print(f"Decoded result (MultiplyByTwo): {result_decoded}") # Expected: 12 // 2 = 6
Debug
Known issues
breakingMigration from `fastcore.dispatch`'s `typedispatch` to `plum-dispatch` may introduce `AmbiguousLookupError` where `fastcore` would silently pick a function. `plum` is stricter to prevent unexpected behavior.
fix
Review type dispatch definitions to ensure unique matches for argument types, or explicitly specify the desired function.
affects: All versions (due to underlying dependency change)
breakingThe `Pipeline` class has moved from `fastcore` to `fasttransform`. Older `fastai` versions (specifically 2.7.x) might expect `Pipeline` in `fastcore`, leading to `ModuleNotFoundError` when loading models or using certain functionalities.
fix
Ensure `fasttransform` is installed and `Pipeline` is imported directly from `fasttransform`. If using `fastai` with older saved models, consider retraining or upgrading `fastai` and `fasttransform` to compatible versions. Downgrading `fastai` to v2.7.x was a workaround for some users, but generally updating is recommended.
affects: Potentially `fastai` versions 2.8.0 and higher when interacting with older saved models or explicit imports.
gotchaWhen implementing custom reversible transforms, remember to define both `encodes` and `decodes` methods for the `Transform` class or pass both functions to the `Transform` constructor. Forgetting the `decodes` method will prevent reversibility.
fix
Always implement or provide the inverse function(s) (`decodes`) for any transform intended to be reversible.
affects: All versions
gotchaFasttransform's type-based multiple dispatch, powered by `plum-dispatch`, will return the original input if no matching type annotation is found for an argument. This can lead to unexpected no-op behavior if types are not correctly annotated or handled.
fix
Carefully annotate types in `encodes`/`decodes` methods or decorator arguments. Provide a default implementation without type hints if a fallback behavior is desired for unhandled types.
affects: All versions
gotchaThere is another unrelated library named `fastflowtransform` on PyPI. Ensure you are installing and importing the correct library (`fasttransform`) for data pipeline transformations described here to avoid confusion.
fix
Double-check the package name during installation (`pip install fasttransform`) and imports (`from fasttransform import ...`).
affects: All versions
Upgrade
Version history
0.0.2latest on PyPI · released Apr 18, 2025
Audit
Dependencies
plum-dispatchrequiredProvides the multiple dispatch functionality used internally for type-based specialization.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
fasttransform — pip install fasttransform · libregistry