Metadata-Version: 2.4
Name: bcra-py
Version: 0.1.0
Summary: BCRA wrapper Python package
Author: marpeand
License: MIT License
        
        Copyright (c) 2026 marpeand
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/marpeand/bcra-py
Project-URL: Source, https://github.com/marpeand/bcra-py
Project-URL: Documentation, https://github.com/marpeand/bcra-py#readme
Project-URL: Bug Reports, https://github.com/marpeand/bcra-py/issues
Keywords: BCRA,Argentina,API,Wrapper
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx
Requires-Dist: pandas
Requires-Dist: openpyxl
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: mkdocs; extra == "dev"
Dynamic: license-file

# bcra-py

[![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![PyPI version](https://badge.fury.io/py/bcra-py.svg)](https://badge.fury.io/py/bcra-py)

An unofficial Python wrapper to interact with the official [API of the Central Bank of the Argentine Republic (BCRA)](https://www.bcra.gob.ar/en/central-bank-api-catalog/).

`bcra-py` allows to easily query financial information, monetary statistics, exchange rates, debtors' credit risk, reported checks, and the BCRA's transparency regime. The library supports exporting the results directly to Pandas DataFrames, CSV, JSON, or Excel.

---

## Features

- **Monetary Statistics (`monetarias`)**: Query monetary variables and their methodology using dynamic properties.
- **Exchange Rates (`cambiarias`)**: Retrieve the list of supported currencies and the official exchange rates.
- **Central de Deudores (`deudores`)**: Search for credit status, historical debt reports, and rejected checks using a CUIT/CUIL/CDI.
- **Checks (`cheques`)**: Get a list of financial entities and query reported (stolen/lost) checks.
- **Transparency (`transparencia`)**: Access comparative financial data regarding savings accounts, term deposits, credit cards, and loans.
- **Data Export**: Easily convert API responses to `pandas.DataFrame`, `CSV`, `JSON`, or `Excel`.

---

## Installation

```bash
pip install bcra-py
```

Or install locally from source:

```bash
git clone https://github.com/marpeand/bcra-py.git
cd bcra-py
pip install .
```

---

## Quick Start

```python
from bcrapy.client import BCRAClient

# Initialize the client
client = BCRAClient()

# Example 1: Query the BADLAR rate (dynamically generated monetary variable)
df_badlar = client.monetarias.badlar_bancos_privados(
    desde="2023-01-01",
    hasta="2023-01-31"
).to_dataframe()
print(df_badlar.head())

# Example 2: Query the 'Central de Deudores' (Credit Risk) using a CUIT/CUIL (e.g. Banco Nación)
deudores_resp = client.deudores.deudas("30-50001091-2")
print(deudores_resp.to_dataframe())

# Example 3: Query today's exchange rates
cotizaciones = client.cambiarias.cotizaciones()
print(cotizaciones.to_dataframe())

# Export data to CSV / JSON / Excel
res = client.transparencia.plazos_fijos()
res.to_csv("plazos_fijos.csv")
res.to_excel("plazos_fijos.xlsx")
res.to_json("plazos_fijos.json")
```

---

## Module Overview

| Resource               | Description                   | Example Methods                                                                      |
| ---------------------- | ----------------------------- | ------------------------------------------------------------------------------------ |
| `client.monetarias`    | Monetary statistics           | `metodologia()`, `badlar_bancos_privados()`, `reservas_internacionales()`            |
| `client.cambiarias`    | Currencies and exchange rates | `maestros()`, `cotizaciones(fecha)`, `cotizacion(moneda)`                            |
| `client.deudores`      | Credit info and debtors       | `deudas(cuit)`, `deudas_historicas(cuit)`, `cheques_rechazados(cuit)`                |
| `client.cheques`       | Banking entities and checks   | `entidades()`, `denunciados(codigoEntidad, numeroCheque)`                            |
| `client.transparencia` | Bank products comparison      | `caja_ahorro()`, `plazos_fijos()`, `tarjetas_de_credito()`, `prestamos_personales()` |

---

## License

This project is licensed under the terms of the [MIT License](LICENSE).
