Skip to main content

Tool to generate One-Time Passwords

Project description

Tool to generate One-Time Passwords

PyPI package: myotp

If you spot any problems or have any improvement ideas then feel free to open an issue and I will be glad to look into it for you.


A recommended way of installing the tool is pip install.

Once installed, a command line tool otp should be available in your system’s PATH.

pip install

The tool is available in PyPI and can be installed using pip:

$ pip install --user myotp
$ otp --help

Manual install

Run the following command to install required Python modules:

$ git clone
$ cd otp
$ pip install --user -r requirements.txt
$ ./otp --help


$ otp --help
usage: otp [--help] [--version] key

Tool to generate One-Time Passwords

positional arguments:
  key        key or service name from ~/.otpkeys

optional arguments:
  --help     show this help message and exit
  --version  show program's version number and exit



Key file ~/.otpkeys

You can save your keys to ~/.otpkeys file using service=key format, for example:

$ cat ~/.otpkeys

Then you can generate OTP, by running:

$ otp {service}


$ otp aws

$ otp google

$ otp facebook

Auto copy OTP to clipboard (Mac OS X)

Add the following code at the end of your ~/.bashrc file (change path to otp if needed):

otp_func() {
  if code=$(/usr/local/bin/otp $1 2>&1); then
    printf "%s\n" "$code" | tee /dev/tty | pbcopy
    printf "%s\n" "$code" >&2
    return 1
alias otp='otp_func'


$ vim ~/.bashrc
$ source ~/.bashrc
$ otp cloud

At this point the above OTP should be in the clipboard.

Project details

Download files

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

Files for myotp, version 1.1.2
Filename, size File type Python version Upload date Hashes
Filename, size myotp-1.1.2-py2.py3-none-any.whl (7.5 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size myotp-1.1.2.tar.gz (4.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page