11<p align =" center " >
2- <img src =" https://raw.githubusercontent.com/pyper-dev/pyper/refs/heads/main/assets/pyper.png " alt =" Pyper " style =" width : 500px ;" >
2+ <img src =" https://raw.githubusercontent.com/pyper-dev/pyper/refs/heads/main/docs/src/ assets/img /pyper.png " alt =" Pyper " style =" width : 500px ;" >
33</p >
44<p align =" center " style =" font-size : 1.5em ;" >
55 <em>Concurrent Python made simple</em>
66</p >
77
8- </p >
9-
108<p align =" center " >
119<a href =" https://github.com/pyper-dev/pyper/actions/workflows/test.yml " target =" _blank " >
1210 <img src="https://github.com/pyper-dev/pyper/actions/workflows/test.yml/badge.svg" alt="Test">
@@ -44,9 +42,9 @@ Install the latest version using `pip`:
4442$ pip install python-pyper
4543```
4644
47- ( Note that ` python-pyper ` is the pypi registered package)
45+ Note that ` python-pyper ` is the [ pypi] ( https://pypi.org/project/python-pyper ) registered package.
4846
49- ## Example
47+ ## Usage
5048
5149Let's simulate a pipeline that performs a series of transformations on some data.
5250
@@ -87,10 +85,7 @@ async def print_sum(data):
8785
8886async def main ():
8987 # Define a pipeline of tasks using `pyper.task`
90- run = task(step1) \
91- >> task(step2, concurrency = 20 ) \
92- >> task(step3, concurrency = 20 ) \
93- & print_sum
88+ run = task(step1) | task(step2, concurrency = 20 ) | task(step3, concurrency = 20 ) > print_sum
9489 await run(limit = 20 )
9590
9691
@@ -121,7 +116,7 @@ Having defined the logical operations we want to perform on our data as function
121116
122117``` python
123118# Analogous to:
124- # pipeline = task(step1) >> task(step2) >> task(step3)
119+ # pipeline = task(step1) | task(step2) | task(step3)
125120async def pipeline (limit ):
126121 for data in step1(limit):
127122 data = await step2(data)
@@ -130,7 +125,7 @@ async def pipeline(limit):
130125
131126
132127# Analogous to:
133- # run = pipeline & print_sum
128+ # run = pipeline > print_sum
134129async def run (limit ):
135130 await print_sum(pipeline(limit))
136131
@@ -139,7 +134,7 @@ async def main():
139134 await run(20 ) # takes ~40 seconds
140135```
141136
142- Pyper uses the ` >> ` syntax as an intuitive representation of this input-output piping between tasks.
137+ Pyper uses the ` | ` (motivated by Unix's pipe operator) syntax as a representation of this input-output piping between tasks.
143138
144139</details >
145140
@@ -266,9 +261,9 @@ def print_sum(data):
266261
267262def main ():
268263 run = task(step1) \
269- >> task(step2, concurrency = 20 ) \
270- >> task(step3, concurrency = 20 ) \
271- & print_sum
264+ | task(step2, concurrency = 20 ) \
265+ | task(step3, concurrency = 20 ) \
266+ > print_sum
272267 # Run synchronously
273268 run(limit = 20 )
274269
@@ -283,9 +278,7 @@ A pipeline consisting of _at least one asynchronous function_ becomes an `AsyncP
283278
284279## Examples
285280
286- To explore more of Pyper's features, see some real-world examples below:
287-
288- 1 . (_ to do_ )
281+ To explore more of Pyper's features, see some further [ examples] ( https://pyper-dev.github.io/pyper/docs/Examples )
289282
290283## Dependencies
291284
0 commit comments