Parsers Reference¶
Functions¶
tickertape.parsers.register_parser ¶
Register a new parser type (e.g., 'stocks', 'etf', 'screens').
tickertape.parsers.get_parser ¶
Instantiate a registered parser by name.
Source code in src/tickertape/parsers/__init__.py
Base Parser¶
tickertape.parsers.base.BaseParser ¶
Bases: ABC, Generic[T]
Abstract base class for all TickerTape content and response parsers.
Source code in src/tickertape/parsers/base.py
parse
abstractmethod
¶
Parse raw content (string, bytes, or parsed structure) into domain models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
Any
|
Raw response body or structured data. |
required |
Returns:
| Type | Description |
|---|---|
T
|
Parsed domain model or collection of models. |
Raises:
| Type | Description |
|---|---|
TickerTapeParseError
|
If parsing fails. |
Source code in src/tickertape/parsers/base.py
Mutual Fund Parser¶
tickertape.parsers.mf.MFParser ¶
Bases: BaseParser[MutualFundDetail]
Parser for mutual fund page HTML and Next.js hydration payload.
Source code in src/tickertape/parsers/mf.py
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 | |
extract_isin ¶
extract_next_data ¶
Extract and parse NEXT_DATA JSON script from HTML.
Source code in src/tickertape/parsers/mf.py
parse ¶
Parse mutual fund page HTML string or pre-extracted JSON dict into MutualFundDetail.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str | dict[str, Any]
|
Raw HTML text containing |