Live Unit Feeds - martintrojer/frinj GitHub Wiki
Frinj support live feeds of units and conversion factors for non-static units such as currency exchange rates.
The frinj.feeds namespace implements the utility functions shared by the different feeds (existing and future).
The feeds share a single ScheduledThreadPoolExecutor on which they register functions to be called periodically. Feeds can be started and stopped individually and cancelled all together.
Currently Frinj comes with these unit feeds;
- Currency Conversion
Units uses the 3 letter ISO 4217 acronym (all capital)
- Precious Metals
Units uses the capitalised name; Gold, Palladium, Platinum, Silver
- Industrial Metals
Units uses the capitalised name; Aluminum, Copper, Lead etc...
- Agrarian Commodities
Units uses the capitalised name; Cotton, Cocoa, Sugar etc...
Examples
user=> (use 'frinj.repl)
user=> (str (fj 10 :thousand :SEK :to :GBP)) ;; standard currency conversion
"937.1075201531269 [dimensionless]"
user=> (str (fj :Gold :per :Silver)) ;; Gold vs Silver price
"49.95612708018155 [dimensionless]"
user=> (str (fj :Milk))
"0.3659673552268969 dollar kg^-1 [price_per_mass]"