Package for fetching of data from Stooq.com
Project description
PyStooq
This package provides simple interface for downloading time daily series from Stooq website.
Please note that author of this package is not affiliated with Stooq in any way.
Usage
In order to download Stooq time series of prices for tickers
PKO and TPE for the period from 1st April 2020 to 31st October 2022 use the snippet below:
from pystooq import StooqDataFetcher
from datetime import date
fetcher = StooqDataFetcher()
data_df = fetcher.get_data(
tickers=["PKO", "TPE"],
start=date(2020, 4, 1),
end=date(2022, 10, 31)
)
Format of the output:
ticker PKO TPE
variable open high low close volume open high low close volume
date
2020-04-01 20.8531 20.9742 20.4063 20.6669 3.176696e+06 1.100 1.113 1.082 1.091 4377953
2020-04-02 20.7600 20.8904 19.7546 20.3225 4.157717e+06 1.095 1.138 1.086 1.130 8213427
2020-04-03 20.2480 20.3411 19.6895 20.3411 4.003517e+06 1.140 1.165 1.114 1.160 8037788
2020-04-06 20.8997 21.2255 20.6111 21.1138 3.749039e+06 1.180 1.210 1.175 1.188 9852203
2020-04-07 21.5327 22.7709 21.4582 21.7934 7.634852e+06 1.210 1.248 1.168 1.168 13587105
The returned data is a pandas.DataFrame with
the following indexes:
- date index on rows (data sorted in ascending order)
- two-level
pd.MultiIndexon columns:- first level is the ticker
- second level is the variable (open, high, low, close, volume)
All the available variables are downloaded for each ticker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pystooq-1.0.3.tar.gz
(3.6 kB
view details)
File details
Details for the file pystooq-1.0.3.tar.gz.
File metadata
- Download URL: pystooq-1.0.3.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2637266feeed4bcf6343b445ad8514cfa59670498b16608a1c2749dac18778a6
|
|
| MD5 |
433a3d34f60f81f874f63229429f4a4f
|
|
| BLAKE2b-256 |
9a4119e6797394534f933dad82842e40e20c867f8d484389d6da614a552388a2
|