Skip to main content

This is a tool to download stock market data of Dhaka Stock Exchange.

Project description

Description

This is a Python library based on beautifulsoup4, pandas & mplfinance to download price data and fundamental data of companies from
Dhaka Stock Exchange.
This can assist you to create further analyses based on fundamental and price history data.
Also create Candlestick charts to analyse price history of stocks using a simple wrapper for mplfinance.

Installation

pip install dse-data-loader

Usage

Downloading historical price data of a single stock-

from dse_data_loader import PriceData
loader = PriceData()

loader.save_history_csv('ACI', file_name='ACI_history.csv')

The above code will create a file named- 'ACI_history.csv'. It'll contain historical price data for ACI Limited. 'ACI' is the stock symbol.

Downloading current price data of all listed companies in DSE-

from dse_data_loader import PriceData
loader = PriceData()

loader.save_current_csv(file_name='current_data.csv')

The above code will create a file named- 'ACI_history.csv' in the current folder. It'll contain current price data for all symbols.

Downloading fundamental data for a list of companies available in DSE-

from dse_data_loader import FundamentalData
loader = FundamentalData()

loader.save_company_data(['ACI', 'GP', 'WALTONHIL'], path='company_info')

The above code will create two files named 'company_data.csv' & 'financial_data.csv' in the 'company_info' folder relative to current directory. The file named company_data.csv contains the fundamental data of ACI Limited, GP and Walton BD for the current year and financial_data.csv contains year-wise fundamental data according to DSE website.

Create Candlestick charts for analyzing price history-

from dse_data_loader import CandlestickPlot

cd_plot = CandlestickPlot(csv_path='ACI_history.csv', symbol='ACI')
cd_plot.show_plot(
    xtick_count=120, 
    resample=True, 
    step='3D'
)

The above code will create a Candlestick plot like the ones provided by Stock broker trading panels. There are 3 parameters-

  1. xtick_count : Provide an integer value. It sets the count of how many recent data points needs to be plotted.
  2. resample : Provide boolean True or False. Set True if you want to plot daily data aggregated by multiple days.
  3. step: Only Active when resample=True. Valid values are in the form- '3D' and '7D' for 3 days plots and weekly plots respectively.

The following are some example images of Candlestick plots-

Candlestick Plot

Candlestick Plot 3days

This is the minimal documentation. It'll be improved continuously (hopefully!).

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

dse-data-loader-0.0.33.tar.gz (292.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dse_data_loader-0.0.33-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file dse-data-loader-0.0.33.tar.gz.

File metadata

  • Download URL: dse-data-loader-0.0.33.tar.gz
  • Upload date:
  • Size: 292.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for dse-data-loader-0.0.33.tar.gz
Algorithm Hash digest
SHA256 820b9559be781c10f459b6187ca84e4f2fa1c06c7fab089790ed3fbf3786d0a1
MD5 3de195eda3bcb5b241a003e65b0f9091
BLAKE2b-256 6b87e449091710b5aa92561b1a9271dc481b0a6cdbbf2c4f32837f5b84fdbf7a

See more details on using hashes here.

File details

Details for the file dse_data_loader-0.0.33-py3-none-any.whl.

File metadata

  • Download URL: dse_data_loader-0.0.33-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for dse_data_loader-0.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 193149938f5fb3eeefb218e53d438574a02b4a748fcb05a1eb5cbc8faf227a2a
MD5 7cb3e0c7cb673fd0eb5b7db8d784a3b9
BLAKE2b-256 b09936db71e6db369811a105c782123c0aab18839f8c198664c48c73043df31e

See more details on using hashes here.

Supported by

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