Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/aqlx86/karensi

PHP Library for fixer.io foreign exchange rates and currency conversion.
https://github.com/aqlx86/karensi

Last synced: 29 days ago
JSON representation

PHP Library for fixer.io foreign exchange rates and currency conversion.

Awesome Lists containing this project

README

        

# Karensi

[![Build Status](https://travis-ci.org/aqlx86/karensi.svg?branch=master)](https://travis-ci.org/aqlx86/karensi)

PHP Library for fixer.io foreign exchange rates and currency conversion.

## Installation

```
> composer.phar require aqlx86/karensi
> composer.phar install
```

## Usage

Fetch all
```
$karensi = new Karensi\Karensi('USD');
$rates = $karensi->fetch_rate();
```

Fetch specific currencies
```
$karensi = new Karensi\Karensi('USD', ['CAD', 'PHP']);
$rates = $karensi->fetch_rate();
```

Fetch historical rates
```
$karensi = new Karensi\Karensi('USD', ['CAD', 'PHP'], '2015-12-28');
$rates = $karensi->fetch_rate();
```

Save fetched rates in json format
```
$karensi->save('./rates/');
```

## Test

```
./bin/phpspec run
```