Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Add editorconfig
Add gitignore
Add VSCode settings
Add License
Add workflow files
Add screencast
Add other icons
Add screenshot
Add README
  • Loading branch information
otherguy committed Jul 26, 2018
1 parent 4646987 commit 0181964
Show file tree
Hide file tree
Showing 18 changed files with 443 additions and 96 deletions.
45 changes: 45 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/python:2.7

working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: install dependencies
command: |
python2.7 -m virtualenv .venv
. .venv/bin/activate
pip install -r requirements.txt
- save_cache:
paths:
- ./venv
key: v1-dependencies-{{ checksum "requirements.txt" }}

# run tests!
- run:
name: run tests
command: |
. .venv/bin/activate
python -m unittest discover --start-directory tests
- store_artifacts:
path: test-reports
destination: test-reports

27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.py]
max_line_length = 160

[*.json]
insert_final_newline = ignore

# Makefiles always use tabs for indentation
[Makefile]
indent_style = tab

# Batch files use tabs for indentation
[*.bat]
indent_style = tab

[docs/**.txt]
max_line_length = 79
104 changes: 8 additions & 96 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,102 +3,14 @@ __pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
# dotenv
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site
# virtualenv
.venv

# mypy
.mypy_cache/
# Project specific
/lib
/workflow
/Alfred_Workflow-*
*.alfredworkflow
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "${workspaceFolder}/.venv/bin/python"
}
25 changes: 25 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
The MIT License (MIT)
=====================

Copyright © `2018` `Alexander Graf`

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
78 changes: 78 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Generate Passwords Workflow 🔐 for [Alfred 3](http://www.alfredapp.com)

[![Latest Version](https://img.shields.io/github/tag/otherguy/alfred-generate-password-workflow.svg?style=flat-square&label=release)](https://github.com/otherguy/alfred-generate-password-workflow/tags)
[![Downloads](https://img.shields.io/github/downloads/otherguy/alfred-generate-password-workflow/total.svg?style=flat-square)](https://github.com/otherguy/alfred-generate-password-workflow/releases)
[![Circle CI](https://img.shields.io/circleci/project/github/otherguy/alfred-generate-password-workflow/master.svg?style=flat-square)](https://circleci.com/gh/otherguy/alfred-generate-password-workflow/tree/master)
[![Issues](https://img.shields.io/github/issues/otherguy/alfred-generate-password-workflow.svg?style=flat-square)](https://github.com/otherguy/alfred-generate-password-workflow/issues)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.md)
[![Beerpay](https://img.shields.io/beerpay/otherguy/alfred-generate-password-workflow.svg?style=flat-square)](https://beerpay.io/otherguy/alfred-generate-password-workflow)

A workflow for [Alfred 3](http://www.alfredapp.com) that helps you to quickly and securely generate random passwords of any given length.

By default, it generates both an alphanumeric password and a strong password, containing special characters. As a bonus, it also generates [XKCD passwords](https://xkcd.com/936/) with 3 and 4 words.

Selecting the generated password copies it to the clipboard.

![Example Screencast](resources/screencast-1.gif)

The latest version can be found here as well:

* https://www.alfredforum.com/topic/10546-airports/
* https://www.alfredforum.com/topic/11717-generate-passwords-workflow/

## Installation

Download the latest version of the `Genererate Passwords.alfredworkflow` from the [Releases](https://github.com/otherguy/alfred-generate-password-workflow/releases) page and double click the downloaded file to install it.

The workflow supports automatic updates and will perform daily update checks.

## Caveats and Requirements

This workflow requires [Alfred 3](https://www.alfredapp.com) and won’t run on **Snow Leopard (10.6)** or lower.

## Usage

The default keyword is `pw`. The first and only parameter is the desired password length, defaulting to 10.

When hitting `⏎ Return` on a selected item, the generated password is copied to the clipboard.

## `TODO` / Future Work

* Add possibility to change default options

## Developers

If you want to contribute, fork this repository and submit a pull request.

To make the project work locally on your machine, check out the repository and issue the following commands:

$ pip install --ignore-installed --target=. Alfred-Workflow==1.36
$ pip install --ignore-installed --target=lib -r requirements.txt

Alternatively, if you would rather work with a virtual environment, run these commands:

$ virtualenv --python=python2.7 .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt

To run the script in the terminal, simply do:

$ python pwgen.py

You can install `jq` from [Homebrew](https://brew.sh) and pipe the output of the workflow through this program to get nice formatting and the option to query the JSON.

## Acknowledgements

The following resources were used when creating this workflow:

* The excellent [Alfred-Workflow](https://github.com/deanishe/alfred-workflow) python library by [Dean Jackson](https://github.com/deanishe).
* The lock icon used in the workflow by [Pixel perfect](https://www.flaticon.com/authors/pixel-perfect) and licensed under [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/).
* The [`xkcdpass`](https://pypi.org/project/xkcdpass/) Python library for generating [XKCD passwords](https://xkcd.com/936/)

A big ♥️ _thank you_ to all creators!

## Support on Beerpay

If this is useful to you in any way or you end up building it yourself, you could buy me a beer!

[![Beerpay](https://beerpay.io/otherguy/alfred-generate-password-workflow/badge.svg?style=beer-square)](https://beerpay.io/otherguy/alfred-generate-password-workflow) [![Beerpay](https://beerpay.io/otherguy/alfred-generate-password-workflow/make-wish.svg?style=flat-square)](https://beerpay.io/otherguy/alfred-generate-password-workflow?focus=wish)
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0181964

Please sign in to comment.