Collectors¶
Abstract
Collectors are classes that collect data items into a Mapping.
AutoMapper¶
A Mapping that automatically generates and assigns unique, minified string values for any new keys accessed. The values are generated using the specified alphabet.
Example
CategoryCounter¶
The CategoryCounter class extends a dictionary to count occurrences of data items categorized by multiple categories. It maintains a total count of all data items and allows categorization using direct values or functions.
Example
MappingCollector¶
A class designed to collect key-value pairs into an internal mapping based on different aggregation modes.
It supports modes like ALL, COUNT, DISTINCT, FIRST, LAST, and more via the Aggregation enum.
Example
MeteredDict¶
A dictionary that tracks changes made to it.
Example
nested_defaultdict¶
Creates a nested defaultdict with specified depth and factory.
Example