Alfred-PyWorkflow


NameAlfred-PyWorkflow JSON
Version 2.0.0b3 PyPI version JSON
download
home_pagehttps://xdevcloud.de/alfred-pyworkflow/
SummaryFull-featured helper library for writing Alfred 4 and 5 workflows
upload_time2023-11-17 21:30:50
maintainer
docs_urlNone
authorThomas Harr
requires_python
license
keywords alfred workflow alfred4 alfred5
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
A helper library for writing `Alfred 4 and 5`_ workflows.

Supports macOS Catalina and Python 3.7+.

Alfred-Workflow is designed to take the grunt work out of writing a workflow.

It gives you the tools to create a fast and featureful Alfred workflow from an
API, application or library in minutes.

http://www.deanishe.net/alfred-workflow/


Features
========

* Catches and logs workflow errors for easier development and support
* "Magic" arguments to help development/debugging
* Auto-saves settings
* Super-simple data caching
* Fuzzy, Alfred-like search/filtering with diacritic folding
* Keychain support for secure storage (and syncing) of passwords, API keys etc.
* Simple generation of Alfred feedback (XML output)
* Input/output decoding for handling non-ASCII text
* Lightweight web API with modelled on `requests`_
* Pre-configured logging
* Painlessly add directories to ``sys.path``
* Easily launch background tasks (daemons) to keep your workflow responsive
* Check for new versions and update workflows hosted on GitHub.
* Post notifications via Notification Center.


Alfred 3-only features
----------------------

* Set `workflow variables`_ from code
* Advanced modifiers
* Alfred 3-only updates (won't break Alfred 2 installs)
* Re-running Script Filters


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/python3`` and paste the following into the **Script**
field (changing ``API_KEY``):


.. code-block:: python

    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
============

**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's directory as described below. **Do not**
ask users to install anything into their system Python. Python installations
cannot support multiple versions of the same library, so if you rely on
globally-installed libraries, the chances are very good that your workflow
will sooner or later break—or be broken by—some other software doing the
same naughty thing.


With pip
--------

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

    # from within your workflow directory
    pip install --target=. Alfred-Workflow

You can install any other library available on the `Cheese Shop`_ the
same way. See the `pip documentation`_ for more information.


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

Download the ``alfred-workflow-X.X.X.zip`` file from the `GitHub releases`_
page and extract the ZIP to the root directory of your workflow (where
``info.plist`` is).

Alternatively, you can download `the source code`_ from the
`GitHub repository`_ 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
            notify.py
            Notify.tgz
            update.py
            version
            web.py
            workflow.py
        yourscript.py
        etc.


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

Detailed documentation, including a tutorial, is available at
http://www.deanishe.net/alfred-workflow/.

.. _v2 branch: https://github.com/deanishe/alfred-workflow/tree/v2
.. _requests: http://docs.python-requests.org/en/latest/
.. _Alfred 4 and 5: http://www.alfredapp.com/
.. _GitHub releases: https://github.com/deanishe/alfred-workflow/releases
.. _the source code: https://github.com/deanishe/alfred-workflow/archive/master.zip
.. _GitHub repository: https://github.com/deanishe/alfred-workflow
.. _Cheese Shop: https://pypi.python.org/pypi
.. _pip documentation: https://pip.pypa.io/en/latest/
.. _workflow variables: http://www.deanishe.net/alfred-workflow/user-manual/workflow-variables.html



            

Raw data

            {
    "_id": null,
    "home_page": "https://xdevcloud.de/alfred-pyworkflow/",
    "name": "Alfred-PyWorkflow",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "alfred workflow alfred4 alfred5",
    "author": "Thomas Harr",
    "author_email": "xDevThomas@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/be/67/8090ebbbcb594016d8f1cfc142025f9a48f359b1a87b663c7748c662e42b/Alfred-PyWorkflow-2.0.0b3.tar.gz",
    "platform": null,
    "description": "\nA helper library for writing `Alfred 4 and 5`_ workflows.\n\nSupports macOS Catalina and Python 3.7+.\n\nAlfred-Workflow is designed to take the grunt work out of writing a workflow.\n\nIt gives you the tools to create a fast and featureful Alfred workflow from an\nAPI, application or library in minutes.\n\nhttp://www.deanishe.net/alfred-workflow/\n\n\nFeatures\n========\n\n* Catches and logs workflow errors for easier development and support\n* \"Magic\" arguments to help development/debugging\n* Auto-saves settings\n* Super-simple data caching\n* Fuzzy, Alfred-like search/filtering with diacritic folding\n* Keychain support for secure storage (and syncing) of passwords, API keys etc.\n* Simple generation of Alfred feedback (XML output)\n* Input/output decoding for handling non-ASCII text\n* Lightweight web API with modelled on `requests`_\n* Pre-configured logging\n* Painlessly add directories to ``sys.path``\n* Easily launch background tasks (daemons) to keep your workflow responsive\n* Check for new versions and update workflows hosted on GitHub.\n* Post notifications via Notification Center.\n\n\nAlfred 3-only features\n----------------------\n\n* Set `workflow variables`_ from code\n* Advanced modifiers\n* Alfred 3-only updates (won't break Alfred 2 installs)\n* Re-running Script Filters\n\n\nQuick Example\n=============\n\nHere's how to show recent `Pinboard.in <https://pinboard.in/>`_ posts\nin Alfred.\n\nCreate a new workflow in Alfred's preferences. Add a **Script Filter** with\nLanguage ``/usr/bin/python3`` and paste the following into the **Script**\nfield (changing ``API_KEY``):\n\n\n.. code-block:: python\n\n    import sys\n    from workflow import Workflow, ICON_WEB, web\n\n    API_KEY = 'your-pinboard-api-key'\n\n    def main(wf):\n        url = 'https://api.pinboard.in/v1/posts/recent'\n        params = dict(auth_token=API_KEY, count=20, format='json')\n        r = web.get(url, params)\n        r.raise_for_status()\n        for post in r.json()['posts']:\n            wf.add_item(post['description'], post['href'], arg=post['href'],\n                        uid=post['hash'], valid=True, icon=ICON_WEB)\n        wf.send_feedback()\n\n\n    if __name__ == u\"__main__\":\n        wf = Workflow()\n        sys.exit(wf.run(main))\n\n\nAdd an **Open URL** action to your workflow with ``{query}`` as the **URL**,\nconnect your **Script Filter** to it, and you can now hit **ENTER** on a\nPinboard item in Alfred to open it in your browser.\n\n\nInstallation\n============\n\n**Note**: If you intend to distribute your workflow to other users, you\nshould include Alfred-Workflow (and other Python libraries your workflow\nrequires) within your workflow's directory as described below. **Do not**\nask users to install anything into their system Python. Python installations\ncannot support multiple versions of the same library, so if you rely on\nglobally-installed libraries, the chances are very good that your workflow\nwill sooner or later break\u2014or be broken by\u2014some other software doing the\nsame naughty thing.\n\n\nWith pip\n--------\n\nYou can install Alfred-Workflow directly into your workflow with::\n\n    # from within your workflow directory\n    pip install --target=. Alfred-Workflow\n\nYou can install any other library available on the `Cheese Shop`_ the\nsame way. See the `pip documentation`_ for more information.\n\n\nFrom source\n-----------\n\nDownload the ``alfred-workflow-X.X.X.zip`` file from the `GitHub releases`_\npage and extract the ZIP to the root directory of your workflow (where\n``info.plist`` is).\n\nAlternatively, you can download `the source code`_ from the\n`GitHub repository`_ and copy the ``workflow`` subfolder to the root\ndirectory of your workflow.\n\nYour workflow directory should look something like this (where\n``yourscript.py`` contains your workflow code and ``info.plist`` is\nthe workflow information file generated by Alfred)::\n\n    Your Workflow/\n        info.plist\n        icon.png\n        workflow/\n            __init__.py\n            background.py\n            notify.py\n            Notify.tgz\n            update.py\n            version\n            web.py\n            workflow.py\n        yourscript.py\n        etc.\n\n\nDocumentation\n=============\n\nDetailed documentation, including a tutorial, is available at\nhttp://www.deanishe.net/alfred-workflow/.\n\n.. _v2 branch: https://github.com/deanishe/alfred-workflow/tree/v2\n.. _requests: http://docs.python-requests.org/en/latest/\n.. _Alfred 4 and 5: http://www.alfredapp.com/\n.. _GitHub releases: https://github.com/deanishe/alfred-workflow/releases\n.. _the source code: https://github.com/deanishe/alfred-workflow/archive/master.zip\n.. _GitHub repository: https://github.com/deanishe/alfred-workflow\n.. _Cheese Shop: https://pypi.python.org/pypi\n.. _pip documentation: https://pip.pypa.io/en/latest/\n.. _workflow variables: http://www.deanishe.net/alfred-workflow/user-manual/workflow-variables.html\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Full-featured helper library for writing Alfred 4 and 5 workflows",
    "version": "2.0.0b3",
    "project_urls": {
        "Homepage": "https://xdevcloud.de/alfred-pyworkflow/"
    },
    "split_keywords": [
        "alfred",
        "workflow",
        "alfred4",
        "alfred5"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be678090ebbbcb594016d8f1cfc142025f9a48f359b1a87b663c7748c662e42b",
                "md5": "92d302a835f024931fa4931298113821",
                "sha256": "58a20aa5610f54b6bbe147a7b8c487dc4955cd599d97acb73da2602f93812786"
            },
            "downloads": -1,
            "filename": "Alfred-PyWorkflow-2.0.0b3.tar.gz",
            "has_sig": false,
            "md5_digest": "92d302a835f024931fa4931298113821",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 54137,
            "upload_time": "2023-11-17T21:30:50",
            "upload_time_iso_8601": "2023-11-17T21:30:50.778382Z",
            "url": "https://files.pythonhosted.org/packages/be/67/8090ebbbcb594016d8f1cfc142025f9a48f359b1a87b663c7748c662e42b/Alfred-PyWorkflow-2.0.0b3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-17 21:30:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "alfred-pyworkflow"
}
        
Elapsed time: 0.14261s