## Description
This is a Python library based on *beautifulsoup4*, *pandas* &
*mplfinance*.
<br> You may use it to download price history and fundamental information of companies from
Dhaka Stock Exchange and Chittagong Stock Exchange.
<br>This can assist you to create further analyses
based on fundamental and price history data.
<br>Also create Candlestick charts to analyse the price history of stocks using
this easy-to-use wrapper for mplfinance.
## Installation
```
pip install stocksurferbd
```
## Usage
#### Downloading historical price data of a single stock-
```python
from stocksurferbd import PriceData
loader = PriceData()
loader.save_history_csv(symbol='ACI', file_name='ACI_history.csv', market='DSE')
```
The above code will create a file named- `ACI_history.csv`.
It'll contain historical price data for ACI Limited in Dhaka Stock Exchange (DSE).
There are 3 parameters for this method-
1. ```symbol``` : Provide stock symbol of the company as string.
2. ```file_name``` : Provide the name of the history data file as string.
3. ```market```: Provide the market name as string from which you want to download the data.
Probable values are ```'CSE'``` and ```'DSE'```
#### Downloading current market price data of all listed companies in DSE/CSE-
```python
from stocksurferbd import PriceData
loader = PriceData()
loader.save_current_csv(file_name='current_data.csv', market='DSE')
```
The above code will create a file named- `current_history.csv` in the current folder.
It'll contain current price data for all symbols.
There are 2 parameters for this method-
1. ```file_name``` : Provide the name of the current price data file as string.
2. ```market```: Provide the market name as string from which you want to download the data.
Probable values ar ```'CSE'``` and ```'DSE'```
#### Downloading fundamental data for a list of companies available in DSE-
```python
from stocksurferbd import FundamentalData
loader = FundamentalData()
loader.save_company_data('ACI', path='company_info')
```
The above code will create two files named `ACI_company_data.csv` &
`ACI_financial_data.csv` in the `company_info` folder relative to
current directory. The file named `ACI_company_data.csv` contains
the fundamental data of ACI Limited for the current year and
`ACI_financial_data.csv` contains year-wise fundamental data according to [DSE website](http://dsebd.org).
There are 2 parameters `save_company_data()` this method-
1. ```symbol``` : Provide stock symbol of the company as string.
2. ```path``` : Provide the name of the directory as string to save the company data.
#### Create Candlestick charts for analyzing price history-
```python
from stocksurferbd 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.
<br/>There are 2 parameters ```__init__()``` method of CandlestickPlot class-
1. ```csv_path``` : Provide the path of history csv file as string to generate plot
2. ```symbol``` : Provide stock symbol of the company as string.
<br/>There are also 3 parameters show_plot() method-
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-

<br><br>
## If you want to contribute
Any contribution would be highly appreciated. Kindly go through the
[guidelines for contributing](CONTRIBUTING.md).
Raw data
{
"_id": null,
"home_page": "https://github.com/skfarhad/stocksurferbd",
"name": "stocksurferbd",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Sk Farhad",
"author_email": "sk.farhad.eee@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/78/d1/91c755a5be86c5ce4d1a1a244d5c2ad7cac8b088fa47b09d32e59b2f8360/stocksurferbd-0.1.2.tar.gz",
"platform": null,
"description": "## Description\r\nThis is a Python library based on *beautifulsoup4*, *pandas* &\r\n*mplfinance*.\r\n<br> You may use it to download price history and fundamental information of companies from \r\nDhaka Stock Exchange and Chittagong Stock Exchange.\r\n<br>This can assist you to create further analyses \r\nbased on fundamental and price history data. \r\n<br>Also create Candlestick charts to analyse the price history of stocks using \r\nthis easy-to-use wrapper for mplfinance.\r\n## Installation\r\n```\r\npip install stocksurferbd\r\n\r\n```\r\n## Usage\r\n\r\n#### Downloading historical price data of a single stock-\r\n\r\n```python\r\nfrom stocksurferbd import PriceData\r\nloader = PriceData()\r\n\r\nloader.save_history_csv(symbol='ACI', file_name='ACI_history.csv', market='DSE')\r\n```\r\n\r\nThe above code will create a file named- `ACI_history.csv`. \r\nIt'll contain historical price data for ACI Limited in Dhaka Stock Exchange (DSE).\r\n\r\n\r\nThere are 3 parameters for this method-\r\n\r\n1. ```symbol``` : Provide stock symbol of the company as string.\r\n2. ```file_name``` : Provide the name of the history data file as string. \r\n3. ```market```: Provide the market name as string from which you want to download the data. \r\nProbable values are ```'CSE'``` and ```'DSE'```\r\n\r\n\r\n#### Downloading current market price data of all listed companies in DSE/CSE-\r\n```python\r\nfrom stocksurferbd import PriceData\r\nloader = PriceData()\r\n\r\nloader.save_current_csv(file_name='current_data.csv', market='DSE')\r\n```\r\nThe above code will create a file named- `current_history.csv` in the current folder. \r\nIt'll contain current price data for all symbols.\r\n\r\nThere are 2 parameters for this method-\r\n\r\n1. ```file_name``` : Provide the name of the current price data file as string. \r\n2. ```market```: Provide the market name as string from which you want to download the data. \r\nProbable values ar ```'CSE'``` and ```'DSE'```\r\n\r\n#### Downloading fundamental data for a list of companies available in DSE-\r\n\r\n```python\r\nfrom stocksurferbd import FundamentalData\r\nloader = FundamentalData()\r\n\r\nloader.save_company_data('ACI', path='company_info')\r\n\r\n```\r\nThe above code will create two files named `ACI_company_data.csv` & \r\n`ACI_financial_data.csv` in the `company_info` folder relative to \r\ncurrent directory. The file named `ACI_company_data.csv` contains \r\nthe fundamental data of ACI Limited for the current year and\r\n`ACI_financial_data.csv` contains year-wise fundamental data according to [DSE website](http://dsebd.org).\r\n\r\nThere are 2 parameters `save_company_data()` this method-\r\n\r\n1. ```symbol``` : Provide stock symbol of the company as string.\r\n2. ```path``` : Provide the name of the directory as string to save the company data. \r\n\r\n#### Create Candlestick charts for analyzing price history-\r\n\r\n```python\r\n\r\nfrom stocksurferbd import CandlestickPlot\r\n\r\ncd_plot = CandlestickPlot(csv_path='ACI_history.csv', symbol='ACI')\r\ncd_plot.show_plot(\r\n xtick_count=120, \r\n resample=True, \r\n step='3D'\r\n)\r\n```\r\n\r\nThe above code will create a Candlestick plot like the ones provided by \r\nStock broker trading panels. \r\n\r\n<br/>There are 2 parameters ```__init__()``` method of CandlestickPlot class-\r\n\r\n1. ```csv_path``` : Provide the path of history csv file as string to generate plot\r\n2. ```symbol``` : Provide stock symbol of the company as string.\r\n\r\n<br/>There are also 3 parameters show_plot() method-\r\n\r\n1. ```xtick_count``` : Provide an integer value. \r\n It sets the count of how many recent data points needs to be plotted.\r\n2. ```resample``` : Provide boolean ```True``` or ```False```. \r\n Set ```True``` if you want to plot daily data aggregated by multiple days.\r\n3. ```step```: Only Active when ```resample=True```. \r\n Valid values are in the form- \r\n ```'3D'``` and ```'7D'``` for 3 days plots and weekly plots respectively.\r\n\r\nThe following are some example images of Candlestick plots-\r\n\r\n\r\n<br><br>\r\n\r\n\r\n\r\n## If you want to contribute\r\n\r\nAny contribution would be highly appreciated. Kindly go through the \r\n[guidelines for contributing](CONTRIBUTING.md).\r\n",
"bugtrack_url": null,
"license": null,
"summary": "This is a tool to download stock market data of Dhaka Stock Exchange.",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/skfarhad/stocksurferbd/issues",
"Homepage": "https://github.com/skfarhad/stocksurferbd"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "68a0822a6f3d38227584d8c1179bae94bfb3c0ee2fd458da36b278d0c2d30521",
"md5": "034fb10282ef70162d9de31993f0962c",
"sha256": "440cd8c0e128ba2c0732edde6e2d75a2ac3d92dbae758147f96deb9cb7b32122"
},
"downloads": -1,
"filename": "stocksurferbd-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "034fb10282ef70162d9de31993f0962c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 10543,
"upload_time": "2024-08-15T18:20:33",
"upload_time_iso_8601": "2024-08-15T18:20:33.109495Z",
"url": "https://files.pythonhosted.org/packages/68/a0/822a6f3d38227584d8c1179bae94bfb3c0ee2fd458da36b278d0c2d30521/stocksurferbd-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78d191c755a5be86c5ce4d1a1a244d5c2ad7cac8b088fa47b09d32e59b2f8360",
"md5": "d407863bf1d1c05930dc4e5fb8aa745b",
"sha256": "8448d2325e26bfcbd4b7c0ae593eb40c879ec4dff07826e317a0e9e555aaa073"
},
"downloads": -1,
"filename": "stocksurferbd-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "d407863bf1d1c05930dc4e5fb8aa745b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 11011,
"upload_time": "2024-08-15T18:20:34",
"upload_time_iso_8601": "2024-08-15T18:20:34.650826Z",
"url": "https://files.pythonhosted.org/packages/78/d1/91c755a5be86c5ce4d1a1a244d5c2ad7cac8b088fa47b09d32e59b2f8360/stocksurferbd-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-15 18:20:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "skfarhad",
"github_project": "stocksurferbd",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
"==",
"2.25.1"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "openpyxl",
"specs": [
[
"==",
"3.1.5"
]
]
},
{
"name": "beautifulsoup4",
"specs": [
[
"==",
"4.9.3"
]
]
},
{
"name": "matplotlib",
"specs": [
[
"==",
"3.9.2"
]
]
},
{
"name": "mplfinance",
"specs": [
[
"==",
"0.12.7a17"
]
]
},
{
"name": "pyti",
"specs": [
[
"==",
"0.2.2"
]
]
},
{
"name": "tapy",
"specs": [
[
"==",
"1.9.1"
]
]
},
{
"name": "jupyter",
"specs": []
},
{
"name": "jupyterthemes",
"specs": []
},
{
"name": "wheel",
"specs": []
},
{
"name": "twine",
"specs": []
},
{
"name": "pynamodb",
"specs": []
}
],
"lcname": "stocksurferbd"
}