Skip to content

Releases: harsh-kumar-rai/nsefetch

v0.1.0 — Initial Release

Choose a tag to compare

@harsh-kumar-rai harsh-kumar-rai released this 15 May 19:00

Changelog

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. 🎉

Added

Core Data Engine

  • MarketService and AsyncMarketService — sync and async service facades with matching method signatures
  • create_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()

Market Data Methods (all 10 endpoints)

  • get_nifty50() — NIFTY 50 index snapshot
  • get_index(index_name) — any supported NSE index snapshot
  • get_stock(symbol) — single-symbol equity quote
  • get_bulk_stocks(symbols) — multi-symbol equity quotes with registry-guided batching
  • get_option_chain(symbol, expiry=None) — option chain with nearest-expiry default
  • get_option_chain_expiries(symbol) — discover all available expiry dates
  • get_futures_data(symbol) — F&O futures snapshot
  • get_delivery_data(symbol) — delivery / DPIIT data
  • get_market_depth(symbol) — level-2 order book (optional data)
  • get_sector_data() — all sector snapshots

Response Envelope

  • ResponseEnvelope[T] — stable transport-agnostic metadata on every response: success, provider, request_id, fetched_at, stale, cache_hit, degraded, degraded_reason, warnings, data

Reliability Infrastructure

  • 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

HTTP Transport

  • NSEHttpClient / AsyncNSEHttpClientcurl_cffi-based browser-impersonating session with automatic cookie bootstrap
  • Swappable transport boundary — pluggable live/test transport
  • RetryPolicy — bounded exponential-backoff retries on transient failures

Tooling

  • 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

Configuration

  • Settings via pydantic-settings — all parameters configurable via environment variables with NSEFETCH_ prefix

Developer Experience

  • 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