TickerLab Python SDK
Python client library for the TickerLab financial market data API.
Installation
pip install tickerlab
To enable automatic Pandas DataFrame conversion for time-series and tabular data:
pip install "tickerlab[pandas]"
Quick Start
import tickerlab as tl
# Set API authentication token
tl.set_token("YOUR_API_KEY")
# Fetch daily historical K-line data
df = tl.get_kline("000001.SZ", period="1d", start="2026-01-01", adjust="qfq")
print(df.tail())
# Fetch real-time market quote snapshot
snapshot = tl.get_snapshot("600519.SH")
print(snapshot)
# Fetch technical indicators (MACD, RSI, KDJ, BOLL, MA, EMA)
macd = tl.get_indicators("000001.SZ", indicator="macd")
print(macd.tail())
Authentication
Authentication can be configured programmatically or via environment variable:
export TICKERLAB_API_KEY="YOUR_API_KEY"
import tickerlab as tl
# When TICKERLAB_API_KEY is present in environment, manual set_token is optional
df = tl.get_kline("000001.SZ")
Method Reference
| Method | Description | Return Type |
|---|---|---|
get_kline(symbol, period='1d', start=None, end=None, adjust='qfq') |
Historical OHLCV market bars | DataFrame / dict |
get_snapshot(symbol) |
Real-time market quote snapshot | dict / DataFrame |
get_daily_basic(symbol, start=None, end=None) |
Valuation metrics (PE, PB, turnover, market cap) | DataFrame |
get_indicators(symbol, indicator='macd', period='1d') |
Calculated technical indicators | DataFrame |
get_trade_calendar(start=None, end=None) |
Market trading days and settlement schedule | DataFrame |
get_stock_list() |
Master instrument list and metadata | DataFrame |
search_stocks(query) |
Symbol and name search | DataFrame |
get_macro(indicator='cpi') |
Macroeconomic indicator series | DataFrame |
get_financial_ratios(symbol) |
Financial statement ratios | DataFrame |
query(endpoint, params={}) |
Low-level generic API request | dict / list |
License
MIT License. See LICENSE for details.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tickerlab-0.1.1.tar.gz
(9.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tickerlab-0.1.1.tar.gz.
File metadata
- Download URL: tickerlab-0.1.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6a6e3384a754cf09706a907e1a4dfb89c208c8bbe84d1e92fffe940fd2c30fc
|
|
| MD5 |
dd249f7c9667e15cb073f617f5c63d32
|
|
| BLAKE2b-256 |
6ae96eb265ed201096cc7a42aadcb01f108b0661395ed7474396721c8f77c81f
|
File details
Details for the file tickerlab-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tickerlab-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b49a811d737ef9e9d56c78dd9048fefa75705620547d730613b4bbb88262340
|
|
| MD5 |
14af0f312949751088911b35fdf9af97
|
|
| BLAKE2b-256 |
a5ca9d331d3a5cdac393fd1f7655e480cc4d08e79283ff56536f0c26af6e8c90
|