Client Reference¶
tickertape.client.TickerTapeClient ¶
Asynchronous client for interacting with TickerTape.
Example:
async with TickerTapeClient() as client:
# Reads from persistent cache (.cache/tickertape) or fetches live XML if not cached:
mf_sitemap = await client.sitemap.get("mf")
# Force live refresh and update disk cache:
refreshed = await client.sitemap.refresh("mf")
# Fetch fund details and ISIN:
fund = await client.mf.get("quant-infrastructure-fund-M_QUNG")
print(fund.isin, fund.nav)
Source code in src/tickertape/client.py
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 | |
close
async
¶
request
async
¶
request(
method: str,
url_or_path: str,
*,
params: Optional[dict[str, Any]] = None,
headers: Optional[dict[str, str]] = None,
**kwargs: Any
) -> str
Execute an HTTP request and return text response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
str
|
HTTP method ('GET', 'POST', etc.) |
required |
url_or_path
|
str
|
Full URL or path relative to base_url. |
required |
params
|
Optional[dict[str, Any]]
|
Optional query parameters. |
None
|
headers
|
Optional[dict[str, str]]
|
Optional extra headers. |
None
|
Returns:
| Type | Description |
|---|---|
str
|
Response body string. |
Raises:
| Type | Description |
|---|---|
TickerTapeNotFoundError
|
On HTTP 404. |
TickerTapeHTTPError
|
On other HTTP 4xx/5xx status codes. |