finalytics

Crates.iofinalytics
lib.rsfinalytics
version
sourcesrc
created_at2023-10-09 20:16:19.336975
updated_at2025-01-09 20:20:41.543273
descriptionA rust library for financial data analysis
homepagehttps://finalytics.rs/
repositoryhttps://github.com/Nnamdi-sys/finalytics
max_upload_size
id998433
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Nnamdi Olisaeloka (Nnamdi-sys)

documentation

README

Finalytics

Crates.io Docs.rs License Homepage CodeFactor Crates.io

Finalytics is a Rust library designed for retrieving financial data and performing security analysis and portfolio optimization.

Installation

Add the following to your Cargo.toml file:

[dependencies]
finalytics = "*"

Or run the following command:

cargo install finalytics

Example

View the documentation for more information.

use std::error::Error;
use finalytics::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {

    // Instantiate a Multiple Ticker Object
    let ticker_symbols = vec!["NVDA", "GOOG", "AAPL", "MSFT", "BTC-USD"];

    let tickers = TickersBuilder::new()
        .tickers(ticker_symbols.clone())
        .start_date("2023-01-01")
        .end_date("2024-12-31")
        .interval(Interval::OneDay)
        .benchmark_symbol("^GSPC")
        .confidence_level(0.95)
        .risk_free_rate(0.02)
        .build();

    // Generate a Single Ticker Report
    let ticker = tickers.clone().get_ticker("AAPL").await?;
    ticker.report(Some(ReportType::Performance)).await?.show()?;
    ticker.report(Some(ReportType::Financials)).await?.show()?;
    ticker.report(Some(ReportType::Options)).await?.show()?;
    ticker.report(Some(ReportType::News)).await?.show()?;

    // Generate a Multiple Ticker Report
    tickers.report(Some(ReportType::Performance)).await?.show()?;

    // Perform a Portfolio Optimization
    let portfolio = tickers.optimize(Some(ObjectiveFunction::MaxSharpe), None).await?;

    // Generate a Portfolio Report
    portfolio.report(Some(ReportType::Performance)).await?.show()?;

    Ok(())
}

Python Binding

pypi License Homepage Documentation Status Platform Python Version PePy

Installation

pip install finalytics

Example

View the documentation for more information.

from finalytics import Tickers

# Instantiate a Multiple Ticker Object
tickers = Tickers(symbols=["NVDA", "GOOG", "AAPL", "MSFT", "BTC-USD"],
                  start_date="2023-01-01",
                  end_date="2024-12-31",
                  interval="1d",
                  confidence_level=0.95,
                  risk_free_rate=0.02)

# Generate a Single Ticker Report
ticker = tickers.get_ticker("AAPL")
ticker.report("performance")
ticker.report("financials")
ticker.report("options")
ticker.report("news")

# Generate a Multiple Ticker Report
tickers.report("performance")

# Perform a Portfolio Optimization
portfolio = tickers.optimize(objective_function="max_sharpe")

# Generate a Portfolio Report
portfolio.report("performance")

Sample Applications

Ticker Dashboard

This sample application allows you to perform security analysis based on the Finalytics Library.

Portfolio Dashboard

This sample application enables you to perform portfolio optimization based on the Finalytics Library.

Commit count: 92

cargo fmt