Metadata-Version: 2.4
Name: qfin-equity
Version: 0.1.0
Summary: Python library for quantitative methods used in equity investing.
Project-URL: Homepage, https://github.com/siddharthskulkarni/equity
Project-URL: Issues, https://github.com/siddharthskulkarni/equity/issues
Author: Siddharth Kulkarni
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: numpy>=1.23
Requires-Dist: qfin-datasets>=0.1.0
Provides-Extra: data
Requires-Dist: qfin-datasets[data]>=0.1.0; extra == 'data'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: twine>=5.0; extra == 'dev'
Description-Content-Type: text/markdown

# equity

Python library for **quantitative methods used in equity investing**. Part of the QFIN workspace alongside `datasets`, `derivatives`, `fixed-income`, and `risk`.

`equity` builds on the [`datasets`](https://github.com/siddharthskulkarni/datasets) package for market data ingestion and adds equity-focused helpers such as cached index loading and return analytics.

## Install

Install `datasets` first, then `equity`:

```bash
cd ../datasets
python3 -m pip install -e '.[data]'

cd ../equity
python3 -m pip install -e .
```

Optional extras:

```bash
python3 -m pip install -e '.[data]'   # datasets[data] (pandas, pyarrow, yfinance, ...)
python3 -m pip install -e '.[dev]'      # pytest, ruff, build
```

## Quickstart

```bash
cd equity
python3 -m pip install -e '.[data]'
python3 examples/quickstart.py
```

```python
import equity
from equity.data import project_data_dir, sector_index_slugs, load_sector_return_panel

print(equity.__version__, project_data_dir())
print(sector_index_slugs())

# Requires cached Yahoo parquet files from datasets download script
returns = load_sector_return_panel()
```

Populate cached index history with the datasets downloader:

```bash
cd ../datasets
python3 scripts/download_sector_index_history.py --lookback-years 10
```

## Project layout

```
equity/
├── equity/               # Python package
│   └── data/             # Paths, indices, history loaders, returns
├── examples/             # Runnable example scripts
├── scripts/              # Build and CI helpers
└── tests/
```

Market data is stored under the `datasets` package at `datasets/data/processed/`.

## Development

```bash
bash scripts/build_test.sh
```
