pyshuf2
An inexact clone of GNU shuf. Free, implemented in Python.
Install
pyshuf2 can be installed via pip:
pip install pyshuf2
If you are installing the development version, just clone the repo & run this inside the cloned directory:
pip install -e .
This will also allow you to edit the program and then re-run it without reinstalling.
Usage
Same as shuf, but the script is invoked with pyshuf2. Read the GNU manual for shuf for more details.
"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 implemented
--e, --echo
-i, --input-range
-n, --head-count
-o, --output-file
Features not implemented
--random-source
-r, --repeat
-z, --zero-terminated
Features added that are not present 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.
Metadata
Release files for pyshuf2 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyshuf2-2.1.0.tar.gz | 15.8 kB | Without provenance | Details for pyshuf2-2.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyshuf2-2.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyshuf2-2.1.0-py3-none-any.whl |
Total release size: 32.0 kB
Release files / pyshuf2-2.1.0.tar.gz
| Download URL | pyshuf2-2.1.0.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f691a63cffbdd7cbd191fb699441765344955a1e50f0ff32afb6964650c3f6f
|
|
BLAKE2b-256 checksum How to use checksums |
eb312f77c15fe1ab36cfa6d30907a661d0b50b40aca49a6d3517abf0936d53f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / pyshuf2-2.1.0-py3-none-any.whl
| Download URL | pyshuf2-2.1.0-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6ce708442ca87153e708d4d631b47e1bd83ca57acb4a334664340aef63f0fd4
|
|
BLAKE2b-256 checksum How to use checksums |
fc8372ca78569efc8a19d5fef5f81fc2e33d4d695b9ab727a98d754c481f9e34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for pyshuf2 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.