Package for converting some generic object.
Package for parsing as string quantities with or without units.
>>> from generic_converter.units import SmartUnitsConverter >>> >>> c = SmartUnitsConverter() >>> c.convert('2.78 daN*mm^2', 'mN*µm^2') >>> Decimal('2.78E+10') >>> >>> c.convert('2.78', 'mN*µm^2', 'daN*mm^2') >>> Decimal('2.78E+10')
Note: It is necessary to provide the value as a string. Indeed, the high precision of conversion (1E-27) is possible only with string, by using Decimal object in replacement of float object.
Please submit and comment on bug reports and feature requests.
To submit a patch:
- Fork it (https://bitbucket.org/negetem/generic_converter/fork).
- Create your feature branch (git checkout -b my-new-feature).
- Make changes.
- Commit your changes (git commit -am ‘Add some feature’).
- Push to the branch (git push origin my-new-feature).
- Create a new Pull Request.
This app is licensed under the MIT license.
This software is provided “as is” and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.
- Initial release
- Added support for combined units like ‘kg*m*s^-2’