Resources Reference¶
Mutual Funds Resource¶
tickertape.resources.mf.MutualFundsResource ¶
Bases: _BaseResource
Resource for fetching and parsing mutual fund details from TickerTape.
Source code in src/tickertape/resources/mf.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
build_isin_index
async
¶
build_isin_index(
*,
force_refresh: bool = False,
concurrency: int = 5,
delay: float = 0.5,
limit: Optional[int] = None,
progress_callback: Optional[
Callable[[int, int, int, int], None]
] = None
) -> int
Crawl sitemap URLs and populate the SQLite ISIN lookup table.
When force_refresh=True: 1. Refreshes live sitemap XML. 2. Updates local sitemap disk cache (.cache/tickertape/sitemaps/mf.json). 3. Crawls fund pages and updates SQLite database (.cache/tickertape/isin_lookup.db).
When force_refresh=False: 1. Uses cached sitemap. 2. Resumes by crawling only unindexed funds. 3. Updates SQLite database.
Returns:
| Type | Description |
|---|---|
int
|
Number of indexed mappings saved to SQLite. |
Source code in src/tickertape/resources/mf.py
find_funds ¶
find_funds(
*,
sector: Optional[str] = None,
subsector: Optional[str] = None,
fund_type: Optional[str] = None,
plan: Optional[str] = None,
option: Optional[str] = None,
risk_level: Optional[str] = None,
benchmark: Optional[str] = None,
amc: Optional[str] = None,
limit: int = 100
) -> list[ISINMapping]
Find and gather mutual funds sharing similar classification attributes.
Source code in src/tickertape/resources/mf.py
get
async
¶
Fetch mutual fund details from TickerTape by slug or MFID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slug_or_mfid
|
str
|
Slug (e.g. 'quant-infrastructure-fund-M_QUNG') or MFID ('M_QUNG'). |
required |
Returns:
| Type | Description |
|---|---|
MutualFundDetail
|
Parsed MutualFundDetail. |
Source code in src/tickertape/resources/mf.py
get_by_isin
async
¶
Fetch mutual fund details using an ISIN.
Looks up the ISIN in the SQLite lookup table. If not found, attempts targeted resolution using hint_name against the sitemap and persists the result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isin
|
str
|
Mutual fund ISIN (e.g. 'INF966L01721'). |
required |
hint_name
|
Optional[str]
|
Optional scheme name to assist targeted resolution. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[MutualFundDetail]
|
Parsed MutualFundDetail if resolved, otherwise None. |
Source code in src/tickertape/resources/mf.py
get_cached_by_isin
async
¶
Get table record by isin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isin
|
str
|
Unique Identifier of scheme. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ISINMapping |
ISINMapping | None
|
ISINMapping Object (Table Record) |
Source code in src/tickertape/resources/mf.py
get_isin
async
¶
Convenience method to retrieve the ISIN for a mutual fund.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slug_or_mfid
|
str
|
Slug or MFID. |
required |
Returns:
| Type | Description |
|---|---|
Optional[str]
|
ISIN string (e.g., 'INF966L01721') or None if not found. |
Source code in src/tickertape/resources/mf.py
get_peers ¶
get_peers(
isin: str,
match_plan: bool = True,
match_option: bool = True,
limit: int = 20,
) -> list[ISINMapping]
Gather peer mutual funds in the same subsector/category as the given ISIN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
isin
|
str
|
Source fund ISIN. |
required |
match_plan
|
bool
|
If True, matches plan (e.g. Direct with Direct). |
True
|
match_option
|
bool
|
If True, matches option (e.g. Growth with Growth). |
True
|
limit
|
int
|
Maximum peers to return. |
20
|
Source code in src/tickertape/resources/mf.py
get_raw
async
¶
Fetch and extract the raw Next.js hydration payload dictionary.
Source code in src/tickertape/resources/mf.py
Sitemap Resource¶
tickertape.resources.sitemap.SitemapResource ¶
Bases: _BaseResource
Resource managing XML sitemaps with local persistent caching.
Source code in src/tickertape/resources/sitemap.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
clear_cache ¶
get
async
¶
Get parsed sitemap URLs for a category.
By default, loads from persistent disk cache (.cache/tickertape) unless force_refresh is True or cache does not exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str
|
Category key ('mf', 'stocks', 'etf', etc.) or custom sitemap key. |
'mf'
|
force_refresh
|
bool
|
If True, bypasses local cache, fetches live XML, and updates cache. |
False
|
Returns:
| Type | Description |
|---|---|
list[SitemapURL]
|
List of parsed SitemapURL items. |
Source code in src/tickertape/resources/sitemap.py
get_references
async
¶
Fetch and parse a sitemap index XML into a list of SitemapReference items.
Source code in src/tickertape/resources/sitemap.py
is_cached ¶
refresh
async
¶
Fetch live XML sitemap, parse it, update the local cache, and return items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
str
|
Category key ('mf', 'stocks', 'etf', etc.) or full URL. |
'mf'
|
Returns:
| Type | Description |
|---|---|
list[SitemapURL]
|
List of refreshed SitemapURL items. |