| 1 | from collections import namedtuple |
| 2 | |
| 3 | Stage = namedtuple("Stage", "name priority fn") |
| 4 | |
| 5 | _REGISTRY = [] |
| 6 | |
| 7 | |
| 8 | def register(name, priority, fn): |
| 9 | _REGISTRY.append(Stage(name, priority, fn)) |
| 10 | |
| 11 | |
| 12 | def stages(): |
| 13 | from pipeline import archive, emit, ingest, scrub # noqa: F401 |
| 14 | |
| 15 | return list(_REGISTRY) |
| 16 |