Skip to main content

Python SDK for Gangtise OpenAPI

Project description

gangtise-openapi

Python SDK for Gangtise OpenAPI. Feature-parity with the npm CLI gangtise-openapi-cli v0.14.2 across 73 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 in sample/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 under sample_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 73 upstream endpoints across 9 domains:

  • gangtise.auth.* — login, status
  • gangtise.lookup.* — local lookup tables (research areas, brokers, industries, ...)
  • gangtise.reference.* — securities search (GTS codes)
  • gangtise.insight.* — opinions, research reports, announcements, schedules
  • gangtise.quote.* — K-line, real-time quotes
  • gangtise.fundamental.* — financial statements, valuation, holders, forecasts
  • gangtise.ai.* — AI-generated insights (one-pager, peer comparison, earnings reviews, ...)
  • gangtise.vault.* — personal drive, meeting records, stock pools, WeChat
  • gangtise.alternative.* — economic indicators (EDB)

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

gangtise_openapi-0.1.2.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gangtise_openapi-0.1.2-py3-none-any.whl (58.8 kB view details)

Uploaded Python 3

File details

Details for the file gangtise_openapi-0.1.2.tar.gz.

File metadata

  • Download URL: gangtise_openapi-0.1.2.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gangtise_openapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 421f791a189bb95e37d7be261dc6890ea47a8866a5e2d2a9580c06c67ea82ed2
MD5 f15549d281a6e32cc6ad1c226ac9acc4
BLAKE2b-256 5fa58099e46c62eb23cae0d2f6a8b128be245caf72010b4ddadbfff78a280964

See more details on using hashes here.

Provenance

The following attestation bundles were made for gangtise_openapi-0.1.2.tar.gz:

Publisher: release.yml on gangtiser/gangtise-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gangtise_openapi-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gangtise_openapi-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f13f40ee19cc9fc07d800a656fb367101b91cc5b33c1b1c7cc272f37f1005b0c
MD5 8b68377f781d7253b77a839b10a1dda1
BLAKE2b-256 f43dcbf4845f9a76f047e0dc3c192a557ccedb4437bace850a1a55d34e591831

See more details on using hashes here.

Provenance

The following attestation bundles were made for gangtise_openapi-0.1.2-py3-none-any.whl:

Publisher: release.yml on gangtiser/gangtise-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page