I'd like to split a string like `3cm/µs² + 4e-4 sqmiles/km/h**2` into its [SI unit](https://en.wikipedia.org/wiki/International_System_of_Units) (in this case, `m/s**2`) and its magnitude (in multiples of that unit).

Since sympy provides both a [parsing module](http://docs.sympy.org/dev/modules/parsing.html) and [many physical units and SI prefixes](http://docs.sympy.org/dev/modules/physics/units.html), I guess using sympy would be a good idea. But what is a nice way to achieve this? I'd write an algorithm like the following, but I'd like to avoid reinventing a squared wheel:

* Treat the transition between a number and a letter (except for the `4e-4` like syntax) and whitespace (unless its next to an explicit operator) as multiplication, then tokenize
* Replace each non-numeric token by its SI representation (also checking for SI-prefixes)
* Simplify the new expression down to `Magnitude * some SI units` (giving a meaningful error message on inconsistent units, e.g. `Cannot add m**2 to s`)

Can this be easily achieved via existing means? Or how would this be best implemented?