A beginner-friendly yet powerful Python toolkit for financial analysis and automation — built to make modern investing accessible to everyone
The Screener class provides advanced stock filtering and screening capabilities using TCBS data source with customizable parameters and criteria for Vietnamese stock market analysis.
API adapter for stock screening functionality with advanced filtering capabilities.
class Screener:
"""
Stock screener adapter for filtering and analysis.
Supported sources: TCBS only
"""
SUPPORTED_SOURCES = ["tcbs"]
def __init__(self, source: str = "tcbs", random_agent: bool = False, show_log: bool = False):
"""
Initialize Screener adapter.
Args:
source (str): Data source ("tcbs"), defaults to "tcbs"
random_agent (bool): Use random user agent, defaults to False
show_log (bool): Enable logging, defaults to False
"""Filter stocks based on various financial and technical criteria.
def stock(self, params: dict = None, limit: int = 50, id: str = None, lang: str = "vi") -> pd.DataFrame:
"""
Screen stocks using customizable filtering parameters.
Args:
params (dict): Screening parameters and criteria
limit (int): Maximum number of results, defaults to 50
id (str): Screen configuration ID, defaults to None
lang (str): Language ("vi", "en"), defaults to "vi"
Returns:
pd.DataFrame: Filtered stock results with screening metrics
"""from vnstock import Screener
# Initialize screener
screener = Screener(source="tcbs")
# Basic stock screening
results = screener.stock(limit=20, lang="vi")
# Advanced screening with parameters
filtered_stocks = screener.stock(
params={
"marketCap": {"min": 1000000000, "max": 10000000000},
"pe": {"min": 5, "max": 25},
"roe": {"min": 10}
},
limit=30
)
# Screening with specific criteria
value_stocks = screener.stock(
params={"pb": {"max": 1.5}, "pe": {"max": 15}},
limit=25,
lang="en"
)Install with Tessl CLI
npx tessl i tessl/pypi-vnstock