Data extractor in financial market, including realtime price, history price, financial statements and more. Besides stocks, cryptocurrency is also covered.
Project description
PRICEIT
Author: David WANG
Version 0.1.6
- 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.)
- To extract the latest full list of stock tickers in NASDAQ, NYSE and AMEX.
- To extract the financial statements.
Installation:
pip install priceit
Usage:
(1) To get realtime TSLA price
from priceit_project 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_project 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]}}
(3) To get full list of stock ticker in NASDAQ, NYSE and AMEX
from priceit_project import *
exchange = 'NASDAQ'
print(tickerlist(exchange))
Result:
{'symbol': ['AAPL', 'MSFT',...], 'name': ['Apple Inc. Common Stock', 'Microsoft Corporation Common Stock',...]}
(4) To get financial statements
from priceit_project import *
p = priceit()
p.ticker = 'AAPL'
print(p.statements('Q')) # 'Q' for quarter report; 'A' for annual report
Result:
{'income_statement': {},'balance_sheet': {}, 'cash_flow':{}}
Notes:
- This project is being built up. More functions will be added.
- If to get realtime price, please limit your frequency of data extraction.
- After getting the full list of stock tickers, you can save it in your local disk so as to save the network resources.
About the Author
I am currently in Grade 11 (as of 1st half of 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.1.6.tar.gz
.
File metadata
- Download URL: priceit-0.1.6.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5820eab7e83ea854f958313bdf1ae7a431bb8d848d14c3e04696cddae59cdee7 |
|
MD5 | 5c406577beeddc64033e8d4c838fac9d |
|
BLAKE2b-256 | 0b5637252b8d8a30186361b240b9fed407bf9031102207edc5b56b1fdc91c3ab |
File details
Details for the file priceit-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: priceit-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a18562793b01ac522f031dfd95c83834a784e6957619aeb69e3c47339bd5681a |
|
MD5 | faee4b321ea1a32c8ce7ad8c1905d87b |
|
BLAKE2b-256 | 2e42896e4dfcdf0e6b1c8ad529b15557f8b09748bdfdff040d7c72f4a005f7bc |