https://github.com/avdosev/itertools_dart
Simple package for easy work with Dart iterators just like Python itertools.
https://github.com/avdosev/itertools_dart
dart flutter iterators itertools
Last synced: 4 months ago
JSON representation
Simple package for easy work with Dart iterators just like Python itertools.
- Host: GitHub
- URL: https://github.com/avdosev/itertools_dart
- Owner: avdosev
- License: mit
- Created: 2021-08-01T09:14:11.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-05T08:19:11.000Z (about 4 years ago)
- Last Synced: 2025-10-23T03:42:32.718Z (8 months ago)
- Topics: dart, flutter, iterators, itertools
- Language: Dart
- Homepage: https://pub.dev/packages/itertools_dart
- Size: 39.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# itertools · 
Simple package for easy work with Dart iterators just like Python itertools.
Provide methods / functions:
* zip2/zip3/etc
* chain
* count
* enumerate / mapIndexed
* and other helpers
## Links
[Pub dev][pubdev]
[Documentation][docs]
[Issue tracker][tracker]
## Usage
```dart
import 'package:itertools/itertools.dart';
void main() {
print(zip2(['H', ',', 'a', 'l'], ['i', ' ', 'l', '!'])
.starmap((first, second) => first + second)
// equal:
// .map((e) => e.item1 + e.item2)
.join());
// output: Hi, all!
print(range(first: 1, last: 10, step: 3).reversed.toList());
// output: [7, 4, 1]
// or more compact
print(1.to(10, step: 3).reversed.toList());
// output: [7, 4, 1]
print(chain(1.to(4), [4, 5], 1.to(4)).toList());
// output: [1, 2, 3, 4, 5, 1, 2, 3]
}
```
## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/avdosev/itertools_dart/issues
[pubdev]: https://pub.dev/packages/itertools
[docs]: https://pub.dev/documentation/itertools/latest/