PHPackages                             rustem-kaimolla/kz-currency-rates - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rustem-kaimolla/kz-currency-rates

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rustem-kaimolla/kz-currency-rates
=================================

PHP-библиотека для получения курсов валют с НБ РК

v1.0.0(1y ago)10MITPHPPHP &gt;=8.1

Since May 12Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/rustem-kaimolla/kz-currency-rates)[ Packagist](https://packagist.org/packages/rustem-kaimolla/kz-currency-rates)[ RSS](/packages/rustem-kaimolla-kz-currency-rates/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

🇰🇿 KZ Currency Rates
====================

[](#-kz-currency-rates)

[![PHP](https://camo.githubusercontent.com/bcd03593121165ca7cfe9e516d5821d36ec2589673ee53fdb5e97ca349d5ebc0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e312d626c7565)](https://camo.githubusercontent.com/bcd03593121165ca7cfe9e516d5821d36ec2589673ee53fdb5e97ca349d5ebc0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d382e312d626c7565)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)[![Packagist](https://camo.githubusercontent.com/533138337bd2cb2a769a5a6e661679f02dd8d260325d60bc45bb59aec38ca470/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72757374656d2d6b61696d6f6c6c612f6b7a2d63757272656e63792d7261746573)](https://camo.githubusercontent.com/533138337bd2cb2a769a5a6e661679f02dd8d260325d60bc45bb59aec38ca470/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72757374656d2d6b61696d6f6c6c612f6b7a2d63757272656e63792d7261746573)[![Downloads](https://camo.githubusercontent.com/731b08eecf3ba71eb127d9880940b91c5aea2a751a73d5dc81abe2cc4f9e18d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72757374656d2d6b61696d6f6c6c612f6b7a2d63757272656e63792d7261746573)](https://camo.githubusercontent.com/731b08eecf3ba71eb127d9880940b91c5aea2a751a73d5dc81abe2cc4f9e18d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72757374656d2d6b61696d6f6c6c612f6b7a2d63757272656e63792d7261746573)

**Lightweight PHP library** for getting exchange rates from the official API of the National Bank of Kazakhstan.

📡 Source: [https://nationalbank.kz/rss/get\_rates.cfm?fdate=dd.mm.YYYY](https://nationalbank.kz/rss/get_rates.cfm?fdate=dd.mm.YYYY)

---

🚀 Installation
--------------

[](#-installation)

```
composer require rusdev/kz-currency-rates
```

---

🧱 Stack
-------

[](#-stack)

- PHP 8.1+
- Guzzle HTTP client
- PSR-4 autoload

---

📦 Quick start
-------------

[](#-quick-start)

```
use Currency\Requests\RateRequestBuilder;
use Currency\Parsers\XmlRateParser;
use Currency\Services\RateFetcher;
use GuzzleHttp\Client;

$builder = (new RateRequestBuilder())->forDate('12.05.2025');
$parser = new XmlRateParser();

$fetcher = new RateFetcher(
    $builder->build(),
    $parser
);

$rates = $fetcher->getAllRates();

foreach ($rates as $rate) {
    echo $rate->code . ': ' . $rate->rate . PHP_EOL;
}
```

---

📌 Receiving a specific currency
-------------------------------

[](#-receiving-a-specific-currency)

```
$usd = $fetcher->getRate('USD');

echo "USD/KZT: {$usd->rate} ₸";
```

---

🧠 Filtering major currencies (Specification)
--------------------------------------------

[](#-filtering-major-currencies-specification)

```
use Currency\Filters\MajorCurrencySpecification;

$spec = new MajorCurrencySpecification();

$majorRates = array_filter($rates, fn($rate) => $spec->isSatisfiedBy($rate));

foreach ($majorRates as $rate) {
    echo $rate->currency() . ': ' . $rate->value() . PHP_EOL;
}
```

---

🧪 Tests
-------

[](#-tests)

```
composer test
```

Test Coverage:

- XmlRateParser
- RateRequestBuilder
- CurrencyRateDTO
- MajorCurrencySpecification
- RateFetcher (с Guzzle mock)

---

📄 License
---------

[](#-license)

MIT.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

365d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7aa76e6cb2bda76821cb44fc3008161c2110496e11f3d7d9ba69813ac8cf0bdc?d=identicon)[rustemKaimolla](/maintainers/rustemKaimolla)

---

Top Contributors

[![exactkz](https://avatars.githubusercontent.com/u/79911015?v=4)](https://github.com/exactkz "exactkz (1 commits)")[![rustem-kaimolla](https://avatars.githubusercontent.com/u/72618924?v=4)](https://github.com/rustem-kaimolla "rustem-kaimolla (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rustem-kaimolla-kz-currency-rates/health.svg)

```
[![Health](https://phpackages.com/badges/rustem-kaimolla-kz-currency-rates/health.svg)](https://phpackages.com/packages/rustem-kaimolla-kz-currency-rates)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
