Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A comprehensive Python library for scraping and retrieving real-time data across multiple financial markets, including cryptocurrencies, equities, Forex, treasury yields, and consumer price index (CPI) data.
⚠️ LEGAL DISCLAIMER ⚠️quantsumore is an API client that enables access to data from various sources. 🔴 Note the following critical information: Important Information👉 Users are advised to independently verify the accuracy of the data obtained via quantsumore and should base investment decisions on their own judgment supplemented by professional advice. The developers of quantsumore disclaim all responsibility for any inaccuracies, errors, or omissions in the data provided. No Warranty👉 Personal Use👉 Please note that the APIs are intended primarily for personal and non-commercial use. Users should refer to the individual terms of use for guidelines on commercial applications. |
quantsumore
LibraryThe quantsumore
library is a comprehensive Python package designed for retrieving and analyzing a wide range of financial market data. It provides specialized API clients to fetch data from various financial markets, including cryptocurrencies, equities, Forex, Treasury instruments, and Consumer Price Index (CPI) metrics. Below is an overview of the key API clients and their functionalities.
To start using the quantsumore
API clients for financial data analysis, follow these steps to install the package.
quantsumore
PackageYou can install quantsumore
directly from PyPI using pip
. Open your terminal and run the following command:
pip install quantsumore
This will install the quantsumore
package along with any required dependencies.
quantsumore
API ClientsThe crypto
API client allows users to easily fetch both real-time and historical cryptocurrency market data.
from quantsumore.api import crypto
# Fetch the latest market data for Bitcoin in USD from Binance
latest_data = crypto.cLatest(slug="bitcoin", baseCurrencySymbol="USD", quoteCurrencySymbol="JPY", cryptoExchange="binance", limit=100, exchangeType="all")
print(latest_data)
# Fetch historical data for Bitcoin from January 1, 2024, to January 10, 2024
historical_data = crypto.cHistorical(slug="bitcoin", start="2024-01-01", end="2024-01-10")
print(historical_data)
The cpi
API client allows users to fetch CPI data for all urban consumers and perform inflation adjustments.
from quantsumore.api import cpi
# Access CPI data for all urban consumers
cpi_data = cpi.CPI_U.InflationAdjustment.data
print(cpi_data)
# Adjust $100 from the year 2000 to its equivalent in 2024
adjusted_value = cpi.CPI_U.InflationAdjustment.select(original_amount=100, original_year=2000, target_year=2024, month_input="July")
print(f"Adjusted value: ${adjusted_value}")
The equity
API client provides users with tools to fetch company information, financial stats, and both real-time and historical stock price data.
from quantsumore.api import equity
# Fetch company bio for Apple Inc.
company_bio = equity.CompanyBio(ticker="AAPL")
print(company_bio)
# Fetch the latest stock price for Apple Inc.
latest_price = equity.sLatest(ticker="AAPL")
print(f"Latest stock price for AAPL: {latest_price}")
# Fetch historical stock price data for Apple from January 1, 2024, to January 10, 2024
historical_data = equity.sHistorical(ticker="AAPL", start="2024-01-01", end="2024-01-10")
print(historical_data)
The forex
API client allows users to fetch Forex-related data, including exchange rates, currency conversions, and interbank rates.
from quantsumore.api import forex
# Fetch historical exchange rates for EUR/USD from January 1, 2024, to January 10, 2024
historical_data = forex.fHistorical(currency_pair="EURUSD", start="2024-01-01", end="2024-01-10")
print(historical_data)
# Convert 100 Euros to USD based on the latest conversion rates
conversion_data = forex.CurrencyConversion(currency_pair="EURUSD", conversion_amount=100)
print(conversion_data)
The treasury
API client enables users to fetch U.S. Treasury-related data, including bill rates and yield curves.
from quantsumore.api import treasury
# Fetch the latest Treasury bill rates for the current year
tbill_rates = treasury.TBill(period="CY")
print(tbill_rates)
# Fetch the latest yield curve rates for the year 2023
yield_rates = treasury.Yield(period=2023)
print(yield_rates)
The fAnalysis
and tAnalysis
classes, provided by the quantsumore
library, offer comprehensive tools for conducting both fundamental and technical analysis of financial data. These modules allow users to explore a company's financial health through statements and ratios (fundamental analysis) and detect market trends, potential buy/sell signals, and volatility through technical indicators (technical analysis).
This guide will show you how to:
fAnalysis
(Fundamental Analysis)from quantsumore.analysis import fAnalysis
tAnalysis
(Technical Analysis)Next, initialize the tAnalysis
class with your financial data for technical analysis:
import pandas as pd
import numpy as np
from quantsumore.analysis import tAnalysis
# Sample data setup
data = pd.DataFrame({
'Date': pd.date_range(start='2020-01-01', periods=100),
'High': np.random.rand(100) * 100 + 150,
'Low': np.random.rand(100) * 100 + 100,
'Open': np.random.rand(100) * 100 + 125,
'Close': np.random.rand(100) * 100 + 130,
'Volume': np.random.randint(100, 1000, size=100),
'Symbol': ['AAPL'] * 100
})
# Initialize the tAnalysis class
analyze = tAnalysis(data)
fAnalysis
fAnalysis
provides a wide range of methods for accessing and analyzing financial data:
tAnalysis
tAnalysis
offers methods to compute various technical indicators:
# Fetch financial data for a specific ticker and period
fAnalysis('AAPL', 'Q')
# Access the balance sheet and income statement
income_statement = fAnalysis.income_statement
balance_sheet = fAnalysis.balance_sheet
# Calculate key financial ratios
current_ratio = fAnalysis.current_ratio()
debt_to_equity_ratio = fAnalysis.debt_to_equity_ratio()
print(f"Current Ratio: {current_ratio}")
print(f"Debt to Equity Ratio: {debt_to_equity_ratio}")
# Access dividend data if available
dividend_yield = fAnalysis.dividend_yield()
print(f"Dividend Yield: {dividend_yield}")
# Convert the income statement to a common size statement
common_size_income = fAnalysis.CommonSize("Income Statement")
print(common_size_income)
# Compute DMI and ADX
dmi = analyze.DirectionalMovementIndex(period=14, adx_threshold=25)
dmi.plot_indicators()
# Compute Aroon and plot
aroon = analyze.AroonIndicator(period=25)
aroon.plot_aroon()
# Compute On Balance Volume and detect divergences
obv = analyze.OnBalanceVolume()
obv.plot_obv_with_divergence()
# Compute A/D Line and plot
adl = analyze.AccumulationDistributionLine()
adl.plot_ad_line_with_divergence()
# Compute MACD and visualize
macd = analyze.MACD()
macd.plot_macd()
# Compute RSI and plot
rsi = analyze.RelativeStrengthIndex()
rsi.plot_rsi()
# Compute Stochastic Oscillator
stochastic = analyze.FastStochasticOscillator()
stochastic.plot_stochastic()
# Compute and plot SMA, EMA, and Bollinger Bands
mabb = analyze.MovingAveragesAndBollingerBands()
mabb.plot_indicators()
# Compute ATR and visualize
atr = analyze.AverageTrueRange()
atr.plot_atr()
FAQs
A comprehensive Python library for scraping and retrieving real-time data across multiple financial markets, including cryptocurrencies, equities, Forex, treasury yields, and consumer price index (CPI) data.
We found that quantsumore demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.