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 package for market data ingestion and adds equity-focused helpers such as cached index loading and return analytics.
Install
Install datasets first, then equity:
cd ../datasets
python3 -m pip install -e '.[data]'
cd ../equity
python3 -m pip install -e .
Optional extras:
python3 -m pip install -e '.[data]' # datasets[data] (pandas, pyarrow, yfinance, ...)
python3 -m pip install -e '.[dev]' # pytest, ruff, build
Quickstart
cd equity
python3 -m pip install -e '.[data]'
python3 examples/quickstart.py
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:
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 scripts/build_test.sh
Release files for qfin-equity 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qfin_equity-0.1.0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qfin_equity-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / qfin_equity-0.1.0.tar.gz
| Download URL | qfin_equity-0.1.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
489ddd38e8595c2f00755966e444e0827e83dd66fd7f9a055ac86af845bf37b0
|
|
BLAKE2b-256 checksum How to use checksums |
33975f4d1e8de1386feddb9d3168890aac0b8ac2bd25649313f41d60437d8df7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / qfin_equity-0.1.0-py3-none-any.whl
| Download URL | qfin_equity-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
848801452ed4e084e1afa8c4e1e6f44208fbe868407bf7dd37a0bfccffea81dd
|
|
BLAKE2b-256 checksum How to use checksums |
4110f9951a990eaf42793070c0428bc9d098e13c5785ef15567ce5974bb0b996
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|