🚀Quick Start

Only works for paying subscribers, purchase your API key here.

import sovai as sov
sov.token_auth(token="add_your_subscriber_token_here")

Installation

To use Sovai's python module you can install sovai.

pip install sovai[full]

The best way to familiarize yourself with this powerful library is to head straight to the tutorial section.

Data

If you only want to download data into pandas please use the much lighter package.

pip install sovai
import sovai as sov
sov.data("query")

Commands

Utilize various commands to interact with datasets:, data ,plots, and reports.

  • sov.data('query'): Retrieve data based on the specified query.

  • sov.plots('query'): Generate plots for visual analysis.

  • sov.reports('query'): Access reports summarizing predictions.

Authenticate Account: token_auth()

There are two ways to authenticate your requests. Get your token here.

import sovai as sov

# 1. Method 1: Configuration API connection
sov.token_auth(token="add_your_token_here")

# 2. Method 2: Or read token from .env file e.g API_TOKEN=super_secret_token
sov.read_key('.env')

Download Data: : data()

Once authenticated, downloading datasets becomes easy.

# Example data retrieval
gs_df = sov.data("bankruptcy/monthly")

Visualize Data: plot()

Unique Plots

Certain datasets have unique visualizations that you access from their respective pages.

# Calls the 'bankruptcy' dataset and the associated chart_type
sov.plot('bankruptcy', chart_type='compare')

Universal Plots

Other datasets can use panda's built-in plots.

df_risks = sov.data("risks")
df_risks[["MARKET_RISK","TURING_RISK"]].tail(15400).plot()

Running Reports: report()

Run report to explore the dataset.

sov.report("corprisk/accounting",report_type="sector-top")

We can also make use of pandas' built-in functions to run queries on top of the data.

df_risks.query("ticker == 'CGRNQ'")

Last updated