From 1a4b72463fd1ea00efb51e0e65b02114555278d7 Mon Sep 17 00:00:00 2001 From: Jeff Mo Date: Thu, 25 Apr 2019 21:35:47 +1200 Subject: [PATCH] Better readme --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index b8c8c1a..ca268e9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,35 @@ # laziter Lazy iterators for Python 3, in the spirit of LINQ or Java Stream. Has easy multithreading built in + +# Installation +Simply `pip install laziter`. It's lightweight and has no dependencies (if you choose not to use the `pathos` multiprocess implementation) + +# Usage +```py +from laziter import laziter +import time + +def sleeper(x): + time.sleep(2) + return x + +lz = laziter([2, 3, [range(1000), 90], 9]) + +lz2 = (lz + .flatten() + .filter(lambda a: a % 2) + .skip(998) + .take(4) + .map(lambda x: x * x) + .parmap(sleeper) +) + +print(sum(lz2)) +print(list(lz2[2:4])) +``` + +# Documentation + +[https://laziter.readthedocs.io](https://laziter.readthedocs.io) + +