|
| 1 | +Metadata-Version: 2.0 |
| 2 | +Name: Alfred-Workflow |
| 3 | +Version: 1.28.1 |
| 4 | +Summary: Full-featured helper library for writing Alfred 2/3 workflows |
| 5 | +Home-page: http://www.deanishe.net/alfred-workflow/ |
| 6 | +Author: Dean Jackson |
| 7 | +Author-email: deanishe@deanishe.net |
| 8 | +License: UNKNOWN |
| 9 | +Keywords: alfred workflow |
| 10 | +Platform: UNKNOWN |
| 11 | +Classifier: Development Status :: 5 - Production/Stable |
| 12 | +Classifier: License :: OSI Approved :: MIT License |
| 13 | +Classifier: Operating System :: MacOS :: MacOS X |
| 14 | +Classifier: Intended Audience :: Developers |
| 15 | +Classifier: Natural Language :: English |
| 16 | +Classifier: Programming Language :: Python :: 2.6 |
| 17 | +Classifier: Programming Language :: Python :: 2.7 |
| 18 | +Classifier: Topic :: Software Development :: Libraries |
| 19 | +Classifier: Topic :: Software Development :: Libraries :: Application Frameworks |
| 20 | + |
| 21 | +A helper library for writing `Alfred 2 and 3`_ workflows. |
| 22 | + |
| 23 | +Supports macOS 10.6+ and Python 2.6 and 2.7 (Alfred 3 is 10.9+/2.7 only). |
| 24 | + |
| 25 | +Alfred-Workflow is designed to take the grunt work out of writing a workflow. |
| 26 | + |
| 27 | +It gives you the tools to create a fast and featureful Alfred workflow from an API, application or library in minutes. |
| 28 | + |
| 29 | +http://www.deanishe.net/alfred-workflow/ |
| 30 | + |
| 31 | + |
| 32 | +Features |
| 33 | +======== |
| 34 | + |
| 35 | +* Catches and logs workflow errors for easier development and support |
| 36 | +* "Magic" arguments to help development/debugging |
| 37 | +* Auto-saves settings |
| 38 | +* Super-simple data caching |
| 39 | +* Fuzzy, Alfred-like search/filtering with diacritic folding |
| 40 | +* Keychain support for secure storage (and syncing) of passwords, API keys etc. |
| 41 | +* Simple generation of Alfred feedback (XML output) |
| 42 | +* Input/output decoding for handling non-ASCII text |
| 43 | +* Lightweight web API with modelled on `requests`_ |
| 44 | +* Pre-configured logging |
| 45 | +* Painlessly add directories to ``sys.path`` |
| 46 | +* Easily launch background tasks (daemons) to keep your workflow responsive |
| 47 | +* Check for new versions and update workflows hosted on GitHub. |
| 48 | +* Post notifications via Notification Center. |
| 49 | + |
| 50 | + |
| 51 | +Alfred 3-only features |
| 52 | +---------------------- |
| 53 | + |
| 54 | +* Set `workflow variables`_ from code |
| 55 | +* Advanced modifiers |
| 56 | +* Alfred 3-only updates (won't break Alfred 2 installs) |
| 57 | +* Re-running Script Filters |
| 58 | + |
| 59 | + |
| 60 | +Quick Example |
| 61 | +============= |
| 62 | + |
| 63 | +Here's how to show recent `Pinboard.in <https://pinboard.in/>`_ posts |
| 64 | +in Alfred. |
| 65 | + |
| 66 | +Create a new workflow in Alfred's preferences. Add a **Script Filter** with |
| 67 | +Language ``/usr/bin/python`` and paste the following into the **Script** |
| 68 | +field (changing ``API_KEY``): |
| 69 | + |
| 70 | + |
| 71 | +.. code-block:: python |
| 72 | + |
| 73 | + import sys |
| 74 | + from workflow import Workflow, ICON_WEB, web |
| 75 | + |
| 76 | + API_KEY = 'your-pinboard-api-key' |
| 77 | + |
| 78 | + def main(wf): |
| 79 | + url = 'https://api.pinboard.in/v1/posts/recent' |
| 80 | + params = dict(auth_token=API_KEY, count=20, format='json') |
| 81 | + r = web.get(url, params) |
| 82 | + r.raise_for_status() |
| 83 | + for post in r.json()['posts']: |
| 84 | + wf.add_item(post['description'], post['href'], arg=post['href'], |
| 85 | + uid=post['hash'], valid=True, icon=ICON_WEB) |
| 86 | + wf.send_feedback() |
| 87 | + |
| 88 | + |
| 89 | + if __name__ == u"__main__": |
| 90 | + wf = Workflow() |
| 91 | + sys.exit(wf.run(main)) |
| 92 | + |
| 93 | + |
| 94 | +Add an **Open URL** action to your workflow with ``{query}`` as the **URL**, |
| 95 | +connect your **Script Filter** to it, and you can now hit **ENTER** on a |
| 96 | +Pinboard item in Alfred to open it in your browser. |
| 97 | + |
| 98 | + |
| 99 | +Installation |
| 100 | +============ |
| 101 | + |
| 102 | +**Note**: If you intend to distribute your workflow to other users, you |
| 103 | +should include Alfred-Workflow (and other Python libraries your workflow |
| 104 | +requires) within your workflow's directory as described below. **Do not** |
| 105 | +ask users to install anything into their system Python. Python installations |
| 106 | +cannot support multiple versions of the same library, so if you rely on |
| 107 | +globally-installed libraries, the chances are very good that your workflow |
| 108 | +will sooner or later break—or be broken by—some other software doing the |
| 109 | +same naughty thing. |
| 110 | + |
| 111 | + |
| 112 | +With pip |
| 113 | +-------- |
| 114 | + |
| 115 | +You can install Alfred-Workflow directly into your workflow with:: |
| 116 | + |
| 117 | + # from within your workflow directory |
| 118 | + pip install --target=. Alfred-Workflow |
| 119 | + |
| 120 | +You can install any other library available on the `Cheese Shop`_ the |
| 121 | +same way. See the `pip documentation`_ for more information. |
| 122 | + |
| 123 | + |
| 124 | +>From source |
| 125 | +----------- |
| 126 | + |
| 127 | +Download the ``alfred-workflow-X.X.X.zip`` file from the `GitHub releases`_ page |
| 128 | +and extract the ZIP to the root directory of your workflow (where |
| 129 | +``info.plist`` is). |
| 130 | + |
| 131 | +Alternatively, you can download `the source code`_ from the `GitHub repository`_ |
| 132 | +and copy the ``workflow`` subfolder to the root directory of your workflow. |
| 133 | + |
| 134 | +Your workflow directory should look something like this (where |
| 135 | +``yourscript.py`` contains your workflow code and ``info.plist`` is |
| 136 | +the workflow information file generated by Alfred):: |
| 137 | + |
| 138 | + Your Workflow/ |
| 139 | + info.plist |
| 140 | + icon.png |
| 141 | + workflow/ |
| 142 | + __init__.py |
| 143 | + background.py |
| 144 | + notify.py |
| 145 | + Notify.tgz |
| 146 | + update.py |
| 147 | + version |
| 148 | + web.py |
| 149 | + workflow.py |
| 150 | + yourscript.py |
| 151 | + etc. |
| 152 | + |
| 153 | + |
| 154 | +Documentation |
| 155 | +============= |
| 156 | + |
| 157 | +Detailed documentation, including a tutorial, is available at |
| 158 | +http://www.deanishe.net/alfred-workflow/. |
| 159 | + |
| 160 | +.. _v2 branch: https://github.com/deanishe/alfred-workflow/tree/v2 |
| 161 | +.. _requests: http://docs.python-requests.org/en/latest/ |
| 162 | +.. _Alfred 2 and 3: http://www.alfredapp.com/ |
| 163 | +.. _GitHub releases: https://github.com/deanishe/alfred-workflow/releases |
| 164 | +.. _the source code: https://github.com/deanishe/alfred-workflow/archive/master.zip |
| 165 | +.. _GitHub repository: https://github.com/deanishe/alfred-workflow |
| 166 | +.. _Cheese Shop: https://pypi.python.org/pypi |
| 167 | +.. _pip documentation: https://pip.pypa.io/en/latest/ |
| 168 | +.. _workflow variables: http://www.deanishe.net/alfred-workflow/user-manual/workflow-variables.html |
| 169 | + |
| 170 | + |
0 commit comments