alfred-workflow-packager


Namealfred-workflow-packager JSON
Version 3.1.0 PyPI version JSON
download
home_pageNone
SummaryA CLI utility for packaging and exporting Alfred workflows
upload_time2024-03-30 19:57:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseThe MIT License (MIT) Copyright (c) 2016-2024 Caleb Evans 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.
keywords alfred workflow package export
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Alfred Workflow Packager

*Copyright 2016-2024 Caleb Evans*  
*Released under the MIT license*

Alfred Workflow Packager is a command-line utility which makes the process of
packaging and exporting an [Alfred](https://www.alfredapp.com/) workflow
incredibly quick and easy. The utility supports Alfred 3 and up, on projects running Python 3 (Python 2 is no longer supported).

## Setup

You can install the utility via `pip3`, either globally or within a virtualenv:

```sh
pip3 install alfred-workflow-packager
```

## Usage

### 1. Create configuration file

Once you've installed AWP, you must configure it for every project where you
wish to use it. To do so, create a `packager.json` file in the root directory of
your project; this file configures AWP for that particular project.

#### Example

```json
{
  "export_files": [
    "Fruit.alfredworkflow"
  ],
  "bundle_id": "com.yourname.fruit",
  "readme": "README.txt",
  "resources": [
      "icon.png",
      "src/*.py",
      "src/data/*.json"
  ]
}
```

#### Required settings

##### export_files

The paths of the exported workflows (relative to your project directory).

##### bundle_id

The unique bundle ID of your workflow. You must have one set in the installed
workflow, or AWP will not be able to find your workflow when packaging.

##### resources

A list of zero or more files/folder patterns representing files or folders to
copy from your project to the installed workflow. The directory structures and
filenames are preserved when copying.

*Local project:*

```
- icon.png
- fruit
    - apple.py
    - banana.applescript
    - orange.php
```

*Installed workflow (before running utility):*

```
- info.plist
- special_file.json
```

*packager.json resources:*

```json
[
    "icon.png",
    "fruit/*.json"
]
```

*Installed workflow (after running utility):*

```
- info.plist
- icon.png
- special_file.json
- fruit
    - apple.py
    - banana.applescript
    - orange.php
```

Note that files and folders already present in the installed workflow are *not*
touched if they are not in the *resources* list.

#### Optional settings

##### readme

The path to the README file to use for this workflow; the *About this Workflow*
field in your workflow is populated with the contents of this file.

### 2. Run utility

You can run the utility via the `awp` command:

```sh
awp
```

Running `awp` will copy those project resources listed in `packager.json` to
the installed workflow (in their respective locations), but only if their
contents or permissions have changed. If you ever need to ignore this equality
check, you can force the copying of all files/directories by passing `--force`
/ `-f`.

```sh
awp --force
```

```sh
awp -f
```

#### Setting the workflow version

Passing the `--version` option (also `-v`) to `awp` allows you to set the
version of the installed workflow directly. I highly recommend using [semantic
versioning](http://semver.org/) to version your workflow releases.

```sh
awp --version 1.2.0
```

```sh
awp -v 1.2.0
```

#### Exporting the workflow

When you're pleased with your work and you're ready to publish a new release,
you can export the installed workflow to your project directory by passing the
`--export` flag (or `-e`) to `awp`.

```sh
awp --export
```

```sh
awp -e
```

Note that you can set the version and export the workflow simultaneously:

```sh
awp -v 1.2.0 -e
```

**New in AWP v1.1.0:** If you wish to temporarily export the workflow to a
different file (different from `export_files` in `packager.json`), you can
pass one or more optional paths to `--export`:

```sh
awp -v 1.3.0-beta.1 -e ~/Desktop/fruit-beta-alfred-5.alfredworkflow
```

### 4. Configure workflow objects

The last important step is to update any script objects in your workflow (*i.e.*
objects of type **Script Filter**, **Run Script**, *etc.*) to reference the
files copied to the installed workflow directory.

You should set the *Language* to `/bin/bash` and use the appropriate shell
command to call your script. Use `"$@"` if your input is passed as argv, or
`"{query}"` if your input is passed as {query}.

#### Python

```sh
/usr/bin/python3 -m fruit.apple "$@"
```

```sh
/usr/bin/python3 -m fruit.apple "{query}"
```

#### AppleScript

```sh
/usr/bin/osascript fruit/banana.applescript "$@"
```

```sh
/usr/bin/osascript fruit/banana.applescript "{query}"
```

#### PHP

```sh
/usr/bin/php fruit/orange.php "$@"
```

```sh
/usr/bin/php fruit/orange.php "{query}"
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "alfred-workflow-packager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Caleb Evans <caleb@calebevans.me>",
    "keywords": "alfred, workflow, package, export",
    "author": null,
    "author_email": "Caleb Evans <caleb@calebevans.me>",
    "download_url": "https://files.pythonhosted.org/packages/13/90/15f0153759110553ac2fce439fb262674e8ffcf5c2251f851679f1ec55fa/alfred-workflow-packager-3.1.0.tar.gz",
    "platform": null,
    "description": "# Alfred Workflow Packager\n\n*Copyright 2016-2024 Caleb Evans*  \n*Released under the MIT license*\n\nAlfred Workflow Packager is a command-line utility which makes the process of\npackaging and exporting an [Alfred](https://www.alfredapp.com/) workflow\nincredibly quick and easy. The utility supports Alfred 3 and up, on projects running Python 3 (Python 2 is no longer supported).\n\n## Setup\n\nYou can install the utility via `pip3`, either globally or within a virtualenv:\n\n```sh\npip3 install alfred-workflow-packager\n```\n\n## Usage\n\n### 1. Create configuration file\n\nOnce you've installed AWP, you must configure it for every project where you\nwish to use it. To do so, create a `packager.json` file in the root directory of\nyour project; this file configures AWP for that particular project.\n\n#### Example\n\n```json\n{\n  \"export_files\": [\n    \"Fruit.alfredworkflow\"\n  ],\n  \"bundle_id\": \"com.yourname.fruit\",\n  \"readme\": \"README.txt\",\n  \"resources\": [\n      \"icon.png\",\n      \"src/*.py\",\n      \"src/data/*.json\"\n  ]\n}\n```\n\n#### Required settings\n\n##### export_files\n\nThe paths of the exported workflows (relative to your project directory).\n\n##### bundle_id\n\nThe unique bundle ID of your workflow. You must have one set in the installed\nworkflow, or AWP will not be able to find your workflow when packaging.\n\n##### resources\n\nA list of zero or more files/folder patterns representing files or folders to\ncopy from your project to the installed workflow. The directory structures and\nfilenames are preserved when copying.\n\n*Local project:*\n\n```\n- icon.png\n- fruit\n    - apple.py\n    - banana.applescript\n    - orange.php\n```\n\n*Installed workflow (before running utility):*\n\n```\n- info.plist\n- special_file.json\n```\n\n*packager.json resources:*\n\n```json\n[\n    \"icon.png\",\n    \"fruit/*.json\"\n]\n```\n\n*Installed workflow (after running utility):*\n\n```\n- info.plist\n- icon.png\n- special_file.json\n- fruit\n    - apple.py\n    - banana.applescript\n    - orange.php\n```\n\nNote that files and folders already present in the installed workflow are *not*\ntouched if they are not in the *resources* list.\n\n#### Optional settings\n\n##### readme\n\nThe path to the README file to use for this workflow; the *About this Workflow*\nfield in your workflow is populated with the contents of this file.\n\n### 2. Run utility\n\nYou can run the utility via the `awp` command:\n\n```sh\nawp\n```\n\nRunning `awp` will copy those project resources listed in `packager.json` to\nthe installed workflow (in their respective locations), but only if their\ncontents or permissions have changed. If you ever need to ignore this equality\ncheck, you can force the copying of all files/directories by passing `--force`\n/ `-f`.\n\n```sh\nawp --force\n```\n\n```sh\nawp -f\n```\n\n#### Setting the workflow version\n\nPassing the `--version` option (also `-v`) to `awp` allows you to set the\nversion of the installed workflow directly. I highly recommend using [semantic\nversioning](http://semver.org/) to version your workflow releases.\n\n```sh\nawp --version 1.2.0\n```\n\n```sh\nawp -v 1.2.0\n```\n\n#### Exporting the workflow\n\nWhen you're pleased with your work and you're ready to publish a new release,\nyou can export the installed workflow to your project directory by passing the\n`--export` flag (or `-e`) to `awp`.\n\n```sh\nawp --export\n```\n\n```sh\nawp -e\n```\n\nNote that you can set the version and export the workflow simultaneously:\n\n```sh\nawp -v 1.2.0 -e\n```\n\n**New in AWP v1.1.0:** If you wish to temporarily export the workflow to a\ndifferent file (different from `export_files` in `packager.json`), you can\npass one or more optional paths to `--export`:\n\n```sh\nawp -v 1.3.0-beta.1 -e ~/Desktop/fruit-beta-alfred-5.alfredworkflow\n```\n\n### 4. Configure workflow objects\n\nThe last important step is to update any script objects in your workflow (*i.e.*\nobjects of type **Script Filter**, **Run Script**, *etc.*) to reference the\nfiles copied to the installed workflow directory.\n\nYou should set the *Language* to `/bin/bash` and use the appropriate shell\ncommand to call your script. Use `\"$@\"` if your input is passed as argv, or\n`\"{query}\"` if your input is passed as {query}.\n\n#### Python\n\n```sh\n/usr/bin/python3 -m fruit.apple \"$@\"\n```\n\n```sh\n/usr/bin/python3 -m fruit.apple \"{query}\"\n```\n\n#### AppleScript\n\n```sh\n/usr/bin/osascript fruit/banana.applescript \"$@\"\n```\n\n```sh\n/usr/bin/osascript fruit/banana.applescript \"{query}\"\n```\n\n#### PHP\n\n```sh\n/usr/bin/php fruit/orange.php \"$@\"\n```\n\n```sh\n/usr/bin/php fruit/orange.php \"{query}\"\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2016-2024 Caleb Evans  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. ",
    "summary": "A CLI utility for packaging and exporting Alfred workflows",
    "version": "3.1.0",
    "project_urls": {
        "changelog": "https://github.com/caleb531/alfred-workflow-packager/releases",
        "documentation": "https://github.com/caleb531/alfred-workflow-packager#readme",
        "homepage": "https://github.com/caleb531/alfred-workflow-packager",
        "repository": "https://github.com/caleb531/alfred-workflow-packager"
    },
    "split_keywords": [
        "alfred",
        " workflow",
        " package",
        " export"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ce06be86d6dcb518b2770c335045e2c13bfd8ceda8c88383562882f998514618",
                "md5": "c35b55ec33d02f74144945a37e2c2dcf",
                "sha256": "297d1aa3d7c1988443d31c07a62d8ff4edae8bc0dfc4f1b69d1606f652bc55dd"
            },
            "downloads": -1,
            "filename": "alfred_workflow_packager-3.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c35b55ec33d02f74144945a37e2c2dcf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 10390,
            "upload_time": "2024-03-30T19:57:50",
            "upload_time_iso_8601": "2024-03-30T19:57:50.338242Z",
            "url": "https://files.pythonhosted.org/packages/ce/06/be86d6dcb518b2770c335045e2c13bfd8ceda8c88383562882f998514618/alfred_workflow_packager-3.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "139015f0153759110553ac2fce439fb262674e8ffcf5c2251f851679f1ec55fa",
                "md5": "fd2d97a18bede72e8f2dec19922fcfb5",
                "sha256": "af886c02cb70cd37b341c922d2aa7dd48dfa406d695bfb790b114db8f5c969c8"
            },
            "downloads": -1,
            "filename": "alfred-workflow-packager-3.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fd2d97a18bede72e8f2dec19922fcfb5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 8552,
            "upload_time": "2024-03-30T19:57:51",
            "upload_time_iso_8601": "2024-03-30T19:57:51.970305Z",
            "url": "https://files.pythonhosted.org/packages/13/90/15f0153759110553ac2fce439fb262674e8ffcf5c2251f851679f1ec55fa/alfred-workflow-packager-3.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-30 19:57:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "caleb531",
    "github_project": "alfred-workflow-packager",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "alfred-workflow-packager"
}
        
Elapsed time: 0.21595s