Skip to main content
A Python helper library for `Alfred 2 <http://www.alfredapp.com/>`_ Workflow
authors.

Alfred Workflows typically take user input, fetch data from the Web or
elsewhere, filter them and display results to the user. **Alfred-Workflow**
helps you do these things.

There are convenience methods for:

- Parsing script arguments.
- Text decoding/normalisation.
- Storing data and settings.
- Caching data from, e.g., web services with a simple API for updating expired
data.
- Securely storing (and syncing) passwords using OS X Keychain.
- Generating XML output for Alfred.
- Including external libraries (adding directories to ``sys.path``).
- Filtering results using an Alfred-like, fuzzy search algorithm.
- Generating log output for debugging.
- Running background processes to keep your workflow responsive.
- Capturing errors, so the workflow doesn't fail silently.

Quick Example
=============

Here's how to show recent `Pinboard.in <https://pinboard.in/>`_ posts in Alfred.

Create a new Workflow in Alfred's preferences. Add a **Script Filter** with
Language ``/usr/bin/python`` and paste the following into the **Script** field
(changing ``API_KEY``):

.. code-block:: python
:emphasize-lines: 4

import sys
from workflow import Workflow, ICON_WEB, web

API_KEY = 'your-pinboard-api-key'

def main(wf):
url = 'https://api.pinboard.in/v1/posts/recent'
params = dict(auth_token=API_KEY, count=20, format='json')
r = web.get(url, params)
r.raise_for_status()
for post in r.json()['posts']:
wf.add_item(post['description'], post['href'], arg=post['href'],
uid=post['hash'], valid=True, icon=ICON_WEB)
wf.send_feedback()


if __name__ == u"__main__":
wf = Workflow()
sys.exit(wf.run(main))


Add an **Open URL** action to your Workflow with ``{query}`` as the **URL**,
connect your **Script Filter** to it, and you can now hit **ENTER** on a
Pinboard item in Alfred to open it in your browser.

Installation
============

With pip
--------

You can install **Alfred-Workflow** directly into your workflow with::

pip install --target=/path/to/my/workflow Alfred-Workflow


**Note**: If you intend to distribute your workflow to other users, you should
include **Alfred-Workflow** (and other Python libraries your workflow requires)
within your workflow as described. Do not ask users to install anything into
their system Python.

From source
-----------

Download the ``alfred-workflow-X.X.zip`` file from the
`GitHub releases page <https://github.com/deanishe/alfred-workflow/releases>`_
and either extract the ZIP to the root directory of your workflow (where
``info.plist`` is) or place the ZIP in the root directory and add
``sys.path.insert(0, 'alfred-workflow-X.X.zip')`` to the top of your
Python scripts.

Alternatively, you can download
`the source code <https://github.com/deanishe/alfred-workflow/archive/master.zip>`_
from the `GitHub repository <https://github.com/deanishe/alfred-workflow>`_ and
copy the ``workflow`` subfolder to the root directory of your Workflow.

Your Workflow directory should look something like this (where
``yourscript.py`` contains your Workflow code and ``info.plist`` is
the Workflow information file generated by Alfred)::

Your Workflow/
info.plist
icon.png
workflow/
__init__.py
background.py
workflow.py
web.py
yourscript.py
etc.


Or like this::

Your Workflow/
info.plist
icon.png
workflow-1.X.X.zip
yourscript.py
etc.

Documentation
=============

Detailed documentation, including a tutorial and auto-generated API docs, is
available at `the Alfred-Workflow website <http://www.deanishe.net/alfred-workflow/>`_.

Release files for Alfred-Workflow 1.8.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Alfred-Workflow 1.8.7
File Size Uploaded
Alfred-Workflow-1.8.7.tar.gz 26.8 kB Details

Release files / Alfred-Workflow-1.8.7.tar.gz

Download URL Alfred-Workflow-1.8.7.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ac1a960baca49f99c053de372bbe5afe75d2d502df882912e1edc161e6d659c4
BLAKE2b-256 checksum
How to use checksums
a1dcec2b71db42114da7e9d958d539b4787cca642038b0e1a9b5a6c7b8427186
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.40.0

1 release file

1.39.0

1 release file

1.38.0

1 release file

1.37.2

1 release file

1.37.1

1 release file

1.37

1 release file

1.36

1 release file

1.35

1 release file

1.34

1 release file

1.33

1 release file

1.32

1 release file

1.31

1 release file

1.30

1 release file

1.29

1 release file

1.28.1

1 release file

1.28

1 release file

1.27

1 release file

1.26

1 release file

1.25.2

1 release file

1.25.1

1 release file

1.25

1 release file

1.24

1 release file

1.23.1

1 release file

1.23

1.22

1 release file

1.21.1

1 release file

1.21

1 release file

1.20

1 release file

1.19

1 release file

1.18.2

1 release file

1.18.1

1 release file

1.17.4

1 release file

1.17.3

1 release file

1.17.2

1 release file

1.17.1

1 release file

1.17

1 release file

1.15.3

1 release file

1.15.1

1 release file

1.13

1 release file

1.12

1 release file

1.11.1

1 release file

1.11.0

1.10.2

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.6

1 release file

1.9.5

1 release file

1.9.4

1 release file

1.9.3

1 release file

1.9.2

1 release file

1.9.1

1 release file

1.8.9

1 release file

This release

1.8.7 This release

1 release file

1.8.6

1 release file

1.8.5

1 release file

1.8.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page