Name | wordflow JSON |
Version |
0.2.4
JSON |
| download |
home_page | |
Summary | |
upload_time | 2023-07-03 00:51:29 |
maintainer | |
docs_url | None |
author | Chris Proctor |
requires_python | >=3.10,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# WordFlow
WordFlow provides several simplified command-line utilities meant to be
composed with UNIX pipes. This package is part of
[Making With Code](https://makingwithcode.org), a
Constructionist introductory CS curriculum. Most of these utilities duplicate
existing functionality of built-in shell commands, but our goal is to provide the
cleanest, simplest possible interface to maximize expressivity while minimizing cognitive
load for beginners.
These utilities read lines of space-separated tokens from stdin and write to
stdout. Several commands have an optional `position` argument (default=0) specifying
which token to use on each line.
## Usage examples
First, get ahold of a file containing a list of words. A word list is [built in to Unix and Linux](https://en.wikipedia.org/wiki/Words_(Unix). Or [here's a list you can download](https://github.com/dwyl/english-words/blob/master/words_alpha.txt).
### Get the 1000 most common words
```
$ cat words.txt | frequency | order | pluck 1 | head -n 1000
```
### How many words contain two vowels in a row
```
$ cat words.txt | match "aa|ee|ii|oo|uu" | count
```
### What's the shortest word containing all five vowels?
```
$ cat words.txt | match "a" | match "e" | match "i" | match "o" | match "u" | length | order | head
```
## What are the most common ten-letter words?
```
$ cat words.txt | length | put 10 | equal | frequency 2 | order -r | pluck 3 | head
```
## What's the longest word which contains no repeated letters?
```
$ cat words.txt | length | unique 1 | length | lessthan 0 1 -e | lessthan 1 0 -e |
```
### Filter
- **match [pattern] [position=0]**: Allows lines where the specified word matches
regular expression `pattern`. Regular expressions often need to be in quotation marks.
- **lessthan [position0=0] [position1=1] [-e --equal]**: Allows lines where the number at
position 0 is less than the number at position 1. When `--equal`, lines are also
allowed when the two numbers are equal.
- **equal [position0=0] [position1=1]**: Allows lines where the number at position 0
is equal to the number at position 1.
### Map
- **put [value]** Prepends the value to each line.
- **length [position=0]** Prepends the length of the specified word to the line.
- **frequency [position=0]** Prepends the frequency of the specified word
(approximate number of occurrences per billion words) to the line.
- **pluck [position=0]** Replaces each line with the specified token.
### Sort
- **order [position=0] [-r --reverse]** Sorts lines according to the specified token.
When the specified token is a number, sorts numerically, otherwise lexically.
### Reduce
- **count** counts the number of lines sent to stdin.
Raw data
{
"_id": null,
"home_page": "",
"name": "wordflow",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Chris Proctor",
"author_email": "github.com@accounts.chrisproctor.net",
"download_url": "https://files.pythonhosted.org/packages/17/1d/50912a7ef03c735fb7a0178d1d8f1919992628e2df2897ab47b146850df1/wordflow-0.2.4.tar.gz",
"platform": null,
"description": "# WordFlow\n\nWordFlow provides several simplified command-line utilities meant to be \ncomposed with UNIX pipes. This package is part of \n[Making With Code](https://makingwithcode.org), a \nConstructionist introductory CS curriculum. Most of these utilities duplicate\nexisting functionality of built-in shell commands, but our goal is to provide the \ncleanest, simplest possible interface to maximize expressivity while minimizing cognitive\nload for beginners.\n\nThese utilities read lines of space-separated tokens from stdin and write to \nstdout. Several commands have an optional `position` argument (default=0) specifying\nwhich token to use on each line. \n\n## Usage examples\n\nFirst, get ahold of a file containing a list of words. A word list is [built in to Unix and Linux](https://en.wikipedia.org/wiki/Words_(Unix). Or [here's a list you can download](https://github.com/dwyl/english-words/blob/master/words_alpha.txt).\n\n### Get the 1000 most common words\n\n```\n$ cat words.txt | frequency | order | pluck 1 | head -n 1000\n```\n\n### How many words contain two vowels in a row\n\n```\n$ cat words.txt | match \"aa|ee|ii|oo|uu\" | count\n```\n\n### What's the shortest word containing all five vowels? \n\n```\n$ cat words.txt | match \"a\" | match \"e\" | match \"i\" | match \"o\" | match \"u\" | length | order | head\n```\n\n## What are the most common ten-letter words? \n\n```\n$ cat words.txt | length | put 10 | equal | frequency 2 | order -r | pluck 3 | head\n```\n\n## What's the longest word which contains no repeated letters? \n\n```\n$ cat words.txt | length | unique 1 | length | lessthan 0 1 -e | lessthan 1 0 -e | \n```\n\n### Filter\n\n- **match [pattern] [position=0]**: Allows lines where the specified word matches\n regular expression `pattern`. Regular expressions often need to be in quotation marks.\n- **lessthan [position0=0] [position1=1] [-e --equal]**: Allows lines where the number at \n position 0 is less than the number at position 1. When `--equal`, lines are also \n allowed when the two numbers are equal.\n- **equal [position0=0] [position1=1]**: Allows lines where the number at position 0 \n is equal to the number at position 1.\n\n### Map \n\n- **put [value]** Prepends the value to each line.\n- **length [position=0]** Prepends the length of the specified word to the line.\n- **frequency [position=0]** Prepends the frequency of the specified word \n (approximate number of occurrences per billion words) to the line. \n- **pluck [position=0]** Replaces each line with the specified token.\n\n### Sort\n\n- **order [position=0] [-r --reverse]** Sorts lines according to the specified token. \n When the specified token is a number, sorts numerically, otherwise lexically. \n\n### Reduce\n\n- **count** counts the number of lines sent to stdin.\n",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.2.4",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "99ac797a9976ff7cd3761dd5b87ca62d2e89fe73b3a93eecd0c982e84c751581",
"md5": "2636cb9d23f118cd08b64dc5792f0783",
"sha256": "508f4a9cdea5f1760765de8a34bd8a6a5eb8d17f6f416b53c05585305b14c4c9"
},
"downloads": -1,
"filename": "wordflow-0.2.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2636cb9d23f118cd08b64dc5792f0783",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 9044,
"upload_time": "2023-07-03T00:51:28",
"upload_time_iso_8601": "2023-07-03T00:51:28.127164Z",
"url": "https://files.pythonhosted.org/packages/99/ac/797a9976ff7cd3761dd5b87ca62d2e89fe73b3a93eecd0c982e84c751581/wordflow-0.2.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "171d50912a7ef03c735fb7a0178d1d8f1919992628e2df2897ab47b146850df1",
"md5": "1670b123256b8c8dddbeba6bc6d3e5ac",
"sha256": "55d9bff0c75c314592902304ed7c789e0c70854c43e4c1d1daa3aa6b7d3b8530"
},
"downloads": -1,
"filename": "wordflow-0.2.4.tar.gz",
"has_sig": false,
"md5_digest": "1670b123256b8c8dddbeba6bc6d3e5ac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 5509,
"upload_time": "2023-07-03T00:51:29",
"upload_time_iso_8601": "2023-07-03T00:51:29.325960Z",
"url": "https://files.pythonhosted.org/packages/17/1d/50912a7ef03c735fb7a0178d1d8f1919992628e2df2897ab47b146850df1/wordflow-0.2.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-03 00:51:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "wordflow"
}