Skip to content

Commit 3f2fb16

Browse files
committed
Initial commit.
0 parents  commit 3f2fb16

23 files changed

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

Currency Exchange.alfredworkflow

356 KB
Binary file not shown.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Currency exchange worflow for Alfred 3
2+
3+
Convert between currencies (including Bitcoin) from Alfred using the `cur` keyword.
4+
5+
## Installation
6+
- Grab the latest version from the [releases page](https://github.com/daninfpj/currency-exchange/releases/latest)
7+
8+
## Usage
9+
10+
- `cur USD EUR` - Shows the exchange rate between USD and EUR
11+
- `cur USD` - Shows the exchange rate between USD and the default `to` currency
12+
- `cur` — Shows the exchange rate between the default rates
13+
- `cur 100 EUR USD` — Converts 100 EUR to USD
14+
- `cur 100 EUR` — If you only type in one currency, it will convert from that to the deafult `to` currency
15+
- `cur 100` — If you ommit currencies, it will convert between the default ones
16+
- Press enter to copy the result to the clipboard
17+
18+
## Setting default currencies
19+
- `cur from USD` — Sets the default `from` currency
20+
- `cur to COP` — Sets the default `to` currency
21+
22+
## Credits
23+
24+
- Uses the [Alfred Workflow](https://github.com/deanishe/alfred-workflow) library
25+
- Partially inspired by [Currency Converter for Alfred 2](https://github.com/bigluck/alfred2-currencyconverter) (which no longer seems to work)
26+
- Icon based on [Currency Exchange by Chanut is Industries from the Noun Project](https://thenounproject.com/search/?q=currency%20exchange&i=824774)

0 commit comments

Comments
 (0)