DirectoryBatcher (autotransform.batcher.directory)
The implementation for the DirectoryBatcher.
- class autotransform.batcher.directory.DirectoryBatcher(*, prefix: str, metadata: Dict[str, Any] | None = None)
Bases:
BatcherA batcher which separates FileItems by directory. Batches are given a title that is based on a prefix and the directory that the Batch represents.
- prefix
The prefix to apply to any titles for Batches.
- Type:
str
- metadata
The metadata to associate with Batches. Defaults to None.
- Type:
Optional[Dict[str, Any]], optional
- name
The name of the Component.
- Type:
ClassVar[BatcherName]
- batch(items: Sequence[Item]) List[Batch]
Takes in a list of FileItems and separates them based on their directory.
- metadata: Dict[str, Any] | None
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: ClassVar[BatcherName] = 'directory'
- prefix: str