How venkateshpabbati/kotak-neo-python works
Kotak Neo API is a Python trading SDK. Its main user flow is to create a NeoAPI client, authenticate with TOTP and MPIN, perform trading or account/market-data operations, and optionally log out. It also offers separate async market-data and order/position WebSocket feeds. The source index and excerpts support the facade, REST transport, and feed decoding relationships; several service implementations were not excerpted, so their internal call paths are not expanded.
Main entry points: neo_api.py NeoAPI facade · rest.py HTTP REST transport · feed/client.py SFeed WebSocket · orderfeed/client.py Order feed WebSocket
Components 24
Client and transport
- NeoAPI facade
neo_api_client/neo_api.py - Session configuration
neo_api_client/utils/neo_utility.py - Request validation
neo_api_client/req_data_validation.py - API client
neo_api_client/api_client.py - HTTP REST transport
neo_api_client/rest.py
Trading and account
- TOTP authentication
neo_api_client/services/totp.py - Logout
neo_api_client/services/logout.py - Order placement
neo_api_client/services/order.py - Order changes
neo_api_client/services/modify_order.py - Order and trade reports
neo_api_client/services/order_report.py - Portfolio and positions
neo_api_client/services/portfolio.py - Limits and margin
neo_api_client/services/limits.py
Market data
- Quotes and scrip master
neo_api_client/services/quotes.py - Scrip search
neo_api_client/services/scrip_search.py - Scrip cache
neo_api_client/utils/scrip_cache.py
Streaming feeds
- SFeed WebSocket
neo_api_client/websocket/feed/client.py - Feed protocol and models
neo_api_client/websocket/feed/protocol.py - Order feed WebSocket
neo_api_client/websocket/orderfeed/client.py - Order feed models
neo_api_client/websocket/orderfeed/models.py
Shared utilities
- Structured logging
neo_api_client/logger.py - Error handling
neo_api_client/exceptions.py - Reliability helpers
neo_api_client/retry.py
Other components
- SDK user
- Kotak REST API
Connections 23
- SDK user → NeoAPI facade: creates client
README.md - NeoAPI facade → TOTP authentication: authenticates
neo_api_client/neo_api.py - NeoAPI facade → Order placement: places orders
README.md - NeoAPI facade → Quotes and scrip master: requests quotes
README.md - NeoAPI facade → Logout: logs out
README.md - NeoAPI facade → Order changes: exposes order changes
neo_api_client/neo_api.py - NeoAPI facade → Order and trade reports: exposes reports
neo_api_client/neo_api.py - NeoAPI facade → Portfolio and positions: exposes account data
neo_api_client/neo_api.py - NeoAPI facade → Limits and margin: exposes limits
neo_api_client/neo_api.py - NeoAPI facade → Scrip search: exposes search
neo_api_client/neo_api.py - NeoAPI facade → Request validation: uses validation
neo_api_client/neo_api.py - NeoAPI facade → Session configuration: configures session
neo_api_client/neo_api.py - NeoAPI facade → API client: initializes API client
neo_api_client/neo_api.py - API client → HTTP REST transport: creates transport
neo_api_client/api_client.py - HTTP REST transport → Kotak REST API: sends REST requests
README.md - Scrip search → Scrip cache: reads and writes
neo_api_client/services/scrip_search.py - SDK user → SFeed WebSocket: subscribes to feed
README.md - SFeed WebSocket → Feed protocol and models: decodes frames
neo_api_client/websocket/feed/client.py - SDK user → Order feed WebSocket: opens order feed
README.md - Order feed WebSocket → Order feed models: creates updates
neo_api_client/websocket/orderfeed/client.py - HTTP REST transport → Structured logging: logs requests
neo_api_client/rest.py - SFeed WebSocket → Structured logging: logs feed events
neo_api_client/websocket/feed/client.py - Order feed WebSocket → Structured logging: logs feed events
neo_api_client/websocket/orderfeed/client.py