Skip to main content

No project description provided

Project description

Banco Central Chile SDK

A Python client library for the Banco Central de Chile SieteRestWS API.

This repository provides sync and async wrappers over the API, returning data as pandas.DataFrame or polars.DataFrame and managing retries, timeout configuration, and error handling.

Features

  • Synchronous and asynchronous SDK layers
  • Built-in HTTP retries using httpx-retries
  • Configurable httpx.Timeout
  • get_series(...) and search_series(...)
  • Output as pandas.DataFrame or polars.DataFrame
  • Standard logging integration using logging.getLogger(__name__)
  • Typed configuration and credentials

Requirements

  • Python 3.14+
  • aiohttp
  • httpx[brotli,zstd]
  • pydantic
  • polars
  • pandas
  • httpx-retries

Installation

This project is structured for development in a src/ layout.

Use Poetry if available:

poetry install

Or install the runtime dependencies manually:

python -m pip install aiohttp httpx[brotli,zstd] pydantic polars pandas httpx-retries

If you want to run code from the repository directly, make sure the src/ folder is on PYTHONPATH:

export PYTHONPATH=$(pwd)/src

Quickstart

Import the SDK classes and configure the client using BCChConfig.

Sync example

from httpx import Timeout
from src.types.core import BCChConfig
from src.sdk.sync_sdk import BCChSyncSDK

config = BCChConfig(
    credentials={"username": "your_user", "password": "your_pass"},
    timeout=Timeout(10.0),
)

sdk = BCChSyncSDK(configuration=config)

series_data = sdk.get_series(
    time_series="SF6041",
    first_date="2023-01-01",
    last_date="2023-12-31",
    polars_response=False,
)

print(series_data)

Async example

import asyncio
from httpx import Timeout
from src.types.core import BCChConfig
from src.sdk.async_sdk import BCChAsyncSDK

async def main() -> None:
    config = BCChConfig(
        credentials={"username": "your_user", "password": "your_pass"},
        timeout=Timeout(10.0),
    )

    sdk = BCChAsyncSDK(configuration=config)

    series_data = await sdk.get_series(
        time_series=["SF6041", "SF6060"],
        first_date="2023-01-01",
        last_date="2023-12-31",
        polars_response=True,
    )

    print(series_data)

asyncio.run(main())

Search series example

from src.types.enums import Frequency

result = sdk.search_series(Frequency.MONTHLY, polars_response=False)
print(result)

Configuration

The main configuration object is BCChConfig from src.types.core.

  • credentials: a typed dict with username and password
  • timeout: an httpx.Timeout object

The SDK clients use httpx under the hood and will apply retries and timeout settings automatically.

Logging

This library uses logging.getLogger(__name__) in each module. Consumers should configure handlers and levels in their own applications.

Example:

import logging

logging.basicConfig(level=logging.INFO)

Contributing

See CONTRIBUTING.md for contribution guidelines.

Security

See SECURITY.md for security reporting and vulnerability handling.

Code of Conduct

See CODE_OF_CONDUCT.md for community expectations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bcch_sdk-0.2.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bcch_sdk-0.2.1-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file bcch_sdk-0.2.1.tar.gz.

File metadata

  • Download URL: bcch_sdk-0.2.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bcch_sdk-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e70eac1feb1f1f95db2335be1adf17341ac65a564f34560ab1bf3b2dc1d6a329
MD5 c661215c2ff7caa68cb2564b10372af1
BLAKE2b-256 8fdc3abc02d6dc4fb146dc4f7e797e43e82dcfbda9c38a96367ed7bf76b55632

See more details on using hashes here.

Provenance

The following attestation bundles were made for bcch_sdk-0.2.1.tar.gz:

Publisher: publish.yml on ezer-mackenzie/bcch-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bcch_sdk-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: bcch_sdk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bcch_sdk-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d53d439edaa64c01b869def028a5ef2bf8dda71b18c0eb712044968b5f212c6
MD5 64f6094d7ef9cba6b547a63f2c23a180
BLAKE2b-256 004494b677b9bf4b8d8c7d545a244cdcccc7b3e61b84cc5316c46397c63a9d07

See more details on using hashes here.

Provenance

The following attestation bundles were made for bcch_sdk-0.2.1-py3-none-any.whl:

Publisher: publish.yml on ezer-mackenzie/bcch-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page