Config

Configuration options for LongPort sdk

Parameters:

Name Type Description Default
app_key str

App Key

required
app_secret str

App Secret

required
access_token str

Access Token

required
http_url Optional[str]

HTTP API url

None
trade_ws_url Optional[str]

Websocket url for trade API

None
language Optional[Type[Language]]

Language identifier

None

__init__

__init__(app_key: str, app_secret: str, access_token: str, http_url: Optional[str] = None, trade_ws_url: Optional[str] = None, language: Optional[Type[Language]] = None) -> None

from_env classmethod

from_env() -> Config

Create a new Config from the given environment variables

It first gets the environment variables from the .env file in the current directory.

Variables

  • LONGPORT_APP_KEY - App key
  • LONGPORT_APP_SECRET - App secret
  • LONGPORT_ACCESS_TOKEN - Access token
  • LONGPORT_HTTP_URL - HTTP endpoint url
  • LONGPORT_TRADE_WS_URL - Trade websocket endpoint url