infile file or - for stdin with "otpauth-migration://..." URLs separated by newlines, lines starting with # are ignored
infile 1) file or - for stdin with "otpauth-migration://..." URLs separated by newlines, lines starting with # are ignored; or 2) image file containing a QR code or = for stdin for an image containing a QR code
options:
options:
-h, --help show this help message and exit
-h, --help show this help message and exit
@ -44,7 +56,13 @@ options:
--printqr, -p print QR code(s) as text to the terminal (requires qrcode module)
--printqr, -p print QR code(s) as text to the terminal (requires qrcode module)
--saveqr DIR, -s DIR save QR code(s) as images to the given folder (requires qrcode module)
--saveqr DIR, -s DIR save QR code(s) as images to the given folder (requires qrcode module)
--verbose, -v verbose output
--verbose, -v verbose output
--quiet, -q no stdout output, except output set by -</pre>
--quiet, -q no stdout output, except output set by -
* Supports Google Authenticator exports (and compatible apps like Aegis Authenticator)
* All functionality in one Python script: extract_otp_secret_keys.py (except protobuf generated code in protobuf_generated_python)
* All functionality in one Python script: extract_otp_secret_keys.py (except protobuf generated code in protobuf_generated_python)
* Supports TOTP and HOTP
* Supports TOTP and HOTP
* Generates QR codes
* Generates QR codes
* Various export formats:
* Reads QR Code images
* Exports to various formats:
* CSV
* CSV
* JSON
* JSON
* Dedicated CSV for KeePass
* Dedicated CSV for KeePass
* QR code images
* QR code images
* Supports reading from stdin and writing to stdout by specifying '-'
* Supports reading from stdin and writing to stdout
* Reads from various import image formats containing export QR codes: (See [OpenCV docu](https://docs.opencv.org/3.4/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56))
* Portable Network Graphics - *.png
* WebP - *.webp
* JPEG files - *.jpeg, *.jpg, *.jpe
* TIFF files - *.tiff, *.tif
* Windows bitmaps - *.bmp, *.dib
* JPEG 2000 files - *.jp2
* Portable image format - *.pbm, *.pgm, *.ppm *.pxm, *.pnm
* Sun rasters - *.sr, *.ras
* OpenEXR Image files - *.exr
* Radiance HDR - *.hdr, *.pic
* Raster and Vector geospatial data supported by GDAL
* Errors and warnings are written to stderr
* Errors and warnings are written to stderr
* Many ways to run the script:
* Many ways to run the script:
* Native Python
* Native Python
@ -85,6 +174,10 @@ For printing QR codes, the qrcode module is required, otherwise it can be omitte
* VSCode devcontainer
* VSCode devcontainer
* devbox
* devbox
* pip
* pip
* Compatible with multiple platforms (tested by CI):
* [ZBar](https://github.com/mchehab/zbar) is an open source software suite for reading bar codes from various sources, including webcams.
* [ZBar](https://github.com/mchehab/zbar) is an open source software suite for reading bar codes from various sources, including webcams.
* [Aegis Authenticator](https://github.com/beemdevelopment/Aegis) is a free, secure and open source 2FA app for Android.
* [Aegis Authenticator](https://github.com/beemdevelopment/Aegis) is a free, secure and open source 2FA app for Android.
* [Android OTP Extractor](https://github.com/puddly/android-otp-extractor) can extract your tokens from popular Android OTP apps and export them in a standard format or just display them as QR codes for easy importing. [Requires a _rooted_ Android phone.]
* [Android OTP Extractor](https://github.com/puddly/android-otp-extractor) can extract your tokens from popular Android OTP apps and export them in a standard format or just display them as QR codes for easy importing. [Requires a _rooted_ Android phone.]
arg_parser.add_argument('infile',help='1) file or - for stdin with "otpauth-migration://..." URLs separated by newlines, lines starting with # are ignored; or 2) image file containing a QR code or = for stdin for an image containing a QR code',nargs='+')
arg_parser.add_argument('--json','-j',help='export json file or - for stdout',metavar=('FILE'))
arg_parser.add_argument('--json','-j',help='export json file or - for stdout',metavar=('FILE'))
arg_parser.add_argument('--csv','-c',help='export csv file or - for stdout',metavar=('FILE'))
arg_parser.add_argument('--csv','-c',help='export csv file or - for stdout',metavar=('FILE'))
arg_parser.add_argument('--keepass','-k',help='export totp/hotp csv file(s) for KeePass, - for stdout',
arg_parser.add_argument('--keepass','-k',help='export totp/hotp csv file(s) for KeePass, - for stdout',metavar=('FILE'))
metavar=('FILE'))
arg_parser.add_argument('--printqr','-p',help='print QR code(s) as text to the terminal (requires qrcode module)',action='store_true')
arg_parser.add_argument('--printqr','-p',help='print QR code(s) as text to the terminal (requires qrcode module)',
arg_parser.add_argument('--saveqr','-s',help='save QR code(s) as images to the given folder (requires qrcode module)',metavar=('DIR'))
action='store_true')
arg_parser.add_argument('--saveqr','-s',
help='save QR code(s) as images to the given folder (requires qrcode module)',