py-oathtool2


Namepy-oathtool2 JSON
Version 1.3.0 PyPI version JSON
download
home_pageNone
SummaryA Python script for generating OTP codes
upload_time2024-10-31 06:47:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py_oathtool2

py_oathtool2 is a Python script for easy OTP code generation on the command line for use with scripting or simply as a convenience. It is a maintained fork of https://github.com/matalo33/py_oathtool.

## Installation

`pip install py_oathtool2`

## Dependencies

`py_oathtool2` automatically copies codes to the clipboard. This depends on the following programs being installed:

* Linux with X11: `xclip`
* Linux with Wayland: `wl-copy`
* MacOS: `pbcopy` (installed by default)

## Configuration

Two pieces of information are required for each account:

* An account name / label
* Your 64 character oath secret provided by the 3rd party. This is typically a QR code, but websites often also offer the string.

The script will read these values from a config file sourced from, by default, `~/.otp-secrets.yaml` in the following format:
```
otpsecrets:
  github: IOOVV6U5AUHUISZKJNVCCG4JWUR5XDFSI7ND62A7QT5ZOEVYVA7JEEDKTG3ZM57B
  aws-account-dev: XQYNZOIA4PWCTJCB9654EQP5LUIP23BOW6J5ZIRZZSDHK24AUEDUSCONP3KQQY4N
  aws-account-prod: 57QPXJFJ4D2ILQBRZGSHKAZCJ2Y46C52FGVSZRYMY7UMWTIQI6I3GOJQZ4VJN2R4
```

Additionally, the following configuration options are supported in the `~/.otp-secrets.yaml` file:

* `holdoff`: Specify a different holdoff value to wait for the next code
* `use_clipboard`: Disable putting the code on the clipboard

## Usage

List all configured accounts with `-l`:
```
$ otp -l
github
aws-account-dev
aws-account-prod
```

Generate an OTP by providing the account name. The script will provide the OTP code and also put it on the clipboard:
```
$ otp aws-account-dev
129987 (10sec)
```

See all arguments with:
```
$ otp --help
```

## Shell Autocompletion

Autocompletion support can be added through use of the `-t` or `-l` flags. The former space-delimits accounts and the latter by newlines.


### zsh

For zsh support, add the following to your `.zshrc` file:

```
compdef _otp otp
_otp() {
    compadd `otp -t`
}
```

### fish

For fish support, add the following to your `config.fish`:

```
complete --command otp --no-files --arguments "(otp -l)"
```

## Development

After cloning use `pipenv` to install dependencies and run the script:

```
pipenv install
pipenv run python src/py_oathtool2/otp.py [args]
```

### Running Tests

```
pipenv run python -m unittest test/test_otp.py
```

### Building & Installing Locally

```
pipenv run python -m build
pip install --force-reinstall dist/py_oathtool2-*.whl
```

### Upload to PyPI

```
rm dist/*
pipenv run python -m build
pipenv run python -m twine upload --config-file ~/.pypirc dist/*
```

## Disclaimer

Two factor auth is meant to provide an extra layer of account security and this tool does not exactly promote that concept. You are responsible for taking reasonable steps to protect your secrets file to prevent loss of secrets, and perhaps this is not the ideal two factor solution for your most important accounts.

## License

GPLv2

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "py-oathtool2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Matthew Taylor <matthew@m-taylor.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/56/90/35557549faa57850d06f91873330475986c95bfa692d10690c9ecfe7292d/py_oathtool2-1.3.0.tar.gz",
    "platform": null,
    "description": "# py_oathtool2\n\npy_oathtool2 is a Python script for easy OTP code generation on the command line for use with scripting or simply as a convenience. It is a maintained fork of https://github.com/matalo33/py_oathtool.\n\n## Installation\n\n`pip install py_oathtool2`\n\n## Dependencies\n\n`py_oathtool2` automatically copies codes to the clipboard. This depends on the following programs being installed:\n\n* Linux with X11: `xclip`\n* Linux with Wayland: `wl-copy`\n* MacOS: `pbcopy` (installed by default)\n\n## Configuration\n\nTwo pieces of information are required for each account:\n\n* An account name / label\n* Your 64 character oath secret provided by the 3rd party. This is typically a QR code, but websites often also offer the string.\n\nThe script will read these values from a config file sourced from, by default, `~/.otp-secrets.yaml` in the following format:\n```\notpsecrets:\n  github: IOOVV6U5AUHUISZKJNVCCG4JWUR5XDFSI7ND62A7QT5ZOEVYVA7JEEDKTG3ZM57B\n  aws-account-dev: XQYNZOIA4PWCTJCB9654EQP5LUIP23BOW6J5ZIRZZSDHK24AUEDUSCONP3KQQY4N\n  aws-account-prod: 57QPXJFJ4D2ILQBRZGSHKAZCJ2Y46C52FGVSZRYMY7UMWTIQI6I3GOJQZ4VJN2R4\n```\n\nAdditionally, the following configuration options are supported in the `~/.otp-secrets.yaml` file:\n\n* `holdoff`: Specify a different holdoff value to wait for the next code\n* `use_clipboard`: Disable putting the code on the clipboard\n\n## Usage\n\nList all configured accounts with `-l`:\n```\n$ otp -l\ngithub\naws-account-dev\naws-account-prod\n```\n\nGenerate an OTP by providing the account name. The script will provide the OTP code and also put it on the clipboard:\n```\n$ otp aws-account-dev\n129987 (10sec)\n```\n\nSee all arguments with:\n```\n$ otp --help\n```\n\n## Shell Autocompletion\n\nAutocompletion support can be added through use of the `-t` or `-l` flags. The former space-delimits accounts and the latter by newlines.\n\n\n### zsh\n\nFor zsh support, add the following to your `.zshrc` file:\n\n```\ncompdef _otp otp\n_otp() {\n    compadd `otp -t`\n}\n```\n\n### fish\n\nFor fish support, add the following to your `config.fish`:\n\n```\ncomplete --command otp --no-files --arguments \"(otp -l)\"\n```\n\n## Development\n\nAfter cloning use `pipenv` to install dependencies and run the script:\n\n```\npipenv install\npipenv run python src/py_oathtool2/otp.py [args]\n```\n\n### Running Tests\n\n```\npipenv run python -m unittest test/test_otp.py\n```\n\n### Building & Installing Locally\n\n```\npipenv run python -m build\npip install --force-reinstall dist/py_oathtool2-*.whl\n```\n\n### Upload to PyPI\n\n```\nrm dist/*\npipenv run python -m build\npipenv run python -m twine upload --config-file ~/.pypirc dist/*\n```\n\n## Disclaimer\n\nTwo factor auth is meant to provide an extra layer of account security and this tool does not exactly promote that concept. You are responsible for taking reasonable steps to protect your secrets file to prevent loss of secrets, and perhaps this is not the ideal two factor solution for your most important accounts.\n\n## License\n\nGPLv2\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python script for generating OTP codes",
    "version": "1.3.0",
    "project_urls": {
        "Homepage": "https://github.com/shanet/py_oathtool",
        "Issues": "https://github.com/shanet/py_oathtool/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "385b794358af39193a80106b9fd7567c94f2f6ea0a81a01f974ce545fe3eb27f",
                "md5": "c47c6550d1add3f86db4658938ad0c29",
                "sha256": "f7dbe26a7099d1452c19c6f22fe5cc9cced97e1724ae65d880c1364d297ca290"
            },
            "downloads": -1,
            "filename": "py_oathtool2-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c47c6550d1add3f86db4658938ad0c29",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12386,
            "upload_time": "2024-10-31T06:47:43",
            "upload_time_iso_8601": "2024-10-31T06:47:43.503510Z",
            "url": "https://files.pythonhosted.org/packages/38/5b/794358af39193a80106b9fd7567c94f2f6ea0a81a01f974ce545fe3eb27f/py_oathtool2-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "569035557549faa57850d06f91873330475986c95bfa692d10690c9ecfe7292d",
                "md5": "09f21d0a57af5d4c1251175bc1ad055d",
                "sha256": "8081513ba25c7756cee5523196f21840fd602aec7cda544bfb1d4c04353cf7ef"
            },
            "downloads": -1,
            "filename": "py_oathtool2-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "09f21d0a57af5d4c1251175bc1ad055d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 12233,
            "upload_time": "2024-10-31T06:47:44",
            "upload_time_iso_8601": "2024-10-31T06:47:44.629305Z",
            "url": "https://files.pythonhosted.org/packages/56/90/35557549faa57850d06f91873330475986c95bfa692d10690c9ecfe7292d/py_oathtool2-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-31 06:47:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shanet",
    "github_project": "py_oathtool",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "py-oathtool2"
}
        
Elapsed time: 0.31722s