Skip to main content

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.7

  • 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 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]}}

(3) To get full list of stock ticker in NASDAQ, NYSE and AMEX

from priceit 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 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

priceit-0.1.7.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

priceit-0.1.7-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file priceit-0.1.7.tar.gz.

File metadata

  • Download URL: priceit-0.1.7.tar.gz
  • Upload date:
  • Size: 4.9 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

Hashes for priceit-0.1.7.tar.gz
Algorithm Hash digest
SHA256 0ed924d33cdeda5b994fa41a998189be5dd9be3dcd381434364f872e59a8d4d4
MD5 29db4e909785b7751635b528e7a845f4
BLAKE2b-256 fcf67e476051769bf86a8f8f7f0f0396a06cb61653ff599cb99db88b36482a35

See more details on using hashes here.

File details

Details for the file priceit-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: priceit-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 5.2 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

Hashes for priceit-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4dee2eb0482ba940ca5ed43bbe8113d6a4b7a1e724ab1602ead66e214bb5feb5
MD5 6b5d06502f329a4623d19da605d8e9d2
BLAKE2b-256 92aba2a593f1b817a755fe52ade77019376566c5857c933a8216a41837955c75

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page