No project description provided
Project description
OHLC-DATA
Easily download OHLC data from either alpaca (requires API keys) or yfinance to csv files
To acquire API keys for alpaca visit:
https://alpaca.markets/
Instructions
- Open your preferred CLI (Terminal/Command Prompt etc)
- Create and activate a Python virtual environment
Mac/Linux
python3 -m venv <venv>
source ./<venv>/bin/activate
Windows
python -m venv <venv>
./<venv>/Scripts/activate
Installation
Mac/Linux
pip3 install ohlc-data
Windows
pip install ohlc-data
Download OHLC data
ohlc_download
Running this script will create a folder in the current directory called 'ohlc_csv' if there isn't one already by that name. It will then take you through a series of prompts:
Download data for one or multiple tickers
You can choose to get data for one ticker or multiple tickers at once. Tickers don't have to be typed in capital letters.
Choose source
You can then choose which API to use. Alpaca requires API keys that you'll be prompted to enter, yfinance does not require API keys.
Choose lookback period and interval
Choose from a number of days or years for the lookback period. Custom periods are also available. You will be prompted for a start and end date/datetime if 'Custom' is chosen.
Valid Periods and Intervals (Timeframes)
Valid periods: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
Valid intervals: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo
yfinance:
- 1m data cannot extend past 7 days
- 2m - 30m data, and 90m data cannot extend past 60 days
- 1h data cannot extend past 730 days
- 1d - 3mo data allows max available data
alpaca:
- Data from 2016 to present is available for all intervals
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ohlc_data-1.1.0.tar.gz.
File metadata
- Download URL: ohlc_data-1.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.12.6 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40da963b7636b0e4ff4199400b2caf33bc7e3a4d1334fdf5a29831b3bd0415ff
|
|
| MD5 |
15bd168a2a11ad9aa29e5043cd17147d
|
|
| BLAKE2b-256 |
bc80ed02d5362ca146c7be77a7a8631fcae4fdb83bd76418265c2a9e24e84e6f
|
File details
Details for the file ohlc_data-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ohlc_data-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.12.6 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0ab37be77206aee282613c53183ecd95911ff93b982bdf834fe332463d78d3d
|
|
| MD5 |
a9f755f9f08f7ce12431ab8ccda25a98
|
|
| BLAKE2b-256 |
fa56a029d7119c402c2b385fc397408635785541976c17885e54ed2adeb218b8
|