Metadata-Version: 2.4
Name: jing
Version: 0.3.15
Summary: Download stock data and perform data analisys
Author-email: sai <dawangfei@gmail.com>
License: MIT
Keywords: jing,sai,stock
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: pandas
Requires-Dist: baostock
Requires-Dist: yfinance
Requires-Dist: akshare
Requires-Dist: pyarrow
Requires-Dist: cos-python-sdk-v5
Requires-Dist: importlib-metadata; python_version < "3.10"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"

# jing

`jing` downloads and organizes stock market data. The examples below use China A-share stocks with BaoStock.

## Install

```bash
pip install jing
```

## Download CN data

BaoStock is the default data source for CN. Stock codes must include an exchange prefix, such as `sh.` or `sz.`.

```python
import jing

d = jing.D("cn")
d.download("sz.000807")  # Download one stock
d.download()             # Download the stocks in the default list
```

Batch downloads use `~/data/jing/list/cn_baostock.txt` by default. On first use, `jing` copies the bundled list there; edit this copy to maintain your stock list.

## File locations

The default data directory is `~/data/jing`:

```text
~/data/jing/
├── list/cn_baostock.txt
└── raw/baostock/cn/sz.000807.csv
```

Set `JING_DATA` to use another directory:

```bash
export JING_DATA=/data/stocks
```

Or set the data directory from Python:

```python
from jing.data_paths import set_data_root

set_data_root("/data/stocks")
```

The stock list and CSV files will then be stored under `/data/stocks/list/` and `/data/stocks/raw/baostock/cn/`.
