https://github.com/sibyx/ecb-reference-rates-parser
A simple library for parsing reference rates from European Central Bank open XML API
https://github.com/sibyx/ecb-reference-rates-parser
Last synced: 6 months ago
JSON representation
A simple library for parsing reference rates from European Central Bank open XML API
- Host: GitHub
- URL: https://github.com/sibyx/ecb-reference-rates-parser
- Owner: Sibyx
- License: mit
- Created: 2017-12-14T10:24:59.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-26T11:58:08.000Z (over 4 years ago)
- Last Synced: 2023-09-16T12:20:28.708Z (about 2 years ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ECB Reference Rates Parser
A simple PHP library for parsing current reference rates from [European Central Bank](http://www.ecb.europa.eu) stored in [remote XML file](http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml).
## Installation
```bash
composer install sibyx/ecb-reference-rates-parser
```## Usage example
```php
getDate()->format("Y-m-d"));
printf("JSON representation of RateReference object: %s\n", json_encode($list));printf("\n");
/** @var \EcbReferenceRates\Models\Rate $rate */
foreach ($list->getRates() as $rate)
{
printf("Currency: %s\n", $rate->getCurrency());
printf("Rate: %f\n", $rate->getRate());
printf("String representation of Rate object: %s\n", $rate);
printf("JSON: %s\n", json_encode($rate));printf("\n");
}
```## Contributors
- [Jakub Dubec](https://github.com/Sibyx) - Initial works, maintenance
I wrote this library as part of my job in [Backbone s.r.o.](https://www.backbone.sk/en/).## License
This project is licensed under the terms of the MIT license.