Currency Exchange Rates library

Implements fetching currency exchange rates from different providers, as well as caching the fetched rates for quick retrieval.

License

License

Categories

Categories

Data
GroupId

GroupId

info.datamuse
ArtifactId

ArtifactId

currency-exchange-rates
Last Version

Last Version

1.0.0-alpha
Release Date

Release Date

Type

Type

jar
Description

Description

Currency Exchange Rates library
Implements fetching currency exchange rates from different providers, as well as caching the fetched rates for quick retrieval.
Project URL

Project URL

https://github.com/vdvoretskyi/currency-exchange-rates
Project Organization

Project Organization

Datamuse
Source Code Management

Source Code Management

https://github.com/vdvoretskyi/currency-exchange-rates

Download currency-exchange-rates

How to add to project

<!-- https://jarcasting.com/artifacts/info.datamuse/currency-exchange-rates/ -->
<dependency>
    <groupId>info.datamuse</groupId>
    <artifactId>currency-exchange-rates</artifactId>
    <version>1.0.0-alpha</version>
</dependency>
// https://jarcasting.com/artifacts/info.datamuse/currency-exchange-rates/
implementation 'info.datamuse:currency-exchange-rates:1.0.0-alpha'
// https://jarcasting.com/artifacts/info.datamuse/currency-exchange-rates/
implementation ("info.datamuse:currency-exchange-rates:1.0.0-alpha")
'info.datamuse:currency-exchange-rates:jar:1.0.0-alpha'
<dependency org="info.datamuse" name="currency-exchange-rates" rev="1.0.0-alpha">
  <artifact name="currency-exchange-rates" type="jar" />
</dependency>
@Grapes(
@Grab(group='info.datamuse', module='currency-exchange-rates', version='1.0.0-alpha')
)
libraryDependencies += "info.datamuse" % "currency-exchange-rates" % "1.0.0-alpha"
[info.datamuse/currency-exchange-rates "1.0.0-alpha"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25
org.json : json jar 20180130
redis.clients : jedis Optional jar 2.9.0

test (5)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.2.0
org.junit.jupiter : junit-jupiter-engine jar 5.2.0
org.hamcrest : java-hamcrest jar 2.0.0.0
ch.qos.logback : logback-classic jar 1.2.3
org.apache.commons : commons-lang3 jar 3.7

Project Modules

There are no modules declared in this project.

Currency Exchange Rates

Java 8+ License

The Currency Exchange Rates library implements getting live currency exchange rates from different providers. It is designed for resilience — e.g. if the first-choice provider's API is temporarily inaccessible, the application can be configured to fallback to a different provider.

The library also implements multiple ways of caching currency exchange rates for quick retrieval and for overcoming daily API call limits of the currency rate providers.

Supported providers

Supported caches

  • Redis
  • In-memory (via ConcurrentHashMap)

Examples

TODO:

Key features

  • Flexibility — the library allows a very flexible configuration of exchange rate providers, fallback chains and caching. For example, you may configure a provider with some API key as a fallback for the same provider with a different API key (for the case that the first API key runs out of available API calls).

  • Precision — Some existing utilities work with "base currencies" and do conversions in two steps: convert source currency to the base currency, then the base currency to target currency. Such implementation may produce inaccurate or wrong results, so this library doesn't do this. All conversions are performed directly in one step.

  • Minimal dependencies — the library has very few dependencies on third-party libraries, to avoid dependency conflicts for the users.

Authors and contributors

Versions

Version
1.0.0-alpha
0.2-alpha
0.1-alpha