Skip to content

The BCRA API Connector is a Python library that provides a convenient interface to interact with the BCRA (Banco Central de la República Argentina). It allows users to fetch principal variables and historical data from the BCRA.

License

Notifications You must be signed in to change notification settings

PPeitsch/bcra-connector

BCRA API Connector

PyPI version Python Versions Documentation Status Coverage License: MIT Tests Contributor Covenant

A Python connector for the BCRA (Banco Central de la República Argentina) APIs, covering Principal Variables/Monetary Statistics, Cheques, Exchange Rate Statistics, and Central de Deudores (Debtor Registry).

Features

  • Comprehensive Data Access: Fetch Principal Variables, Monetary Statistics, Checks information, Exchange Rates, and Debtor Registry data.
  • Central de Deudores: Query debtor information, historical debts, and rejected checks by CUIT/CUIL.
  • DataFrame Support: Convert API responses to pandas DataFrames with to_dataframe() methods.
  • Historical Data: Easily retrieve and analyze historical time series for any variable.
  • Robustness: Built-in retry logic with exponential backoff and safe failure handling.
  • Developer Friendly:
    • Full Type Hinting for better IDE support.
    • Bilingual context (Spanish API / English Wrapper).
    • Detailed debug logging.
  • Configurable: Options for SSL verification, retries, and timeouts.

Documentation

Full documentation, including installation instructions, usage examples, and API reference, is available at:

Installation

pip install bcra-connector

# With pandas support for DataFrame conversion
pip install bcra-connector[pandas]

For detailed installation instructions and requirements, see our Installation Guide.

Quick Start

Get up and running in seconds:

from bcra_connector import BCRAConnector

# Initialize the connector
connector = BCRAConnector()

# 1. List principal variables published by BCRA
variables = connector.get_principales_variables()
print(f"Found {len(variables)} variables.")

# 2. Get the latest value for a specific variable (e.g., using the ID of the first one)
if variables:
    target_var = variables[0]
    print(f"Fetching data for: {target_var.descripcion} (ID: {target_var.idVariable})")

    latest = connector.get_latest_value(target_var.idVariable)
    print(f"Latest Value: {latest.valor} on {latest.fecha}")

# 3. Get historical data (last 30 days)
#    (Note: Date range filtering is handled by the API or post-processing)

Contributing

Contributions are welcome! Please read our:

Security

For vulnerability reports, please review our Security Policy.

Change Log

See CHANGELOG.md for a list of changes and version updates.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This project is not officially affiliated with or endorsed by the Banco Central de la República Argentina. Use at your own risk.

About

The BCRA API Connector is a Python library that provides a convenient interface to interact with the BCRA (Banco Central de la República Argentina). It allows users to fetch principal variables and historical data from the BCRA.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Languages