Skip to main content

trading-static-ip

Official Python SDK for sending verified broker order and trade API requests through your dedicated ServLoci IPv6.

Install

pip install trading-static-ip

The PyPI distribution is named trading-static-ip; the Python import remains servloci so existing code stays compatible.

One-token quickstart

Generate an access token in the ServLoci portal, verify the broker once, then:

from servloci import Client

client = Client(token="sl_live_...", broker="dhan")

response = client.get(
    "/v2/orders",
    headers={
        "access-token": "YOUR_DHAN_ACCESS_TOKEN",
        "client-id": "YOUR_DHAN_CLIENT_ID",
    },
)
response.raise_for_status()
print(response.json())

The SDK adds X-ServLoci-Token and X-ServLoci-Broker. ServLoci confirms that the selected broker was verified under your account, forwards only the allowed order/trade path to that broker's official origin, and sends the request from your assigned IPv6. Your broker authorization headers pass through and are not stored.

Environment-variable setup is equally small:

export SERVLOCI_TOKEN='sl_live_...'
export SERVLOCI_BROKER='dhan'
from servloci import Client

client = Client.from_env()
response = client.post("/v2/orders", headers={...}, json={...})

Supported fixed-origin HTTP routes: Dhan, Kite (Zerodha), Groww, FYERS, Upstox, and ICICI Direct. Kotak Neo uses a per-session dynamic origin and therefore remains available through SOCKS5 only.

Existing broker SDKs / SOCKS5

The original helper remains backwards compatible:

pip install 'trading-static-ip[socks]'
import servloci

servloci.configure(
    api_key="dhan:1000000001",
    api_secret="YOUR_SOCKS_PASSWORD",
)

# Import the broker SDK only after configure().
from dhanhq import dhanhq

Use the HTTP Client for the easiest setup. Use SOCKS5 when the broker's official SDK must control the complete URL or its API origin is dynamic.

Security

  • Treat sl_live_... as a password; never commit or log it.
  • Access tokens are displayed once, stored server-side only as SHA-256 hashes, and can be rotated or revoked in the portal.
  • Only broker-native paths beginning with / are accepted by the SDK.
  • ServLoci restricts the application forwarder to documented order/trade paths.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trading_static_ip-0.2.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

trading_static_ip-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file trading_static_ip-0.2.0.tar.gz.

File metadata

  • Download URL: trading_static_ip-0.2.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for trading_static_ip-0.2.0.tar.gz
Algorithm Hash digest
SHA256 34a949f84efa807123ba36a48c126862859f40e6a3c45172b2ca5aa50dd36ee3
MD5 9a0cac5707530af1a070f3b82f288a3e
BLAKE2b-256 de1dc8e6a69233f89a613fb749eabf04e49e3883e63022b501e2578861927423

See more details on using hashes here.

File details

Details for the file trading_static_ip-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trading_static_ip-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4e587b5a5cfe21f40f365c15432e3706bec51f0f46b03699ad58e4b173e2be3
MD5 f54cea527e53847f2354b81bacdaaf40
BLAKE2b-256 e1a5306e88a52e6be4398ea7edb8b97d7d41d49e10e817f7f26d3b9616f175f4

See more details on using hashes here.

Supported by

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