Skip to main content

To extract realtime or history price data of stocks or crypto currencies.

Project description

PRICEIT

Author: David WANG

Version 0.0.2

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. 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.0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

priceit-0.0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: priceit-0.0.2.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

Hashes for priceit-0.0.2.tar.gz
Algorithm Hash digest
SHA256 cc1dd6e2a35d47a647d45902cc807ee1bc8a8c6a2d1f5f3ba617b096fef249ca
MD5 a7eb0402bb164b43f37b31756c9e26c2
BLAKE2b-256 0c9bc167127306113304a8ee6d1045dafeb57ec88cbb247e77cb2c8ab2b8ac2c

See more details on using hashes here.

File details

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

File metadata

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

Hashes for priceit-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f05b82ebae979e3b2705dbee7f8c38828d5e617300b7e0b5926d815cade057c
MD5 3641b996fe937159386cf36d6b9132e8
BLAKE2b-256 52ddf1089d7253ebfe1da925ccab5896ed41f070cdafc83d6131f132ae521b87

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