pacmax beta

Alfred Pac by deanishe on GitHub

convert

Convert between different units in Alfred

From their README

Alfred-Convert

Convert between different units offline in Alfred 3 & 4.

Alfred-Convert uses a built-in library for lightning-fast conversions.

You can also add your own custom units.

Note: Currency conversions do require occasional Internet connectivity to update exchange rates. Alfred-Convert will otherwise work just fine without an Internet connection.

Downloading

Download from GitHub releases.

Note: Version 3.7 and above only supports Alfred 4+. If you're still using Alfred 3, please download v3.6.2.

Usage

  • conv [] — Perform a conversion
    • ↩ — Copy result without thousands separator to pasteboard
    • ⌘C — Copy result with thousands separator to pasteboard
    • ⌘↩ — Add/remove destination unit as default for this dimensionality
    • ⌘L — Show result in Alfred's Large Type window
  • convinfo — View help file and information about the workflow, or edit custom units and active currencies
    • View Help File — Open this page in your browser
    • View All Supported Currencies — View/filter the list of all supported currencies in Alfred
    • Edit Active Currencies — Edit the list of active currencies in your default text editor
    • Edit Custom Units — Edit the list of custom currencies in your default text editor

Conversions

NOTE: Only a limited number of fiat currencies are supported by default. Additional rates are only supported if you set a key for the openexchangerates.org API in the workflow's configuration sheet. You can sign up for a free account here. When you're signed up, copy the App ID from the email you receive or this page into the APP_KEY field in the configuration sheet.

  • conv [] [] — Perform a conversion
    • ↩ or ⌘C — Copy the result to the pasteboard
    • ⌘↩ — Add/remove destination unit as default for this dimensionality
    • ⌘L — Show result in Alfred's Large Type window

If no destination unit is specified, any defaults you've saved will be used (that aren't the same as the source unit).

The syntax is simple: an optional context, the quantity, the unit you want to convert from then (optionally) the unit you want to convert to. For example:

  • conv 128 mph kph
  • conv 72in cm
  • conv 100psi bar
  • conv 20.5 m/s mph
  • conv 100 eur gbp

Or with a context:

  • conv spectroscopy 1Å eV (or conv sp 1Å eV)

It doesn't matter if there is a space between the quantity and the units or not. Alfred-Convert will tell you if it doesn't understand your query or know the units.

Actioning an item (selecting it and hitting ↩) will copy it to the clipboard. Using ⌘+L will display the result in Alfred's large text window, ⌘+C will copy the selected result to the clipboard.

Configuration

The workflow is configured via the configuration sheet (the [𝒙] icon) in Alfred Preferences and via a couple of text files in its data directory.

Configuration sheet

Basic configuration is performed in the configuration sheet:

Option Meaning
APP_KEY API key for openexchangerates.org.
COPY_UNIT Include unit when copying conversion result. Any value but 0 or empty turns this option on.
CURRENCY_DECIMAL_PLACES Overrides the default DECIMAL_PLACES setting for currency conversions.
DECIMAL_PLACES Number of decimal places to show in results.
DECIMAL_SEPARATOR Character to separate whole numbers and decimal fractions. Used for parsing input and generating output.
DYNAMIC_DECIMALS Dynamically increase the number of decimal places (up to 10) so that the result is non-zero. Any value but 0 or empty turns this option on.
THOUSANDS_SEPARATOR Character to delimit thousands Used for parsing input and generating output.
UPDATE_INTERVAL How often (in minutes) to update currency exchange rates.

Active currencies

By default, all supported fiat currencies (provided you've set APP_KEY in the configuration sheet) and a handful of the most popular cryptocurrencies are active.

  • convinfo
    • View All Supported Currencies
    • Edit Active Currencies

Use Edit Active Currencies to open the list of active currencies in your default editor. Add the symbol for the currency you'd like to activate on a new line in this file.

You can use View All Supported Currencies to search for the currency you'd like to activate, then use ⌘C on the result to copy the symbol to the pasteboard.

Custom units

See Adding custom units.

Supported units

Currently, Alfred-Convert only supports the units understood by the underlying Pint library plus currencies and a handful of additional units.

You can add your own custom units to the workflow. If you think they'd be useful to everyone, please create a corresponding GitHub issue to request addition as a default unit or submit a pull request.

Supported currencies

To convert, use the appropriate abbreviation for the relevant currencies, e.g. conv 100 eur gbp.

You can also view (and search) the list from within Alfred by using the keyword convinfo and choosing View All Supported Currencies.

All supported currencies.

Adding custom units

You can add your own custom units using the format defined by Pint. Add your definitions to the unit_definitions.txt file in the workflow's data directory.

To edit this file, enter convinfo in Alfred and select Edit Custom Units. The unit_definitions.txt file will open in your default text editor.

Please see the Pint documentation for the required format. See Pint's default unit definitions for examples.

Releases

See CHANGELOG for more information.

Release Date
3.7.0 2020-02-20
3.6.2 2019-09-06
3.6.1 2019-05-30
3.6.0 2019-05-06
3.5.3 2019-01-26
3.5.2 2019-01-26
3.5.1 2018-01-13
3.5 2018-01-12
3.4 2017-12-26
3.3.1 2017-11-21
3.3 2017-11-20
3.2.2 2017-11-07
3.2.1 2017-11-04
3.2 2017-11-02
3.1 2017-11-02
3.0 2017-07-16
2.6 2017-06-15
2.5 2015-12-11
2.4 2015-11-28
2.3 2015-11-26
2.2 2015-07-16
2.1 Never released
2.0 2014-12-26
1.2 2014-08-19
1.1 2014-08-09

Thanks, copyright, licensing

All other code/media are released under the MIT Licence.

Latest release

  • 3.7.16 years ago, 404 KBDownload

    Update dependencies.

19 earlier releases
  • 3.7.06 years ago, 401 KBDownload
    • APP_KEY for OpenExchangeRates.org no longer required for (basic) currency conversion. Closes #47
  • 3.6.27 years ago, 401 KBDownload

    Pint requires pkg_resources but doesn't declare setuptools as a dependency.

  • 3.6.17 years ago, 288 KBDownload

    Fixes #53

  • 3.6.07 years ago, 288 KBDownload
  • 3.5.37 years ago, 272 KBDownload

    Swap copy behaviour of v3.5.2 to match Alfred's built-in calculator.

    ↩ copies the result without thousands separator, and ⌘C copies the result with the separator.

  • 3.5.27 years ago, 272 KBDownload
    • ↩ copies result with thousands separator
    • ⌘C copies result without thousands separator #50
  • 3.5.18 years ago, 272 KBDownload

    CURRENCY_DECIMAL_PLACES overrides DECIMAL_PLACES for currencies #38

  • 3.58 years ago, 272 KBDownload

    Add DYNAMIC_DECIMALS option. If turned on, the number of decimal places in the displayed result is increased (beyond the default DECIMAL_PLACES) until the displayed result is non-zero #38

  • 3.48 years ago, 272 KBDownload

    Fix #36

  • 3.3.19 years ago, 272 KBDownload

    Disable currencies with conflicting symbols #32

  • 3.39 years ago, 272 KBDownload

    Parse number in query in accordance with the decimal and thousands separators specified in the workflow configuration sheet #31

  • 3.2.29 years ago, 271 KBDownload

    Improve behaviour after update to avoid confusion #28 #29 #30

    • Show warning in Alfred if APP_KEY isn't set and user tries to convert a fiat currency (or has one set as a default unit for fiat currencies)
    • Ensure cache is cleared after user sets APP_KEY, so exchange rates are updated
  • 3.2.19 years ago, 270 KBDownload

    Clear cache when updating from v<3.1 and after APP_KEY is set.

    • Avoid incompatibility with data cached from the Yahoo! Finance API
    • Immediately update exchange rates when APP_KEY is set #28
  • 3.29 years ago, 270 KBDownload

    Add support for Pint's contexts, such as spectroscopy #18

    Start your query with a context supported by Pint, e.g. conv sp 54 Å eV

  • 3.19 years ago, 270 KBDownload

    The Yahoo! Finance API is defunct #27

    Replaced with openexchangerates.org.

    Unfortunately, you'll have to sign up for a free API key.

  • 3.0.29 years ago, 293 KBDownload

    Explicit path to pint default units to avoid pint/setuptools issue with non-ASCII paths.

  • 3.0.19 years ago, 282 KBDownload

    Fix encoding issue #25

  • 3.09 years ago, 296 KBDownload
    • Option to exclude units when copying #12
    • Add per-dimensionality defaults #13
    • Option to specify thousands separator #15
    • Option to specify custom decimal separator #16
    • Add cryptocurrencies #21
    • Update Alfred-Workflow
    • Update Pint
  • 2.69 years ago, 197 KBDownload

    Update Alfred-Workflow to address Sierra forking bug