Skip to main content

Python client for B3 Market Data API

Project description

PyB3 Data Client

Python client library for consuming the B3 Market Data API.

PyPI version Python 3.8+ MIT License


Installation

From PyPI (Recommended)

pip install pyb3-data-client

From Source

git clone https://github.com/PedroDnT/pyb3.git
cd pyb3/clients/python
pip install .

Usage

from pyb3_data_client import B3Client

client = B3Client(
    api_key="your_api_key",
    base_url="https://your-api.fly.dev"  # Optional, defaults to production
)

# Get daily stock data
df = client.get_daily_data(
    symbols=["PETR4", "VALE3"],
    start_date="2024-01-01",
    end_date="2024-01-31"
)

print(df.head())

Returns Polars DataFrame (use .to_pandas() for pandas).


Documentation

See main project documentation:


Available Methods

# Get daily market data
df = client.get_daily_data(
    symbols=["PETR4", "VALE3"],
    start_date="2024-01-01",
    end_date="2024-12-31",
    format="parquet"  # or "json"
)

# Get symbol metadata
symbols = client.get_symbols(instrument_type="equity")

# Get account information
account = client.get_account_info()

# Get usage statistics
usage = client.get_usage()

Requirements

  • Python 3.8+
  • requests >= 2.31.0
  • polars >= 0.20.0
  • pyarrow >= 15.0.0

License

MIT License - see LICENSE file


Made with ❤️ for the Brazilian financial data community

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

pyb3_data_client-1.0.0.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

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

pyb3_data_client-1.0.0-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file pyb3_data_client-1.0.0.tar.gz.

File metadata

  • Download URL: pyb3_data_client-1.0.0.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pyb3_data_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2e2f74c7b8230259594341a96f6b88d61f5a5ccbaf5dadec699fb803fe3f8829
MD5 774726cc26f2e8960c395968d5e644a8
BLAKE2b-256 fc410dae79359b4764478125a7d8a896a7183e754b74f399656735c7eec24e6f

See more details on using hashes here.

File details

Details for the file pyb3_data_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyb3_data_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 662c65b7c928014096e94ce909ca971fa4c824a0324015a9c2fa916640bb7a60
MD5 ef6ce31af077369ab37854a0492435cf
BLAKE2b-256 9942b4b9d5416b232aab96da861b4352552150359dc37a51230a988b65aa7a31

See more details on using hashes here.

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