Giter VIP home page Giter VIP logo

alfred-converter's People

Contributors

aaronkollasch avatar akashagarwal7 avatar enyman avatar iaian7 avatar liuzikai avatar pbreault avatar trishume avatar wolph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

alfred-converter's Issues

Configurable / re-orderable units

As a general purpose unit converter, it's hard to anticipate everyone's preferences, accounting for different locales and use cases. Personally, when I enter "km" as a base unit, the most likely target unit I'm converting to is miles (not microns or femtomets, whatever those are :). Yet I recognize that others might have wildly different preferences; femtomets could be critical for someone else.

So what if the units table lived in a user-editable JSON file? I could see 2 benefits from this:

  1. user-supported arbitrary units
  2. user-customized ordering of units

In general, I'm against over-configurability since it confuses users, but in this case I think it would be OK because users can just stick with the default units and ordering, while tinkerers can customize if they desire. What do others think?

1024mb should be equal to 1.000gb

Hello, first of all thank you for the conversion tool provided. I found a problem in the process of using the computer unit conversion.

The computer storage unit conversion error, for example, 1024mb should be equal to 1.000gb, and the tool conversion result is equal to 1.024gb, the storage unit conversion should be 1024.

Farad derivatives support?

I see there's already support for base unit, F (farad). Can nF, pF, uF be added, so I don't have to use meters (nm/pm) and translate in my head? It's especially tricky for um, which is shown as microns - having uF would be much appreciated.

Python 2 removed in macOS 8.3 beta

Workflow fails with

Reason: launch path not accessible

/usr/bin/python

On latest macOS beta the old python 2 binary has been removed.

How should I convert new units

Since I need to calculate a lot of PP transfer fee every day, I want to use Alfred to quickly calculate the PP fee result. How can I implement this conversion procedure in your workflow?

The PP fee calculation tool I currently use is shown in the link, and the US dollar is needed. The specific value set is 4.4%+0.3USD
https://www.clothnappytree.com/ppcalculator/
image

Thanks for your help!

metric/imperial conversions

hi, great work!
It would be really useful to be able to convert between the following metric & imperial units:

  • cups/c
  • gallons/gal
  • grams/g
  • kilograms/kg
  • liters/L
  • milliliters/ml
  • ounces/oz
  • pints/pt
  • pounds/lbs
  • quarts/qt
  • tablespoons/tbsp
  • teaspoons/tsp

Is this something you can point me toward how to add?
thanks!

MPH and FPS not recognized as units

Miles per hour and feet per second must be spelled out as "miles/hour" or "mi/h". This is normal for metric folks - kilometers per hour is usually km/h - but imperial speeds are usually specified as mph. Feet per second is probably less common, but as long as we're changing mph, we might as well throw in fps too.

inches to feet-inches?

Hey – awesome tool, first off. Leagues faster/easier than the other converters out there.

Quick question, how hard would it be to add support in both directions for feet-inches in fractions, which is common in architecture? I'm imagining expanding on what you have for feet-inches already:
4'2" -> 50" (works)
4'2.3" -> 50.3"
4'2-1/4" -> 50.25"
50.125" -> 4'2-1/8"

can't get it to start

I am a total beginner and installed the workflow but can't find a way to initiate it. Any advice?

Add variable to enable or disable fractional units

When converting from metric to imperial, for example, 10 cm to in, I personally only care that 10 cm = 3.93 in. The current configuration is clutchy with fractions, mixed fraction, and a thousandth of an inch, the latter of which is a little infuriating considering that I have to manually move the decimal point of 3937.007874 three digits over to get my actual result. There should be a variable disabling fraction, or at the very least move result 3.93 in at the top.

Currency conversions

Would be great if the converter could also handle currency conversions, similar to Yosemite's spotlight, e.g. type "2000 isk eur" to instantly get the converted euro amount.

Rank default unit conversions better

I love this applet, but I think it would greatly benefit from better ranking of unit conversions.

Let's say I want to convert 80°F to °C, which is common. Check out the difference between spotlight and the applet:

Screen Shot 2020-08-14 at 11 57 45 AM

image

Sure, kelvin is nice to have... but is it really something that's necessary? I'm an engineering student who's grown up around the metric student, and even then I don't ever want to convert into Kelvin unless I'm using it for homework, but then I'd be happy to add in an extra "to K."

It would just make a lot more sense to rank °C as the first choice, and then kelvin, and then Rankine. Same goes to a C to F calculation—rank F, then maybe R or K, and then the last one.

Let's look at another example: I want to convert 16in to something. Of course, I would MOST LIKELY want the convert it to the metric system; moreover, probably meters or centimeters. Otherwise probably to feet & inches, or maybe even to feet only. Here's what I get:

image

image

Similarly here, I can't fathom why the conversion for "femtometer" would be ranked higher than feet if you're converting from inches. I hardly believe that anyone uses Alfred for converting inches to femtometers! And also, there's an inch to inch, which doesn't make that much sense to me.

That being said, I think it's a wonderful tool. I just don't like that I always have to keep digging for the conversion I'm trying to find. Spotlight does the ranking much better in my opinion, but of course I don't use it anymore in favor of Alfred.

I would be happy to give more examples and which items should be ranked higher. I would look into the code but sadly don't know enough about coding to fix it. However, I can do my best to help in some other way.

Environment Variables not working

Testing this plugin on macOS Ventura with Alfred 5.0.6, it seems like the options settable via environment variables are not working. As such, I can't enable BASE_2 or BASE_16.

Different spellings

Request support for the following:

  • US spelling of Liter
  • m^3 is supported but metre^3 or meter^3 is not

Can you do options? it would be nice to choose -re or -er endings for SI units.

Option to display only certain bases

I have enjoyed your workflow, but I find the automatic display of answers in non-decimal bases to be distracting, as I will never use them. Is there a simple way to disable this feature, and only display a single answer?

Thank you

Doesn't work with negative values of temperature

For example, if I type 90f in Alfred, it correctly shows 90 degree Fahrenheit in Kelvin and Celsius.
But if I type 30f, it doesn't show the result, because it's a negative value in other units.

Blacklist variable input mismatch

The current unit blacklist doesn't work due to a mismatch in default variable naming.

  • Line 280 of convert.py references the variable os.environ.get('UNITS_BLACKLISTED', '')
  • But the default variable in Alfred is UNITS_BLACKLIST
  • One of these needs to be changed in order to fix the broken functionality

Easiest fix for users is just to rename the variable in Alfred to match the expected input (add ED to the end).

Side note, this is by far my favourite unit conversion workflow! All the others seem to require a specific output definition (slow) or conversion keyword (even slower). So happy to see it's updated and working in Alfred 5.

Operations on results from functions gives broken results

Hi,

First of all thank you for this little workflow. It's so nice to not have to use google all the time just to convert between meters and feet :)

I've found an issue when to do operations on the result from a function. In a nutshell you either get 0 or the value of the first token depending on if you put spaces around the operator or not.

An example:
Screenshot 2020-03-26 at 12 09 29
Screenshot 2020-03-26 at 12 09 39
Screenshot 2020-03-26 at 12 14 01
Screenshot 2020-03-26 at 12 14 44

I've tried with a couple of different expressions and it seems to consistently behave like this. Expressions without functions are working as expected.

I'm using the latest version from git (downloaded on 2020-03-26). There also doesn't seem to be any useful information in the log.

[12:21:11.450] Logging Started...
[12:21:15.029] Unit converter[Script Filter] Queuing argument 'cos(pi/3) * 2'
[12:21:15.231] Unit converter[Script Filter] Script with argv '(null)' finished
[12:21:15.233] Unit converter[Script Filter] <items><item arg="0.5" uid="0.5" valid="yes"><title>0.5</title><subtitle>Action this item to copy the converted value to the clipboard</subtitle><icon>icons/inv-calculator63.png</icon></item></items>
[12:21:27.517] Unit converter[Script Filter] Queuing argument 'cos(pi/3)*2'
[12:21:27.678] Unit converter[Script Filter] Script with argv '(null)' finished
[12:21:27.681] Unit converter[Script Filter] <items><item arg="0" uid="0" valid="yes"><title>0</title><subtitle>Action this item to copy the converted value to the clipboard</subtitle><icon>icons/inv-calculator63.png</icon></item></items>

Put units to the right of the number

Normally I see units being written to the right of the number, e.g. 5 in or 5 cm.

However, this doesn't do that. It puts it to the left of the number:

image

Is it possible to get units to the right side of the number?

Light icons on dark themes?

I'm not sure if this is even possible, but it would be nice if you could figure out what kind of theme is applied to the Alfred window and adjust the icons based on that. For instance, any background darker than 70% grey would use a white icon, while everything else uses black.

If this isn't possible, could there be a toggle in the workflow that adjusts the icon color?

Timezones would be a nice addition

It would be great if I could type a quart such as 10:00BST to EDT or 10:00 London to New York and get the relevant time in the identified timezone.

So, typing:
10:00EDT BST
would give:
BST 15:00 (3:00 PM)

By default you could convert any time with timezone to the local timezone (and maybe UTC also)

So, if I were in the UK, typing:
10:00 EDT
would give:
BST 15:00 (3:00 PM)
UTC 14:00 (2:00 PM)

or if possible, optionally using city names rather than timezone identifiers:
10:00 New York
would give:
BST 15:00 (3:00 PM)
UTC 14:00 (2:00 PM)

Would be even better if I could configure a selection of "favoured timezones" that I use and also give those

Simplifying results

Hi,
I love your workflow, and use it daily.
However as I have multiple workflows that activate, when I type a number, it gets a bit messy. So would it be possible to remove the binary, octal and hexadecimal number features and dropdown?

Thank you!

US fluid ounces as source

When converting from in^3 or other units of volume, I see US fluid ounces as an destination unit option. However, I am unable to input US fluid ounces as a source unit.

Would be nice to be able to do simple math

For example:

(1314.65 * 3) mm to in

Just because I often have to jump back to the main Alfred calculator, copy the result, and then open again to plug that into the conversion.

Megameter vs millimeter

This is s really useful plug-in - well done. I have a request regarding Megameters and millimetres. In version 2.0 if we enter a length in millimeters (mm) the plug-in thinks we are talking Megameters (Mm).

1 millimeters (mm) = 0.001 meters
1 megameter (Mm) = 1,000,000 meters

Can you please fix this so that 'mm' translates to millimeters and 'Mm' translates to megameter, in much the way as you have for bits (b) and Bytes (B)? Many thanks.

Bug: safemath functions not working [with fix]

While testing with math functions like 'log' and 'ceil', I have found that the workflow does not work as expected (gives 0 for everything).

Not sure if I am the only one experiencing this, but I was able to fix it by replacing this line (line 12 in converter/safe_math.py):
safe_dict[k] = lambda *a: decimal.Decimal(getattr(math, k)(*a))
by this line
safe_dict[k] = getLambda(k)

where

def getLambda(k):
    return lambda *a: decimal.Decimal(getattr(math, k)(*a))

According to my understanding, this has something to do with variable referencing in python.
All lambda functions created under that loop referred to the same variable k, so as the value of k change every iteration, all previous created lambda functions is affected. So essentially that loop results in a bunch of copies of the last lambda function. By wrapping it by another function, the variable is forced to be copied.

Hope this helps someone.

Gigabytes and <X>bibytes

Thank you for the tool. It's almost solving my needs.

I need to do conversions like "32GB to bytes", but the highest metric I see supported is MB. It's also be nice to support explicit differences between "GB", "Gb", and "GiB" (along with the corresponding other units).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.