The Bavest Finance Python SDK
Project description
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
- Now, use the package in your project:
from bavest import BavestRESTClient
- Create a finance
client
:
client = BavestRestClient(apiKey)
- 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
- William Todt william.todt@bavest.co - Maintainer
- Hisham Parveez hisham.parveez@bavest.co - Maintainer
Contact
Please open a Github issue or send us an email at support@bavest.co
.
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
bavest-1.0.1.tar.gz
(16.5 kB
view details)
Built Distribution
bavest-1.0.1-py3-none-any.whl
(36.5 kB
view details)
File details
Details for the file bavest-1.0.1.tar.gz
.
File metadata
- Download URL: bavest-1.0.1.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b90069a9ba25fc0e90dd832a7354a561b2e453c2a4aadde2b1f077fa1420933 |
|
MD5 | b207dd2bc645ff0b93ca784f0a055029 |
|
BLAKE2b-256 | c2242ed44a9368056d241fff00a5bd37e4390524a7ab6af0cb672635ca237f9c |
File details
Details for the file bavest-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: bavest-1.0.1-py3-none-any.whl
- Upload date:
- Size: 36.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b5e5ace3b2bbdfb5462bf34f89d4e1aa81f528fca704a22e231792d8dd69abb |
|
MD5 | db98330e9c07d01179e2372826044223 |
|
BLAKE2b-256 | e08bffefda7a02d9e8f8f91de38fdcb703fdae807bf8a3c5a5f02000f97a17ee |