Skip to content

Commit 022faad

Browse files
authored
Merge pull request #3 from pyper-dev/docs
Docs
2 parents 8a2913b + d5e7c25 commit 022faad

File tree

17 files changed

+687
-30
lines changed

17 files changed

+687
-30
lines changed

.github/workflows/pages.yml renamed to .github/workflows/docs.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Docs to GitHub Pages with Jekyll
1+
name: Docs
22

33
on:
44
push:
@@ -25,17 +25,23 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v4
28+
- name: Setup Ruby
29+
uses: ruby/setup-ruby@v1
30+
with:
31+
ruby-version: '3.3'
32+
bundler-cache: true
33+
cache-version: 0
2834
- name: Setup Pages
35+
id: pages
2936
uses: actions/configure-pages@v5
3037
- name: Build with Jekyll
31-
uses: actions/jekyll-build-pages@v1
32-
with:
33-
source: ./docs
34-
destination: ./_site
38+
# Outputs to the './_site' directory by default
39+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
40+
env:
41+
JEKYLL_ENV: production
3542
- name: Upload artifact
3643
uses: actions/upload-pages-artifact@v3
3744

38-
# Deployment job
3945
deploy:
4046
environment:
4147
name: github-pages

.github/workflows/test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ on:
77
paths:
88
- "src/pyper/**"
99
- "tests/**"
10-
pull_request:
11-
branches:
12-
- main
13-
paths:
14-
- "src/pyper/**"
15-
- "tests/**"
1610

1711
jobs:
1812
test:

README.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
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

5149
Let's simulate a pipeline that performs a series of transformations on some data.
5250

@@ -87,10 +85,7 @@ async def print_sum(data):
8785

8886
async 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)
125120
async 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
134129
async 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

267262
def 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

docs/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
_site/
2+
.sass-cache/
3+
.jekyll-cache/
4+
.jekyll-metadata
5+
6+
.bundle/
7+
vendor/
8+
9+
# GitHub pages does not need the lock file
10+
Gemfile.lock

docs/Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source 'https://rubygems.org'
2+
3+
gem "jekyll", "~> 4.3.4" # installed by `gem jekyll`
4+
gem "just-the-docs", "0.10.0" # pinned to the current release
5+
6+
# Performance-booster for watching directories on Windows
7+
gem "wdm", "~> 0.1", :platforms => [:mingw, :x64_mingw, :mswin]

docs/_config.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
title: Pyper Docs
2+
description: Concurrent Python made simple
3+
theme: just-the-docs
4+
5+
url: https://pyper-dev.github.io/pyper
6+
source: src
7+
8+
color_scheme: dark
9+
10+
logo: "/assets/img/pyper.png"
11+
favicon_ico: "/assets/img/favicon.ico"
12+
search_enabled: true
13+
nav_enabled: true
14+
15+
search:
16+
heading_level: 2
17+
previews: 3
18+
preview_words_before: 5
19+
preview_words_after: 10
20+
tokenizer_separator: /[\s/]+/
21+
rel_url: true
22+
button: false
23+
focus_shortcut_key: 'k'
24+
25+
# Aux links for the upper right navigation
26+
aux_links:
27+
"GitHub":
28+
- "//github.com/pyper-dev/pyper"
29+
aux_links_new_tab: true
30+
31+
callouts:
32+
info:
33+
title: Info
34+
color: blue
35+
warning:
36+
title: Warning
37+
color: yellow

docs/src/404.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: default
3+
permalink: /404.html
4+
---
5+
6+
# 404
7+
8+
This page wasn't found

docs/src/assets/img/favicon.ico

188 KB
Binary file not shown.

docs/src/assets/img/pyper.png

30.8 KB
Loading
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: API Reference
3+
nav_order: 4
4+
layout: page
5+
---
6+
7+
# API Reference
8+
9+
All pipelines in Pyper are created with the `pyper.task` decorator.
10+
11+
See [Task Parameters](../UserGuide/TaskParameters)

0 commit comments

Comments
 (0)