Python SDK for Gangtise OpenAPI
Project description
gangtise-openapi
Python SDK for Gangtise OpenAPI. Feature-parity with the npm CLI gangtise-openapi-cli v0.15.0 across 75 upstream endpoints, plus local auth status helpers.
Changelog
0.1.1 - 2026-05-28
- Added runnable sample coverage for all public SDK methods: 74 sync examples in
sample/sync/and 74 async examples insample/async/. - Added complete API parameter documentation in
sample/API_PARAMETERS.md. - Standardized sample output: DataFrame responses print directly, text and structured responses are saved as Markdown under
sample_outputs/, and download samples save files undersample_downloads/. - Improved download handling so sample downloads keep the API-provided or original document name and extension where available.
0.1.0 - 2026-05-28
- Initial SDK release with sync and async APIs, DataFrame-by-default responses, retries, token self-healing, pagination helpers, async-content polling, and npm CLI-compatible token cache.
Install
pip install gangtise-openapi
Requires Python 3.10+.
Configure
export GANGTISE_ACCESS_KEY=ak_xxx
export GANGTISE_SECRET_KEY=sk_xxx
(Or pass access_key= and secret_key= explicitly to GangtiseClient.) The token cache file at ~/.config/gangtise/token.json is shared with the npm CLI.
Quickstart
from gangtise_openapi import gangtise
# Tabular endpoints return a pandas DataFrame
df = gangtise.quote.day_kline(
security="000001.SH",
start_date="2026-01-01",
end_date="2026-01-31",
)
# Use raw=True to get the underlying dict/list
result = gangtise.insight.opinion_list(industry=1, size=20, raw=True)
# Async
import asyncio
async def main():
df = await gangtise.async_.quote.day_kline(security="000001.SH")
asyncio.run(main())
Samples
Every public SDK method has a standalone customer-testable script.
uv run python sample/sync/quote_day_kline.py
uv run python sample/async/quote_day_kline.py
DataFrame-returning samples print the DataFrame directly. Text or dict/list responses are written as standard Markdown files under sample_outputs/. Download samples write real files under sample_downloads/ and preserve the server-provided or original filename when possible.
See sample/README.md for run notes and sample/API_PARAMETERS.md for complete method parameter documentation.
Endpoints
The SDK exposes 75 upstream endpoints across 9 domains:
gangtise.auth.*— login, statusgangtise.lookup.*— local lookup tables (research areas, brokers, industries, ...)gangtise.reference.*— securities search (GTS codes)gangtise.insight.*— opinions, research reports, announcements, schedulesgangtise.quote.*— K-line, real-time quotesgangtise.fundamental.*— financial statements, valuation, holders, forecastsgangtise.ai.*— AI-generated insights (one-pager, peer comparison, earnings reviews, ...)gangtise.vault.*— personal drive, meeting records, stock pools, WeChatgangtise.alternative.*— economic indicators (EDB), concept (theme) index profile + constituents
The Python wrappers accept the same parameters as the CLI flags, using snake_case instead of --kebab-case. For example, CLI --start-date maps to Python start_date.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 gangtise_openapi-0.1.4.tar.gz.
File metadata
- Download URL: gangtise_openapi-0.1.4.tar.gz
- Upload date:
- Size: 48.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a277b2075fbc9699d23d7497808655971af09d45ca4e4c7d5d7d71ebc79b1403
|
|
| MD5 |
38f6690ed44cabc9ac3a6a8ddc2e3321
|
|
| BLAKE2b-256 |
1af41b5fb590ef499aa6a945f6db38b2b322138a2e617304e351bc66f3a64ef2
|
Provenance
The following attestation bundles were made for gangtise_openapi-0.1.4.tar.gz:
Publisher:
release.yml on gangtiser/gangtise-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gangtise_openapi-0.1.4.tar.gz -
Subject digest:
a277b2075fbc9699d23d7497808655971af09d45ca4e4c7d5d7d71ebc79b1403 - Sigstore transparency entry: 1673615427
- Sigstore integration time:
-
Permalink:
gangtiser/gangtise-python@67890c74f93befbdcf9d5a31a94b20f136086d0f -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/gangtiser
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67890c74f93befbdcf9d5a31a94b20f136086d0f -
Trigger Event:
push
-
Statement type:
File details
Details for the file gangtise_openapi-0.1.4-py3-none-any.whl.
File metadata
- Download URL: gangtise_openapi-0.1.4-py3-none-any.whl
- Upload date:
- Size: 60.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7856ae47483620a98f0882bd0d3145fc79714786deadca8dc6e25901f1092af1
|
|
| MD5 |
168f7221e3a62b34ece43309b61f39c3
|
|
| BLAKE2b-256 |
7fd377c33620ad2516382ceed12aae0e92c7874d4cf3ae8f1c3f2e7123820fe7
|
Provenance
The following attestation bundles were made for gangtise_openapi-0.1.4-py3-none-any.whl:
Publisher:
release.yml on gangtiser/gangtise-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gangtise_openapi-0.1.4-py3-none-any.whl -
Subject digest:
7856ae47483620a98f0882bd0d3145fc79714786deadca8dc6e25901f1092af1 - Sigstore transparency entry: 1673615436
- Sigstore integration time:
-
Permalink:
gangtiser/gangtise-python@67890c74f93befbdcf9d5a31a94b20f136086d0f -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/gangtiser
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67890c74f93befbdcf9d5a31a94b20f136086d0f -
Trigger Event:
push
-
Statement type: