GithubHelp home page GithubHelp logo

codewithmustafa / tcmb_api_client Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.9 MB

This Dart package provides a simple and efficient way to interact with the Central Bank of the Republic of Türkiye (TCMB) API. It allows you to fetch exchange rates and other related data.

License: BSD 3-Clause "New" or "Revised" License

Dart 11.59% CSS 5.64% HTML 56.29% Kotlin 0.07% Swift 0.98% Objective-C 0.02% CMake 11.06% C++ 13.53% C 0.81%
currency dart flutter rates tcmb

tcmb_api_client's Introduction

TCMB API CLIENT

This Dart package provides a simple and efficient way to interact with the Central Bank of the Republic of Türkiye (TCMB) API. It allows you to fetch exchange rates and other related data.

Demo

Demo

⚠️ Information Regarding Data

This is a Dart client for the TCMB (Central Bank of the Republic of Türkiye) exchange rates API: https://www.tcmb.gov.tr/kurlar/{date}.xml. You can use dates such as today or 202404/22042024 as path parameters. Please note that the exchange rates provided are indicative and are announced by the Central Bank of the Republic of Türkiye, almost on a daily basis, hence they may not reflect real-time changes.

Features

  • Fetch exchange rate for current date
  • Fetch exchange rates for a specific date
  • Fetch a single rate for a specific currency and date
  • Easy to use with a clean and simple API

Getting Started

To use this package, add tcmb_api_client as a dependency in your pubspec.yaml file.

dependencies:
  tcmb_api_client: ^0.0.1

Usage

Here's a simple example of using TcmbApiClient to fetch exchange rates:

import 'package:tcmb_api_client/tcmb_api_client.dart';

Future<List<Currency>> fetchRates() async {
    try {
      return await _apiClient.getRates();
    } catch (e) {
      debugPrint('Error fetching rates: $e');
      rethrow;
    }
  }

Future<Currency?> fetchUsdRate() async {
    try {
      return await _apiClient.getSingleRate(CurrencyCode.USD);
    } catch (e) {
      debugPrint('Error fetching rate: $e');
      rethrow;
    }
}

Testing and Coverage

This package includes a comprehensive suite of unit tests, which ensures the reliability and correctness of the package's functionality. (Cov report added as an image just for now, will connect to a service later) Code Coverage Report

Disclaimer

Please note that this package is not affiliated with, officially connected to, or endorsed by the Central Bank of the Republic of Türkiye (TCMB). The package is developed and maintained independently. The official TCMB website can be found at https://www.tcmb.gov.tr. The name TCMB as well as related names, marks, emblems and images are registered trademarks of their respective owners.

tcmb_api_client's People

Contributors

codewithmustafa avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.