# ruchitanmay/bseindia architecture

> Architecture diagram of the GitHub repository ruchitanmay/bseindia, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ruchitanmay/bseindia
- Repository: https://github.com/ruchitanmay/bseindia

## Overview

bseindia is a Python client for public BSE market-data feeds, returning DataFrames or dictionaries. The main workflow is a caller invoking a top-level, equity, or derivatives API; domain wrappers validate or shape results and request helpers fetch and parse BSE data. Shared utilities handle date conversion, HTTP requests, and the locally cached security master, including live symbol lookup. The README documents broader equity and derivatives reporting capabilities than the excerpts expose; those are represented at their documented API layer. Relationships for unsampled internals are omitted rather than inferred.

Main entry points: [`bseindia/libutil.py`](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/libutil.py) (HTTP and date utilities), [`bseindia/equity/equity_data.py`](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py) (Equity reports), [`bseindia/equity/get_func.py`](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/get_func.py) (Equity feed requests), [`bseindia/derivatives/get_func.py`](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/get_func.py) (Derivatives feed requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_top_api["Top-level exports<br/>[__init__.py]"]
  node_equity_api["Equity exports<br/>[__init__.py]"]
  node_derivatives_api["Derivatives exports<br/>[__init__.py]"]
end

subgraph group_equity["Equity Data"]
  node_equity_reports["Equity reports<br/>[equity_data.py]"]
  node_equity_requests["Equity feed requests<br/>[get_func.py]"]
  node_security_info["Stock history and info<br/>[equity_data.py]"]
  node_equity_bhav["Equity bhavcopy<br/>[equity_data.py]"]
  node_equity_statistics["Equity statistics<br/>[equity_data.py]"]
  node_equity_deals["Bulk and block deals<br/>[equity_data.py]"]
end

subgraph group_derivatives["Derivatives Data"]
  node_derivative_reports["Derivatives reports<br/>[derivative_data.py]"]
  node_derivative_requests["Derivatives feed requests<br/>[get_func.py]"]
  node_market_summary["F&amp;O market summary<br/>[derivative_data.py]"]
  node_derivative_bhav["Derivatives bhavcopy<br/>[derivative_data.py]"]
  node_investor_turnover["Investor turnover<br/>[derivative_data.py]"]
end

subgraph group_shared["Shared Utilities"]
  node_shared_utils["HTTP and date utilities<br/>[libutil.py]"]
  node_security_master[("Security master cache<br/>[libutil.py]")]
  node_logger["Logging<br/>[logger.py]"]
  node_constants["Date constants<br/>[constants.py]"]
end

node_user(("Library caller"))
node_bse{{"BSE public feeds"}}

node_user -->|"calls"| node_top_api
node_user -->|"calls"| node_equity_api
node_user -->|"calls"| node_derivatives_api
node_top_api -->|"exports utilities"| node_shared_utils
node_equity_api -->|"exports"| node_equity_reports
node_derivatives_api -->|"exports"| node_derivative_reports
node_equity_reports -->|"calls fetchers"| node_equity_requests
node_equity_reports -->|"resolves symbols"| node_shared_utils
node_equity_requests -->|"uses HTTP helpers"| node_shared_utils
node_equity_requests -->|"fetches feeds"| node_bse
node_equity_reports -->|"fetches report pages"| node_bse
node_derivative_reports -->|"calls fetchers"| node_derivative_requests
node_derivative_requests -->|"uses HTTP helpers"| node_shared_utils
node_derivative_requests -->|"fetches feeds"| node_bse
node_shared_utils -->|"reads and writes"| node_security_master
node_shared_utils -->|"fetches master and holidays"| node_bse
node_shared_utils -->|"configures logger"| node_logger
node_shared_utils -->|"imports formats"| node_constants

click node_top_api "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/__init__.py"
click node_equity_api "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/__init__.py"
click node_derivatives_api "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/__init__.py"
click node_equity_reports "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py"
click node_equity_requests "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/get_func.py"
click node_security_info "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py"
click node_equity_bhav "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py"
click node_equity_statistics "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py"
click node_equity_deals "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py"
click node_derivative_reports "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py"
click node_derivative_requests "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/get_func.py"
click node_market_summary "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py"
click node_derivative_bhav "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py"
click node_investor_turnover "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py"
click node_shared_utils "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/libutil.py"
click node_security_master "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/libutil.py"
click node_logger "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/logger.py"
click node_constants "https://github.com/ruchitanmay/bseindia/blob/main/bseindia/constants.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_top_api,node_equity_api,node_derivatives_api toneBlue
class node_equity_reports,node_equity_requests,node_security_info,node_equity_bhav,node_equity_statistics,node_equity_deals toneAmber
class node_derivative_reports,node_derivative_requests,node_market_summary,node_derivative_bhav,node_investor_turnover toneMint
class node_shared_utils,node_security_master,node_logger,node_constants toneRose
class node_user,node_bse toneIndigo
```

## Components

### Public API

- [Top-level exports](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/__init__.py): `bseindia/__init__.py`
- [Equity exports](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/__init__.py): `bseindia/equity/__init__.py`
- [Derivatives exports](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/__init__.py): `bseindia/derivatives/__init__.py`

### Equity Data

- [Equity reports](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py): `bseindia/equity/equity_data.py`
- [Equity feed requests](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/get_func.py): `bseindia/equity/get_func.py`
- [Stock history and info](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py): `bseindia/equity/equity_data.py`
- [Equity bhavcopy](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py): `bseindia/equity/equity_data.py`
- [Equity statistics](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py): `bseindia/equity/equity_data.py`
- [Bulk and block deals](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/equity/equity_data.py): `bseindia/equity/equity_data.py`

### Derivatives Data

- [Derivatives reports](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py): `bseindia/derivatives/derivative_data.py`
- [Derivatives feed requests](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/get_func.py): `bseindia/derivatives/get_func.py`
- [F&O market summary](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py): `bseindia/derivatives/derivative_data.py`
- [Derivatives bhavcopy](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py): `bseindia/derivatives/derivative_data.py`
- [Investor turnover](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/derivatives/derivative_data.py): `bseindia/derivatives/derivative_data.py`

### Shared Utilities

- [HTTP and date utilities](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/libutil.py): `bseindia/libutil.py`
- [Security master cache](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/libutil.py): `bseindia/libutil.py`
- [Logging](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/logger.py): `bseindia/logger.py`
- [Date constants](https://github.com/ruchitanmay/bseindia/blob/main/bseindia/constants.py): `bseindia/constants.py`

### Other components

- **Library caller**
- **BSE public feeds**

## Connections

- Library caller → Top-level exports: calls (evidence: `README.md`)
- Library caller → Equity exports: calls (evidence: `README.md`)
- Library caller → Derivatives exports: calls (evidence: `README.md`)
- Top-level exports → HTTP and date utilities: exports utilities (evidence: `bseindia/__init__.py`)
- Equity exports → Equity reports: exports (evidence: `bseindia/equity/__init__.py`)
- Derivatives exports → Derivatives reports: exports (evidence: `bseindia/derivatives/__init__.py`)
- Equity reports → Equity feed requests: calls fetchers (evidence: `bseindia/equity/equity_data.py`)
- Equity reports → HTTP and date utilities: resolves symbols (evidence: `bseindia/equity/equity_data.py`)
- Equity feed requests → HTTP and date utilities: uses HTTP helpers (evidence: `bseindia/equity/get_func.py`)
- Equity feed requests → BSE public feeds: fetches feeds (evidence: `bseindia/equity/get_func.py`)
- Equity reports → BSE public feeds: fetches report pages (evidence: `bseindia/equity/equity_data.py`)
- Derivatives reports → Derivatives feed requests: calls fetchers (evidence: `bseindia/derivatives/derivative_data.py`)
- Derivatives feed requests → HTTP and date utilities: uses HTTP helpers (evidence: `bseindia/derivatives/get_func.py`)
- Derivatives feed requests → BSE public feeds: fetches feeds (evidence: `bseindia/derivatives/get_func.py`)
- HTTP and date utilities → Security master cache: reads and writes (evidence: `bseindia/libutil.py`)
- HTTP and date utilities → BSE public feeds: fetches master and holidays (evidence: `bseindia/libutil.py`)
- HTTP and date utilities → Logging: configures logger (evidence: `bseindia/libutil.py`)
- HTTP and date utilities → Date constants: imports formats (evidence: `bseindia/libutil.py`)
