To extract realtime or history price data of stocks or crypto currencies.
Project description
PRICEIT
Author: David WANG
Version 0.0.3
To extract realtime or history price data of stocks or crypto currencies. (Please note this package is based on free API (e.g. Yahoo Finance). There may be a little time lag (seconds or minutes) for some market.)
Installation:
pip install priceit
Usage:
(1) To get realtime TSLA price
from priceit import *
ticker ='TSLA'
print(getprice(ticker))
Result:
['TSLA', 1049.61, 'Delayed Quote', '2022-01-14 16:00:04']
(Sample above is taken during weekend, when the market is close. So it shows 'Delayed Quote'. Try this when market is open, and you can get realtime quote (almost realtime). Please allow seconds or minutes time lag for certain market.)
(2) To get history daily price of BTC-USD from 2022-01-12 to 2022-01-14
from priceit import *
ticker = 'BTC-USD'
startdate = '2022-01-12'
enddate = '2022-01-14'
print(histprice(ticker,startdate,enddate))
Result:
{'currency': 'USD', 'symbol': 'BTC-USD', 'exchangeName': 'CCC', 'data': {'timestamp': ['2022-01-12', '2022-01-13', '2022-01-14'], 'volume': [33499938689, 47691135082, 23577403399], 'high': [44135.3671875, 44278.421875, 43346.6875], 'low': [42528.98828125, 42447.04296875, 41982.6171875], 'close': [43949.1015625, 42591.5703125, 43099.69921875], 'open': [42742.1796875, 43946.7421875, 42598.87109375], 'adjclose': [43949.1015625, 42591.5703125, 43099.69921875]}}
Notes:
- This project is being built up. More functions will be added.
- If to get realtime price, please limit your frequency of data extraction. We should cherish the free resources, like Yahoo Finance.
About the Author
I am currently in Grade 11 (as at 15 Jan 2022). I have great interests in AI trading and real world simulation with C++, Java and Python. I am summarizing my free data sources in this project. And hopefully this can save some of your time in data extraction.
Project details
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
File details
Details for the file priceit-0.0.3.tar.gz
.
File metadata
- Download URL: priceit-0.0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd2c11482c1f0ca2eafc679d5db324682e84472521f67c06e83b1d6f25765847 |
|
MD5 | 0411c50763bd0b6915707b87f2e3b796 |
|
BLAKE2b-256 | baf8fc44064b263ca68d44725ef1acf04aa8e087a057ee2d1dc5de78c8cb6bb2 |
File details
Details for the file priceit-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: priceit-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f305cff0dbba3cc33a0f0425e47d5d82b37828ef6dec955ab83e5f8fd5344e20 |
|
MD5 | 7be8f6994950b30cc27f87687d9545d5 |
|
BLAKE2b-256 | ce8df34ec65fd0b8278bc6a0241004a0e06799e20ff9b7c7bc7bcd6e6544b808 |