Mad Prefect
raw JSON → 2.3.0 verified Fri May 01 auth: no python
A collection of Prefect utilities and task libraries for building robust data pipelines. Current version 2.3.0, requires Python <3.13 and >=3.11. It provides custom blocks, flows, and integrations commonly used with Prefect.
pip install mad-prefect Common errors
error ModuleNotFoundError: No module named 'mad_prefect.blocks' ↓
cause In v2.0+, subpackages were removed; `MadBlock` and `MadTask` are now top-level.
fix
Change import to
from mad_prefect import MadBlock. error ImportError: cannot import name 'MadFlow' from 'mad_prefect' ↓
cause MadFlow was renamed or removed in v2.0.0.
fix
Check changelog: MadFlow is deprecated; use
@prefect.flow directly or from mad_prefect import MadFlow if available in your version. Warnings
breaking In v2.0.0, the package restructured exports: `MadBlock` and `MadTask` are no longer in subpackages. Old imports from `mad_prefect.blocks` and `mad_prefect.tasks` will break. ↓
fix Use `from mad_prefect import MadBlock, MadTask` instead.
gotcha MadPrefect requires Prefect >=2.0 but also has upper bounds on Prefect version. Mixing incompatible Prefect versions leads to cryptic import errors. ↓
fix Check `mad-prefect`'s `install_requires` and match Prefect version exactly.
Imports
- MadBlock wrong
from mad_prefect.blocks import MadBlockcorrectfrom mad_prefect import MadBlock - MadTask wrong
from mad_prefect.tasks import MadTaskcorrectfrom mad_prefect import MadTask
Quickstart
from mad_prefect import MadFlow, MadBlock
import prefect
@MadFlow
def my_flow():
block = MadBlock.load("my-block")
return block.run()
if __name__ == "__main__":
my_flow()