Access Brazilian Central Bank PIX Open Data API (pandas-friendly)
Project description
pixbr
Python client for the Brazilian Central Bank (BCB) PIX Open Data API (Olinda / OData service). It hides the BCB's unusual OData URL syntax and returns pandas DataFrames.
This is the Python counterpart of the R package
pixr.
Installation
pip install pixbr # once published
# or, from source:
pip install -e ".[dev]"
Quick start
Reusable client (recommended for multiple requests):
from pixbr import PixClient
client = PixClient()
# PIX keys stock by participant (date in YYYY-MM-DD)
keys = client.keys("2025-12-01", filter="TipoChave eq 'CPF'", top=100)
# Transaction statistics (database in YYYYMM)
stats = client.transaction_stats("202509", filter="NATUREZA eq 'P2P'")
# Transactions by municipality
muni = client.transactions_by_municipality("202512", filter="Sigla_Regiao eq 'NE'")
# Fraud statistics (MED)
fraud = client.fraud_stats("202509", top=100)
Module-level convenience functions mirror the pixr names:
from pixbr import get_pix_transaction_stats, get_pix_summary, format_brl
df = get_pix_transaction_stats("202509")
summary = get_pix_summary("202509", group_by="PAG_REGIAO")
format_brl(1234567.89) # 'R$ 1.234.567,89'
Endpoints
| Endpoint | Parameter | PixClient method |
Convenience function |
|---|---|---|---|
ChavesPix |
Data (YYYY-MM-DD) |
.keys() |
get_pix_keys() |
TransacoesPixPorMunicipio |
DataBase (YYYYMM) |
.transactions_by_municipality() |
get_pix_transactions_by_municipality() |
EstatisticasTransacoesPix |
Database (YYYYMM) |
.transaction_stats() |
get_pix_transaction_stats() |
EstatisticasFraudesPix |
Database (YYYYMM) |
.fraud_stats() |
get_pix_fraud_stats() |
Use pix_endpoints() and pix_columns("keys"|"municipality"|"stats"|"fraud")
to inspect available endpoints and columns.
OData query parameters
All endpoint methods accept the common OData parameters:
filter— OData filter expression, e.g."NATUREZA eq 'P2P' and PAG_REGIAO eq 'SUDESTE'"columns— list of columns to select (unknown columns are dropped with a warning)orderby—"Column"(asc) or"Column desc"top— maximum number of records
Note:
skipis not supported by the BCB PIX API; passing it emits a warning and is ignored. Usetopto limit results.
Notes
PixClient(timeout=..., max_retries=..., verbose=...)configures the HTTP session. The default timeout is 120s — the BCB API can be slow for large queries.client.build_url(...)/pix_url(...)return the request URL without sending it (handy for debugging).client.ping()/pix_ping()test connectivity to all four endpoints.
License
MIT
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 pixbr-0.1.0.tar.gz.
File metadata
- Download URL: pixbr-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
738a76f8f8fbbdaee5fb89d7d2439df6eb07c11edb23b2e256cd68664fe09b39
|
|
| MD5 |
7c18726dd3edb16f26aeda5e4818936f
|
|
| BLAKE2b-256 |
dc41525c9dadc17f806dbf92018c81774574d9cab1494217cf376787c6e35aac
|
Provenance
The following attestation bundles were made for pixbr-0.1.0.tar.gz:
Publisher:
publish.yml on StrategicProjects/pixbr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixbr-0.1.0.tar.gz -
Subject digest:
738a76f8f8fbbdaee5fb89d7d2439df6eb07c11edb23b2e256cd68664fe09b39 - Sigstore transparency entry: 1819661139
- Sigstore integration time:
-
Permalink:
StrategicProjects/pixbr@b326ad665aef06b803f55ba24f16d7c690d004c9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/StrategicProjects
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b326ad665aef06b803f55ba24f16d7c690d004c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pixbr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pixbr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 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 |
dd8c9f8d6111620d26508e57e054e7aeb09991c16b3f58759f213140c739239b
|
|
| MD5 |
fec0d3fcec76c4601193f295be33e21c
|
|
| BLAKE2b-256 |
dd348305abae7d1b51a04a187bac5b080e4202d1ffd32ad9a14ed2df79e3499f
|
Provenance
The following attestation bundles were made for pixbr-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on StrategicProjects/pixbr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixbr-0.1.0-py3-none-any.whl -
Subject digest:
dd8c9f8d6111620d26508e57e054e7aeb09991c16b3f58759f213140c739239b - Sigstore transparency entry: 1819661205
- Sigstore integration time:
-
Permalink:
StrategicProjects/pixbr@b326ad665aef06b803f55ba24f16d7c690d004c9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/StrategicProjects
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b326ad665aef06b803f55ba24f16d7c690d004c9 -
Trigger Event:
push
-
Statement type: