An attempt to bugfix an inexact python clone of GNU shuf and bring it into the modern Python 3 era.
Project description
pyshuf2
An inexact clone of GNU shuf. Free, implemented in Python.
Install
Usage
Same as shuf, but the script is invoked with pyshuf2. Read the GNU manual for shuf for more details. I created this fork because I needed it on an embedded system that ran an extremely limited copy of Linux, on 128 MB of RAM, and had only 16 GB of storage.
"Cookbook"
Generate a random number from 0 to 99
$ pyshuf2 -i 0-99 -n 1
73
Pick a random word from the dictionary (dictionary location may vary)
$ pyshuf2 --input-file /usr/share/dict/words -n 1
irreflectiveness
Shuffle the first 10 words from the dictionary
$ head /usr/share/dict/words | pyshuf2
aardvark
aalii
Aaron
a
aa
Aani
aam
aardwolf
A
aal
Use input from the command line
pyshuf2: error: argument -e/--echo: ignored explicit argument 'cho'
$ pyshuf2 --echo one two three four five
four
two
three
one
five
Features I implemented
--e, --echo
-i, --input-range
-n, --head-count
Features I have not implemented
-o, --output-file
--random-source
-r, --repeat
-z, --zero-terminated
Features I added that are not in GNU shuf
--input-file specify an input file to read from
This is a Fork
Please note that this is a fork of jakekara/pyshuf.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyshuf2-2.0.0.post1.tar.gz.
File metadata
- Download URL: pyshuf2-2.0.0.post1.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f56f4ea9e539d75e3b812c6b84cc5ac3972f8a0f619a2dd8d81e9dc8cb329eaf
|
|
| MD5 |
5083f3752f04e37e2c2e1c793f75bbf5
|
|
| BLAKE2b-256 |
8d578aa26dacde0b8a358e080548a38680873ccadfaffe2c7f0a27478f013592
|
File details
Details for the file pyshuf2-2.0.0.post1-py3-none-any.whl.
File metadata
- Download URL: pyshuf2-2.0.0.post1-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
720af1dabad721ece5e41169f35bac62a1af36886e44d96b4d59baf0e9a01da0
|
|
| MD5 |
ca8f16d79d080e1e6b92a4fdb9a1fa23
|
|
| BLAKE2b-256 |
34a80c650aea08584d8f650f1c5a90dce0cc42f6e8f941901fdf143a03ce3422
|