Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kolaru/unitparser.jl
Simple units parser for julia.
https://github.com/kolaru/unitparser.jl
Last synced: 24 days ago
JSON representation
Simple units parser for julia.
- Host: GitHub
- URL: https://github.com/kolaru/unitparser.jl
- Owner: Kolaru
- License: mit
- Created: 2020-08-25T00:09:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-02T12:24:30.000Z (6 months ago)
- Last Synced: 2024-10-23T06:57:47.450Z (2 months ago)
- Language: Julia
- Size: 29.3 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UnitParser.jl
Small implementation of general unit parsing.
The basic function is `parse_units`, transforming a string into a `Unitful` unit.
```julia
julia> parse_units("nanoamps3 seconds / micrometer^2")
nA^3 s μm^-2
```At its core this package just transform a complicated string to one that
`Unitful` can parse.
You can get that simpler string by using `reduce_units_expr`.```julia
julia> using Unitfuljulia> s = reduce_units_expr("kilometers / m^2")
"km*m^-2"julia> uparse(s)
km m^-2
```