Python SDK for the Banco Central de Chile SieteRestWS API.
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(...)andsearch_series(...)- Output as
pandas.DataFrameorpolars.DataFrame - Standard
loggingintegration usinglogging.getLogger(__name__) - Typed configuration and credentials
Requirements
- Python 3.12+
httpx[brotli,zstd]pydanticpolarspandashttpx-retries
pandas and polars are runtime dependencies by design for the 0.x and 1.0
release line because DataFrame responses are part of the core SDK contract. They
may be split into optional extras in a future release after the stable API is
established.
Installation
This project uses a src/ layout and exposes the bcch_sdk package.
Use Poetry if available:
poetry install
Or install the runtime dependencies manually:
python -m pip install 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 bcch_sdk import BCChSyncSDK
from bcch_sdk.types import BCChConfig
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 bcch_sdk import BCChAsyncSDK
from bcch_sdk.types import BCChConfig
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 bcch_sdk.types import Frequency
result = sdk.search_series(Frequency.MONTHLY, polars_response=False)
print(result)
Configuration
The main configuration object is BCChConfig from bcch_sdk.types.config.
credentials: a typed dict withusernameandpasswordtimeout: anhttpx.Timeoutobject
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bcch_sdk-0.7.0.tar.gz.
File metadata
- Download URL: bcch_sdk-0.7.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d2d457991da45922ccdb665a8334745e5587341f47cb8cd60a9fd538c68928b
|
|
| MD5 |
3c760ed306b19d2553f0ffa7163e9880
|
|
| BLAKE2b-256 |
9c805a1d94885b7311dbca5031329f31f3484fc5897c611b1699cb853dfa61ee
|
Provenance
The following attestation bundles were made for bcch_sdk-0.7.0.tar.gz:
Publisher:
publish.yml on ezer-mackenzie/bcch-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bcch_sdk-0.7.0.tar.gz -
Subject digest:
5d2d457991da45922ccdb665a8334745e5587341f47cb8cd60a9fd538c68928b - Sigstore transparency entry: 2181686650
- Sigstore integration time:
-
Permalink:
ezer-mackenzie/bcch-sdk@a5ff5d9107ea46ca8a9926a7d06d5dc9215dbb36 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/ezer-mackenzie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a5ff5d9107ea46ca8a9926a7d06d5dc9215dbb36 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bcch_sdk-0.7.0-py3-none-any.whl.
File metadata
- Download URL: bcch_sdk-0.7.0-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd1a7fbb03123f034ceeab9ec7b6d74fc3e8496893826e4158fdb68ad8489650
|
|
| MD5 |
323cc7ab5462f240f45190e0cc8def96
|
|
| BLAKE2b-256 |
63a87251bfb005b77efce05cb0facfb2d059f5618892b4b5c6c696b7a4460f37
|
Provenance
The following attestation bundles were made for bcch_sdk-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on ezer-mackenzie/bcch-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bcch_sdk-0.7.0-py3-none-any.whl -
Subject digest:
dd1a7fbb03123f034ceeab9ec7b6d74fc3e8496893826e4158fdb68ad8489650 - Sigstore transparency entry: 2181686763
- Sigstore integration time:
-
Permalink:
ezer-mackenzie/bcch-sdk@a5ff5d9107ea46ca8a9926a7d06d5dc9215dbb36 -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/ezer-mackenzie
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a5ff5d9107ea46ca8a9926a7d06d5dc9215dbb36 -
Trigger Event:
release
-
Statement type: