Jump to content

NSC - Number System Converter

Recommended Posts



Workflow to convert numbers into other based systems.


As a computer scientist student I deal everyday with binary, octal, hex and decimal numbers. Therefore I built this workflow with PHP for Alfred 1 and now I rebuilt it with Python for Alfred 2.




5 different keywords are used:

  • decimal
  • binary
  • octal
  • hex
  • convert

The first 4 act similar. You type the keyword (base of your number) and the number you want to convert. Alfred will show you the same number in the other 3 systems. You can select one of them and copied to your clipboard.





To convert from or into another system beside these four, you use the keyword convert. Then you type your number, the base of your number and the base of the destination. NSC will display the decimal notation and the new number.

To simplify this use the simple frase: "convert number 42 from with base 6 into base 4"





can be found on GitHub: Changelog



latest build: NSC Alfred Extension

Requires: non
Supports Alleyoop 2




_mk_ made a bash version of NSC. It can be found at GitHub.

Edited by obstschale
Link to comment

Installing lxml was quite a bit effort to get this workflow running. The MacPorts library only supported Python 2.5 so I had to build the lib and the required system libs on my own.


I created a version of the workflow based on the command line tool bc which does not require you to install/compile any additional libs. If someone is interested and obstschale agrees, I could upload it and post a link.

Link to comment

Hi _mk_,


thx for your input. I'm pretty new to python so I didn't know how to make it better so far and I installed lxml for another cmd line tool some time ago, so I know this module exist.


Today I just saw another python script which uses not lxml but xml. Either I use this one (if it is a standard lib) or if you have a good suggestion just give me a pull request on github (is saw you forked my repo) and I probably will integrated your improvement. Looks like you have more python experience than me ;)

Link to comment

I encountered some issues with my workflow and David Ferguson suggested to use the module alp. This Module also includes a XML function and I guess this will also solve the lxml problem, because I will provide the XML lib with v2.1


Anyhow, I still would like to see how you use the bc cmd line tool. Just for learning purpose :)

Link to comment
  • 3 weeks later...
  • 10 months later...
  • 2 years later...
1 hour ago, bbezanson said:

I'm suggest for anyone needing to install Python, I would suggest HomeBrew for the Mac.


Python is a standard component of OS X (/usr/bin/python). It's one of the default languages available in Alfred.


There is no need for Homebrew.


Indeed, I would strongly discourage anyone writing a workflow in Python from using a non-system Python for the workflow (be it a brewed one or from python.org) unless there's a very good reason not to use the system Python.


If you use a non-system Python (or indeed any other interpreter that isn't a standard part of OS X, such as nodejs), other people can't simply download your workflow, install it and run it.

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...