Metadata-Version: 2.1
Name: ppotp
Version: 2.0.0
Summary: Tool to generate One-Time Passwords
Home-page: https://github.com/peterpakos/ppotp
Author: Peter Pakos
Author-email: peter.pakos@wandisco.com
License: GPLv3
Keywords: otp one time password generator auth
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Topic :: System :: Systems Administration :: Authentication/Directory
Requires-Dist: pyotp
Requires-Dist: pplogger

ppotp
=====

Tool to generate One-Time Passwords

PyPI package: `ppotp <https://pypi.python.org/pypi/ppotp>`__

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.

Installation
------------

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 ppotp
   $ otp --help

Usage
-----

::

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

   Tool to generate One-Time Passwords

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

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

Examples
--------

::

   $ otp BEXUS3AVCUU7HYU4OZQ44WFXMULPNQB2TKQ4YCNUASPXMPEH6YAZ3IACFM5VEGUQ
   770400

.. _key-file-~/.otpkeys:

Key file ~/.otpkeys
-------------------

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

::

   $ cat ~/.otpkeys
   aws=N5VEJBTUA553BYJTTTUGS3GANKVDECG62RHVIOV2FLYR5THC726ZOIOF4SQZZ5NV
   google=QYDL7HS7LHPVKX7GGYKYIP3UEYOML2IENWYQD5NHYGETBZIRWWODKQWC3PRNQ3FO
   facebook=ZBSLA3KGE4PEXCEGIJ57AKJLOHW2S3ABQNOOWZVV3HOO4Q3455BOG6BRNU5M2QK4

Then you can generate OTP, by running:

::

   $ otp {service}

Example:

::

   $ otp aws
   443782

   $ otp google
   760698

   $ otp facebook
   009176

.. _auto-copy-otp-to-clipboard-(mac-os-x):

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
       return 0
     else
       printf "%s\\n" "$code" >&2
       return 1
     fi
   }
   alias otp='otp_func'

Example:

::

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

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


