All notable changes to nsefetch will be documented in this file.
The format follows Keep a Changelog. This project adheres to Semantic Versioning.
0.1.0 β 2026-05-15
Initial public release. π
MarketServiceandAsyncMarketServiceβ sync and async service facades with matching method signaturescreate_market_service(),create_cached_market_service(),create_production_market_service()β convenience constructors for all three runtime modes- Equivalent async constructors:
create_async_market_service(),create_async_cached_market_service(),create_async_production_market_service()
get_nifty50()β NIFTY 50 index snapshotget_index(index_name)β any supported NSE index snapshotget_stock(symbol)β single-symbol equity quoteget_bulk_stocks(symbols)β multi-symbol equity quotes with registry-guided batchingget_option_chain(symbol, expiry=None)β option chain with nearest-expiry defaultget_option_chain_expiries(symbol)β discover all available expiry datesget_futures_data(symbol)β F&O futures snapshotget_delivery_data(symbol)β delivery / DPIIT dataget_market_depth(symbol)β level-2 order book (optional data)get_sector_data()β all sector snapshots
ResponseEnvelope[T]β stable transport-agnostic metadata on every response:success,provider,request_id,fetched_at,stale,cache_hit,degraded,degraded_reason,warnings,data
- Circuit breaker with configurable failure threshold and recovery window
- GCRA (Generic Cell Rate Algorithm) rate limiter β Redis-backed or in-memory
- Cache layer β Redis-backed or in-memory with per-operation TTLs
- Stale cache fallback β serves cached data on live fetch failure within degraded stale window
- In-flight request coalescing β deduplicates concurrent identical requests within a process
- Degraded state propagation β Redis / rate-limiter failures surfaced in response envelope
NSEHttpClient/AsyncNSEHttpClientβcurl_cffi-based browser-impersonating session with automatic cookie bootstrap- Swappable transport boundary β pluggable live/test transport
RetryPolicyβ bounded exponential-backoff retries on transient failures
- Live connectivity probe:
python -m nsefetch.live_probe(transport-level) - Service-level probe:
python -m nsefetch.live_probe --service - Combined:
python -m nsefetch.live_probe --all - Probe gated behind
NSEFETCH_LIVE_PROBE_ENABLED=1β safe to run in CI
Settingsviapydantic-settingsβ all parameters configurable via environment variables withNSEFETCH_prefix
- 131 unit tests across 14 test modules (zero live-network calls in normal runs)
- Full Pydantic v2 typed schemas for all response data
- Context-manager support:
with MarketService() as svc:/async with AsyncMarketService() as svc: - Python 3.12+ with full type annotations