Skip to main content

pybrsa: A Python Package for Turkish Banking Sector Data

PyPI version Documentation

A Python package for programmatic access to Turkish banking sector data from the Turkish Banking Regulation and Supervision Agency (BRSA, known as BDDK in Turkish). The package provides Python users with a clean interface to fetch monthly and quarterly banking statistics, financial reports, and sectoral indicators directly from BRSA’s official APIs. Specifically, the package retrieves tables from two distinct publication portals maintained by the BRSA:

Key Features

  • Direct API access to BRSA monthly bulletins (17 financial tables)
  • Quarterly FinTurk data with city-level granularity (7 tables, 82 cities including ‘HEPSI’ for all cities)
  • Consistent parameter interface for both data sources
  • Built-in metadata for tables, banking groups, and provinces
  • Multiple export formats: CSV, Excel via save_data()
  • Returns pandas DataFrames ready for analysis

Design Philosophy

Lightweight and Authentic: Other packages providing access to BDDK data also fetch data programmatically, but they add a heavy translation layer - maintaining manual configuration files to map Turkish column names and categorical values to English. This provides user convenience at a high maintenance cost.

pybrsa takes a different path. It interacts directly with the API and uses the data it returns with minimal alteration:

  • For the Monthly Bulletin, it uses the official English column names and labels provided by the API when lang = "en" is set.
  • For the FinTurk dataset, where the API provides data only in Turkish, it returns the authentic Turkish names.

This is a deliberate choice. By avoiding a separate translation file, pybrsa eliminates a major maintenance burden, aiming to adapt instantly to any API changes. This way, the data you see is exactly what the official source provides.

  • bddk (Python): Uses manual configuration for translations and column mappings and provides access only to the Monthly Bulletin.

  • bddkdata (Python): Provides similar functionality for Python/pandas users with the same constraints as bddk.

  • bddkR (R): Uses manual configuration for translations and column mappings and provides access only to the Monthly Bulletin. It is based on ‘bddkdata’

  • rbrsa R companion to this package with consistent API.

Installation

Install from PyPI:

pip install pybrsa

The development version can be installed from GitHub:

pip install git+https://github.com/obakis/pybrsa.git

Getting started

A vignette demonstrating how to use main functions, download and save data from both BDDK and FinTurk interface can be found at: Getting Started

The pybrsa package retrieves tables from two distinct publication portalsmaintained by the Turkish Banking Regulation and Supervision Agency (BDDK). Both portals are official sources, but they organize the data differently:

  • The Monthly Bulletin Portal provides high-level, summary reports designed for general consumption and quick overviews of monthly trends without any geographic coverage.
  • The FinTurk Data System provides granular, detailed data, including statistics broken down by province, whereas the standard Monthly Bulletin offers national-level aggregates.
## R users: to use list_tables() as in R you can do
# from pybrsa import list_tables, fetch_bddk
## or importing everything
# from pybrsa import * 

import pybrsa

# Explore available tables
pybrsa.list_tables("bddk")  # For English names
pybrsa.list_tables("bddk", "tr")  # For Turkish names
pybrsa.list_tables("finturk")

# Explore banking groups
pybrsa.list_groups("bddk")
pybrsa.list_groups("bddk", "tr")
pybrsa.list_groups("finturk")

# Fetch monthly data (Table 15: Ratios)
data = pybrsa.fetch_bddk(
    start_year=2024, start_month=1,
    end_year=2024, end_month=3,
    table_no=15, grup_kod=10001
)

# Fetch quarterly FinTurk data
q_data = pybrsa.fetch_finturk(
    start_year=2024, start_quarter=3,
    end_year=2024, end_quarter=9,
    table_no=1, grup_kod=10007
)

# Save results to CSV
q_data.to_csv("finturk_data.csv", index=False)

# Or use the save_data function for multiple formats
pybrsa.save_data(q_data, "finturk_data", format="csv")

Metadata

Release files for pybrsa 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybrsa 0.1.7
File Size Uploaded
pybrsa-0.1.7.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybrsa 0.1.7
File Interpreter ABI Platform
pybrsa-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / pybrsa-0.1.7.tar.gz

Download URL pybrsa-0.1.7.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
924c50e1e1bd317b56f71b3f34564226ed147720dd9fb66d69684021d94e66ac
BLAKE2b-256 checksum
How to use checksums
a820787bf1301fc3015828eead52e9a8f4c0335bec4a947b0fefdfd867131726
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.1

Release files / pybrsa-0.1.7-py3-none-any.whl

Download URL pybrsa-0.1.7-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcee6464697186dfbde038c64a83333dc5b1f33e4394e98c22f8469ca9f3a068
BLAKE2b-256 checksum
How to use checksums
4459c286d1b3917479fdd05a4168b59f5fce4905bafc9761064c2fa1fd209ac1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.1

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page