Python client for the Alpha API (/v1)
Project description
Drishti SDK (Python)
Official Python SDK for the Manasija Alpha API (/v1).
This SDK provides:
- A synchronous HTTP client with named-argument endpoint helpers
- A low-level request interface for advanced/custom usage
- A WebSocket client for real-time streams (
/v1/ws)
Requirements
- Python
3.10+ - A valid Alpha API key
Installation
pip install drishti-sdk
Quick Start
from market_stack_sdk import DrishtiClient
with DrishtiClient(api_key="YOUR_API_KEY") as client:
news = client.get_news(
symbols=["RELIANCE", "TCS"],
limit=10,
)
print(len(news["data"]))
All requests automatically include X-API-Key using the provided api_key.
HTTP Usage
from market_stack_sdk import DrishtiClient
with DrishtiClient(api_key="YOUR_API_KEY") as client:
announcements = client.get_announcements(
symbols=["RELIANCE"],
categories=["Corporate Action"],
detailed=True,
limit=20,
)
earnings = client.get_earnings_detail(
symbol="MEDIASSIST",
quarter="q4_26",
detailed=True,
)
transcript = client.get_concalls_transcript(
symbol="TCS",
quarter="q4_26",
)
alerts = client.get_alerts(
symbols=["INFY"],
important=True,
limit=25,
)
Error Handling
from market_stack_sdk import MarketStackApiError, DrishtiClient
try:
with DrishtiClient(api_key="YOUR_API_KEY") as client:
client.get_account()
except MarketStackApiError as exc:
print(exc.status_code)
print(exc.body)
raise
WebSocket Usage (/v1/ws)
import asyncio
from market_stack_sdk import DrishtiClient, SubscribeOptions
async def main() -> None:
client = DrishtiClient(api_key="YOUR_API_KEY")
async with client.websocket() as ws:
await ws.subscribe(
SubscribeOptions(
product="announcements",
symbols=["RELIANCE"],
detailed=False,
)
)
async for event in ws.events():
if event.kind == "subscribed":
print("ready", event.product, event.tier)
elif event.kind == "data":
print(event.channel, event.data)
asyncio.run(main())
Reconnect/callback style:
async with client.websocket(
auto_reconnect=True,
reconnect_initial_delay=1.0,
reconnect_max_delay=30.0,
on_reconnect_attempt=lambda attempt, delay, reason: print(attempt, delay, reason),
on_data=lambda event: print(event.data) if event.kind == "data" else None,
) as ws:
await ws.subscribe("alerts", symbols=["RELIANCE"])
await ws.run()
Batch Jobs
from market_stack_sdk import DrishtiClient
with DrishtiClient(api_key="YOUR_API_KEY") as client:
with open("batch.jsonl", "rb") as f:
file_bytes = f.read()
job = client.post_batch_jobs_file(
file_name="batch.jsonl",
file_bytes=file_bytes,
display_name="Quarterly run",
)
status = client.get_batch_jobs_job_id(job_id=job["id"])
API Surface
REST helper methods
get_newsget_symbols_metadataget_announcements_categoriesget_announcementsget_announcements_attachmentspost_daily_summaryget_earningsget_earnings_detailget_earnings_attachmentsget_concallsget_concalls_detailget_concalls_transcriptpost_concalls_transcriptsget_alertsget_accountget_account_limitsget_account_usageget_account_ledgerpost_batch_jobspost_batch_jobs_fileget_batch_jobsget_batch_jobs_job_iddelete_batch_jobs_job_idget_batch_jobs_job_id_resultswebsocket
Low-level HTTP methods
requestgetpostputpatchdeleterequest_v1
Development
pip install -e .[dev]
Project details
Release history Release notifications | RSS feed
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 drishti_sdk-0.2.0.tar.gz.
File metadata
- Download URL: drishti_sdk-0.2.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0f33a1f4ea625145f932e7714368c075db63c368b8a62c2b486c7cf5d1bcc1
|
|
| MD5 |
62082e44c41e18444b1143a996f703b6
|
|
| BLAKE2b-256 |
8b92de9cdad0dec15fd2998e2032210469dfcd1aa37c7a336c17b7b643455677
|
Provenance
The following attestation bundles were made for drishti_sdk-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on manasijatech/Market-Stack-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drishti_sdk-0.2.0.tar.gz -
Subject digest:
cc0f33a1f4ea625145f932e7714368c075db63c368b8a62c2b486c7cf5d1bcc1 - Sigstore transparency entry: 1641794183
- Sigstore integration time:
-
Permalink:
manasijatech/Market-Stack-SDK@2bbc4ad91d837ce67f9be52597c569eb557f9f53 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/manasijatech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2bbc4ad91d837ce67f9be52597c569eb557f9f53 -
Trigger Event:
push
-
Statement type:
File details
Details for the file drishti_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: drishti_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.1 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 |
5203d7129a8dbd7d6fd69612a112a92097a12ecf5a1c65eb68b526741abbbe29
|
|
| MD5 |
26018ec7bb4f3db507ff61fdc11e1d36
|
|
| BLAKE2b-256 |
19d64ca8ec4c3013d9e5c650a6a0dc87010fe775b1103f5aa8bdaeec2d03d8be
|
Provenance
The following attestation bundles were made for drishti_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on manasijatech/Market-Stack-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drishti_sdk-0.2.0-py3-none-any.whl -
Subject digest:
5203d7129a8dbd7d6fd69612a112a92097a12ecf5a1c65eb68b526741abbbe29 - Sigstore transparency entry: 1641794274
- Sigstore integration time:
-
Permalink:
manasijatech/Market-Stack-SDK@2bbc4ad91d837ce67f9be52597c569eb557f9f53 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/manasijatech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2bbc4ad91d837ce67f9be52597c569eb557f9f53 -
Trigger Event:
push
-
Statement type: