Skip to main content

Pakistan Stock Exchange's Data Downloader

Project description

forthebadge made-with-python ForTheBadge built-with-love

GitHub RuboCop RuboCop

psx-data-reader

with psx-data-reader, you can scrape the data of Pakistan stock exchange. psx-data-reader is super easy to use and handles everything for you. Just specify which company's stock data you want and how much you want, and the rest is done for you.

GitHub Workflow Status PyPI - Implementation PyPI - Python Version PyPI GitHub release (latest by date) PyPI - Status PyPI - Downloads GitHub issues GitHub closed issues

Overview

The psx-data-reader was written with fast use in mind. It provides the following key features

  • can scrape all historical data till current date
  • can scrape data for of multiple companies in a single line of code
  • returns a Pandas DataFrame for the scraped data
  • for better download speed, It does not request the complete data in a single network request rather it makes chunks of data to be downloaded and uses threads to open requests for different chunks of data, hence results in better speed

In the following paragraphs, I am going to describe how you can get and use Scrapeasy for your own projects.

Installation

To get psx-data-reader, either fork this github repo or simply use Pypi via pip.

$ pip install psx-data-reader

Usage

First, import stocks and tickers from psx

from psx import stocks, tickers

to get the information of all the companies in Pakistan stock Exchange....

tickers = tickers()

to scrape the data of Silk Bank Limited we have pass its ticker (symbol) to the stocks method with proper start and end date. and it will return a DataFrame with the scraped data

data = stocks("SILK", start=datetime.date(2020, 1, 1), end=datetime.date.today())

we can also download the data of multiple companies in a single call to stocks method by passing a list or tuple of symbols

data = stocks(["SILK", "PACE"], start=datetime.date(2020, 1, 1), end=datetime.date.today())

and now the returned DataFrame object will have a hierarchical index on rows.

Author Info

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

psx-data-reader-0.0.5.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

psx_data_reader-0.0.5-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file psx-data-reader-0.0.5.tar.gz.

File metadata

  • Download URL: psx-data-reader-0.0.5.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for psx-data-reader-0.0.5.tar.gz
Algorithm Hash digest
SHA256 baa21bf347f96eac9d736cab2ddc728423af95c1f16d594a8858b4a9da0cf4cc
MD5 2f6a8d052a9e09040d9629130a2b3097
BLAKE2b-256 9ac68d74b917e31e0cf2443a3018e93354d61e726a1feddbe06e82d66c277721

See more details on using hashes here.

File details

Details for the file psx_data_reader-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: psx_data_reader-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for psx_data_reader-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ecba22bb7333b1cf0b35e4f655aa6c3694fd72a832a955ba43b9c59ed1404725
MD5 2b8b543c652a89405d9797356f5bebdb
BLAKE2b-256 a2e4fb1333d5cc310751712458c9efd4db62d62d2796f3eac7ec06a1ae5171fa

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