a cli app that simply generates a random 64 character alphanumeric string.
Project description
a cli app that simply generates a random 64 character alphanumeric string.
I am kind of sick and tired of not being able to generate a simple alphanumeric random string for passwords or what not without relying on a web browser.
I really like something in the terminal so that it is kind of temporary yet I can copy and paste it when I need it, and be able to simply close the terminal window when I am done.
I find it surprising that there is no simple cli app to do this… I resort to doing things like dd if=/dev/urandom count=1 | base64, but this is not ideal, it is a long command and just not very configurable. most of the time I just want a simple alphanumeric string but base64 gives all kinds of things, which is great for what it is, but not really intended for what I am doing most of the time.
so here it is, a purpose built cli app just for generating random alphanumeric strings.
install
random_cli requires python 3.6 or higher as random_cli uses the new secrets module introduced in python 3.6.
you can install random_cli with pip or from source. (or both?)
pip:
python3 -m pip install random_cli
from source:
cd /path/to/repo sudo python3 -m pip install .
usage
example:
random
gives you exactly 64 random alphanumeric characters.
you can specify the number of characters you want by passing a positive integer to the command.
for example you can generate 10 characters instead by passing 10 to the command:
random 10
development
setup virtualenv:
python3 -m venv venv source venv/bin/activate python -m pip install --upgrade pip python -m pip install -r requirements.txt
from this point we assume that python refers to python 3 in virtualenv.
to run unit test (via python 3 pytest module):
python -m pytest --flake8 -v
install pytest if you haven’t installed from requirements.txt from above:
python -m pip install pytest
to build command for testing (e.g. within virtualenv):
python setup.py develop
after which you can run it by running random in the terminal in virtualenv.
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
Hashes for random_cli-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea784cd743441a58ce2ff56d637ae273a93f45fb0d554d54dff539d5971c7847 |
|
MD5 | 795360d3f133b8d6a350c7bb10c972df |
|
BLAKE2b-256 | b3f04766408b16a04f3371411d5e4215c598c8384999e2e01e35a4e916d3d8cf |