Skip to main content

Bavest Python SDK

The Bavest Finance SDK is an open-source library to create finance products in weeks. Bavest offers:

  • Financial api with 99.95% uptime
  • Easy to integrate and use
  • Free for open-source projects

Get API key

First, you need to create a Bavest account. After registration, you will find your api key in the dashboard.

Free API key for Open-Source projects

First, use the TypeForm to provide all required information. After, you will receive an API key via E-Mail.

Template

import os
import dateutil
from bavest import BavestRESTClient, Resolution
from datetime import datetime
import dateutil.relativedelta as relativedelta

BAVEST_API_KEY = os.environ.get('BAVEST_API_KEY')
client = BavestRESTClient(BAVEST_API_KEY)

if __name__ == "__main__":
    to = datetime.now()
    frm = to + dateutil.relativedelta.relativedelta(days=-2)
    to = to + dateutil.relativedelta.relativedelta(days=-1)
    resolution = Resolution.DAILY
    candles = client.candles("AAPL", frm, to, resolution)

Install the package

First install the python package using pip:

pip install bavest 

Documentation

See here for more information.

Usage

  1. Now, use the package in your project:
from bavest import BavestRESTClient
  1. Create a finance client:
client = BavestRestClient(apiKey)
  1. Now you can use it to get data from the api:
quote = client.quote("AAPL")

Examples

to = datetime.now()
frm = to + dateutil.relativedelta.relativedelta(days=-20)
resolution = Resolution.MONTHLY
candles = client.candles(symbol, frm, to, resolution)
news = client.news(symbol)
search = client.search(symbol)
forex = client.forex(frm, to)

# ETF
etfSector = client.etf.sector(symbol)
etfCountry = client.etf.country(symbol)
etfHoldings = client.etf.holdings(symbol)
etfProfile = client.etf.profile(symbol)

# Portfolio Items
transactionItem = TransactionItem("MSFT", 2, frm).get()
transactionList = [transactionItem]

portfolioRegion = client.portfolio.region(transactionList)
portfolioStats = client.portfolio.stats(frm, to, resolution, transactionList, "USD")
portfolioChart = client.portfolio.chart(frm, to, resolution, transactionList)

:octocat: Credits

  1. William Todt william.todt@bavest.co - Maintainer
  2. Hisham Parveez hisham.parveez@bavest.co - Maintainer

Contact

Please open a Github issue or send us an email at support@bavest.co.

Metadata

Release files for bavest 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bavest 1.0.1
File Size Uploaded Provenance
bavest-1.0.1.tar.gz 16.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bavest 1.0.1
File Interpreter ABI Platform
bavest-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 53.0 kB

Release files / bavest-1.0.1.tar.gz

Download URL bavest-1.0.1.tar.gz
Size 16.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7b90069a9ba25fc0e90dd832a7354a561b2e453c2a4aadde2b1f077fa1420933
BLAKE2b-256 checksum
How to use checksums
c2242ed44a9368056d241fff00a5bd37e4390524a7ab6af0cb672635ca237f9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / bavest-1.0.1-py3-none-any.whl

Download URL bavest-1.0.1-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b5e5ace3b2bbdfb5462bf34f89d4e1aa81f528fca704a22e231792d8dd69abb
BLAKE2b-256 checksum
How to use checksums
e08bffefda7a02d9e8f8f91de38fdcb703fdae807bf8a3c5a5f02000f97a17ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Security for bavest 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page