No project description provided
Project description
This is a python binding for Finalytics Rust Library designed for retrieving financial data and performing security analysis and portfolio optimization.
Installation
pip install finalytics
Documentation
View Library documentation on readthedocs here
Symbol Search
from finalytics import get_symbols
print(get_symbols(query="Apple", asset_class="Equity"))
print(get_symbols(query="Bitcoin", asset_class="Crypto"))
print(get_symbols(query="S&P 500", asset_class="Index"))
print(get_symbols(query="EURUSD", asset_class="Currency"))
print(get_symbols(query="SPY", asset_class="ETF"))
Security Analysis
from finalytics import Ticker
ticker = Ticker(symbol="AAPL")
print(ticker.get_current_price())
print(ticker.get_summary_stats())
print(ticker.get_price_history(start="2023-01-01", end="2023-10-31", interval="1d"))
print(ticker.get_options_chain())
print(ticker.get_news(start="2023-11-01", end="2023-11-10", compute_sentiment=False))
print(ticker.get_income_statement())
print(ticker.get_balance_sheet())
print(ticker.get_cashflow_statement())
print(ticker.get_financial_ratios())
print(ticker.compute_performance_stats(start="2023-01-01", end="2023-10-31", interval="1d", benchmark="^GSPC",
confidence_level=0.95, risk_free_rate=0.02))
ticker.display_performance_chart(start="2023-01-01", end="2023-10-31", interval="1d", benchmark="^GSPC",
confidence_level=0.95, risk_free_rate=0.02, display_format="notebook")
ticker.display_candlestick_chart(start="2023-01-01", end="2023-10-31", interval="1d", display_format="html")
ticker.display_options_chart(risk_free_rate=0.02, chart_type="surface", display_format="png")
Portfolio Optimization
from finalytics import Portfolio
portfolio = Portfolio(ticker_symbols=["AAPL", "GOOG", "MSFT", "BTC-USD"],
benchmark="^GSPC", start="2020-01-01", end="2022-01-01", interval="1d",
confidence_level=0.95, risk_free_rate=0.02, max_iterations=1000,
objective_function="max_sharpe")
print(portfolio.get_optimization_results())
portfolio.display_portfolio_charts("html")
DeFi Liquidity Pools
from finalytics import DefiPools
defi_pools = DefiPools()
print(f"Total Value Locked: ${defi_pools.total_value_locked:,.0f}")
defi_pools.display_top_protocols_by_tvl(pool_symbol="USDC-USDT", num_protocols=20, display_format="html")
defi_pools.display_top_protocols_by_apy(pool_symbol="USDC-USDT", num_protocols=20, display_format="html")
defi_pools.display_pool_tvl_history(pool_symbol="USDC-USDT", protocol="uniswap-v3", chain="ethereum", display_format="html")
defi_pools.display_pool_apy_history(pool_symbol="USDC-USDT", protocol="uniswap-v3", chain="ethereum", display_format="html")
DeFi User Balances
from finalytics import DefiBalances
from finalytics import get_supported_protocols
supported_protocols = get_supported_protocols()
print(supported_protocols)
# This function requires node.js and pnpm to be installed on the system
# for macos: brew install node && npm install -g pnpm
# for ubuntu: sudo apt install nodejs && npm install -g pnpm
# for windows: https://nodejs.org/en/download/ && npm install -g pnpm
defi_balances = DefiBalances(protocols=["wallet", "eigenlayer", "blast", "ether.fi"],
chains=["ethereum", "arbitrum"],
address="0x7ac34681f6aaeb691e150c43ee494177c0e2c183",
display_format="html")
print(defi_balances.balances)
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
finalytics-0.2.4.tar.gz
(59.1 kB
view hashes)
Built Distributions
Close
Hashes for finalytics-0.2.4-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4404d42fc460a624a5f9161db18904c7ef5b4c12d3c8f7ff77a54c2ea51c1a75 |
|
MD5 | b6efc8a27269ae25bedb8b0152fd8476 |
|
BLAKE2b-256 | b14c0446c6c7d61f67fa583dbbc7abf170581fc4e938bbc9a6ca21bf23c34e24 |
Close
Hashes for finalytics-0.2.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe52ed4dcb34da7141b90ea7a3c3cd297083268edf7ec22dc9fc6474628e94d6 |
|
MD5 | 4597ccaec3cf177f698b3015548d5e25 |
|
BLAKE2b-256 | d37c522413af93f4294b4f57fe3fc5f57287be03b2050cbcd5bdf282c398a6a3 |
Close
Hashes for finalytics-0.2.4-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a02f387eb8b9caa75d796d63ef11fa5ff5e25db870fd2ba5bfb7d240afa79196 |
|
MD5 | d3de74d32b18d5a21579d47d4a2a187f |
|
BLAKE2b-256 | 628ab033d4136ab39045ce3bd0ccd2f05fadb60ac5b91d411fc0ff43eeb3cb21 |
Close
Hashes for finalytics-0.2.4-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f23cf50e7b93d6571e14e8a5b33861c9385137dafc1161ae0c714251b1cb7213 |
|
MD5 | cc223ce9ab371c39a1112cccbecde9c9 |
|
BLAKE2b-256 | cbf4800dee061c102bed738953d94d49c1b599e0e4d7845c881858d524dbf590 |
Close
Hashes for finalytics-0.2.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf0d02ba8cc0d1335fa908bda503c9495d613694ee51196f80b45708565d8c88 |
|
MD5 | c5433c8ab5be8b1f7b8435fabbca70e8 |
|
BLAKE2b-256 | c77d6aef0af5149d855462a6ac3bca5d97bd67168314be92b87106239bdac7a8 |
Close
Hashes for finalytics-0.2.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d829b68eb02abb97f5498d147d631480c1bf19059d42244cd0f4edd03485fcc |
|
MD5 | eda99aca833540b53f64423ad75b53a9 |
|
BLAKE2b-256 | bed40d7dfc7dd39208c4da642f7b5f13a3604f3ade14c1764f45117370ae10f1 |
Close
Hashes for finalytics-0.2.4-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f52a4868a6d3d6bdbcdf7766c4a128806255f985ef9cd17b24c9e30ae029dab |
|
MD5 | 33f70890fab2bec09252a616b205b534 |
|
BLAKE2b-256 | 3e808d905f75e2715f69b40d01e9ecdfcd0b594e6b3ed59cf83821d86de5042c |
Close
Hashes for finalytics-0.2.4-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d746e4b0705a37960a0ef1c8ea2a4e6d2cb25c1a58a9d8c2bd1f91e3c08a131 |
|
MD5 | f9460499b04d4ab4c0d22d5ed6f42777 |
|
BLAKE2b-256 | 44aa48eca972e9bce983a15a35444b06e3bf3e274b01ae7e79db72d09dc055d8 |
Close
Hashes for finalytics-0.2.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7acaae414f0a6fc1a50e3ad5197f62751d02af53ab049c61512a2147283755db |
|
MD5 | cc4db0ddaa721d33ad1c073159dd7009 |
|
BLAKE2b-256 | 8b104d36182a6da51c314e6c072b92131a9238eaf1b1eca3215a9542f8d4960a |
Close
Hashes for finalytics-0.2.4-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd08660c971fed16fedb3163a395fb1242b84200c3abcef986f85acf703f4d18 |
|
MD5 | c1bb788dbd836f4ed90fdd721ddc897f |
|
BLAKE2b-256 | a088d4f3c4cc9ca56ac0e4a47b6c9e61bf2026d73ce5b6313a2500cae7f864f1 |
Close
Hashes for finalytics-0.2.4-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95faf865294e20cbb4e1b477edc73b6bfd96137c324b0c607c3beec839ed30b7 |
|
MD5 | c4e2473f5a0ab241814de807993b1157 |
|
BLAKE2b-256 | e9c990852f78762989f53db418a844c0201a25acd87fb58d98cefce7efca94b9 |
Close
Hashes for finalytics-0.2.4-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e11a0896438ffdf41a7699797f203aaa80e2505240a766970f3a16ca1f428eaf |
|
MD5 | 12fcec5a52b388547306cef531290aa4 |
|
BLAKE2b-256 | b3637129cdf1e3c607cd5c2008d6deb8dcd57f76dee4bab7dc796f18d0f3276b |
Close
Hashes for finalytics-0.2.4-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93b3f9889b426eb0249f2d4806a129fab31caacfb2410cf2fe1fb53ebeaca7c5 |
|
MD5 | 35b23bf358cfbbf9e16cedb87523a0ba |
|
BLAKE2b-256 | b0c75932220ece13c605da4294c7c77ae70266b5f7cc4f0ab55f2110fba2d124 |