Skip to main content

No project description provided

Project description

WordFlow

WordFlow provides several simplified command-line utilities meant to be composed with UNIX pipes. This package is part of Making With Code, 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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordflow-0.2.6.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordflow-0.2.6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file wordflow-0.2.6.tar.gz.

File metadata

  • Download URL: wordflow-0.2.6.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wordflow-0.2.6.tar.gz
Algorithm Hash digest
SHA256 3d2d57fb96f0373215c6275342f432773c1b2874763704f1a31c208a6659956b
MD5 b5a20e1cdbfa640d42c2774fa2ff4372
BLAKE2b-256 d47d84a8f432962f084678e7813c0e443431e2578dac319c60dbf0fdd1451c30

See more details on using hashes here.

File details

Details for the file wordflow-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: wordflow-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.4 {"installer":{"name":"uv","version":"0.11.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wordflow-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5efc591fb213f4fc7063949410e2539ada07b2b2fc04b6b00201b51c0335e24f
MD5 cc0123255c3bd0dd3c9349048b64ae2d
BLAKE2b-256 6354d7e71002d5bb04214b8fbee36a0840f4dafebc1e46fd86a3178d2c904831

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page