bdshare


Namebdshare JSON
Version 1.1.2 PyPI version JSON
download
home_pageNone
SummaryA utility for crawling historical and Real-time Quotes of DSE(Dhaka Stock Exchange)
upload_time2024-12-31 10:50:17
maintainerNone
docs_urlNone
authorRaisul Islam
requires_python>=3.9
licenseMIT
keywords crawling dse financial data
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #Bdshare                                                             
---

![StyleCI](https://github.styleci.io/repos/253465924/shield?branch=main)
[![Documentation Status](https://readthedocs.org/projects/bdshare/badge/?version=latest)](https://bdshare.readthedocs.io/en/latest/?badge=latest)
![PyPI](https://img.shields.io/pypi/v/bdshare)



A utility for crawling historical and Real-time data from stock exchanges of Bangladesh. At present this utility can collect data from Dhaka stock exchange.

### <a name="contents"></a>Contents
- [Installation](#install)
- [Example Use](#usage)
- [List of functions](#functions)
- [Todo's and Road Map:](#roadmap)


## Quickstart

### <a name="install"></a>[Installation](#contents)

```sh
$ pip install bdshare
```
or upgrade
```sh
$ pip install -U bdshare
```

### <a name="usage"></a>[Example Use](#contents)

#### Get DSE last or current trading data
```python
from bdshare import get_current_trade_data

df = get_current_trade_data()
print(df.to_string())
```
```python
from bdshare import get_current_trade_data

df = get_current_trade_data('GP') # get specific instrument data
print(df.to_string())
```

#### Get historical data
```python
from bdshare import get_hist_data

df = get_hist_data('2022-03-01','2022-03-02') # get all instrument data
print(df.to_string())
```
or
```python
from bdshare import get_hist_data

df = get_hist_data('2022-03-01','2022-03-02','ACI') # get specific instrument data
print(df.to_string())
```

#### Get OHLCV historical data
```python
from bdshare import get_basic_hist_data

df = get_basic_hist_data('2022-03-01','2022-03-02') # get all instrument data
print(df.to_string())
```
or
```python
import datetime as dt
from bdshare import get_basic_hist_data

start = dt.datetime.now().date() - dt.timedelta(days=2 * 365)
end = dt.datetime.now().date()
df = get_basic_hist_data(start, end, 'GP') # get specific instrument data
print(df.to_string())
```

#### Get DSE Index data
```python
from bdshare import get_market_inf

df = get_market_inf() # get last 30 days market data
print(df.to_string())
```

```python
from bdshare import get_market_inf_more_data

df = get_market_inf_more_data('2022-03-01','2022-03-02') # get historical market data
print(df.to_string())
```

#### Get DSE Market Depth data
```python
from bdshare import get_market_depth_data

df = get_market_depth_data('ACI') # get current buy and sell data
print(df.to_string())
```

#### Save data to csv file
```python
import datetime as dt
from bdshare import get_basic_hist_data, Store

start = dt.datetime.now().date() - dt.timedelta(days=2 * 365)
end = dt.datetime.now().date()
df = get_basic_hist_data(start, end) # get all instrument data
Store(df).save()
```

### <a name="functions"></a> [List of functions](#contents)

#### Trading data
|Function|Params|Description|
|---|---|---|
|get_current_trade_data()|symbol:str|get last stock price|
|get_dsex_data()|symbol:str|get dseX share price|
|get_current_trading_code()||get last stock codes|
|get_hist_data()|start:str, end:str|get historical stock price|
|get_basic_hist_data()|start:str, end:str, code:str|get historical stock price|
|get_close_price_data()|start:str, end:str, code:str|get stock close price|
|get_last_trade_price_data()|||

#### Trading news
|Function|Params|Description|
|---|---|---|
|get_agm_news()||get stock agm declarations|
|get_all_news()|start:str, end:str, code:str|get dse news|

#### Market data
|Function|Params|Description|
|---|---|---|
|get_market_inf()||get stock market information|
|get_latest_pe()||get last stock P/E|
|get_market_inf_more_data()|start:str, end:str|get historical stock price|
|get_market_depth_data()|index:str|get_market_depth_data('ACI')|

### <a name="roadmap"></a> [TODO's and Road Map:](#contents)
 - [x] refine logic for parameters 
 - [x] Demo example;
 - [x] DSE daily data and historical data crawling
 - [x] DSE news,p/e crawling
 - [x] Add DSEX Index data support
 - [x] Create tests
 - [x] Store dat to csv
 - [x] DSE market depth data
 - [x] Add docker support in demo example


### Documentation

Complete documentation can be found at [Readthedocs](http://bdshare.readthedocs.io/en/latest/ "bdshare's readthedocs") .


## Contributing to this project

Anyone and everyone is welcome to contribute. Please take a moment to
review the [guidelines for contributing](CONTRIBUTING.md).

* [Bug reports](CONTRIBUTING.md#bugs)
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)

# Change log

## [1.1.2] - 2024-12-31

### Added

- n/a

### Changed

- update tests

### Fixed

- n/a

## [1.1.1] - 2024-12-31

### Added

- n/a

### Changed

- update runner

### Fixed

- n/a

## [1.1.0] - 2024-12-31

### Added

- new function for getting company info

### Changed

- n/a

### Fixed

- n/a

## [1.0.4] - 2024-12-30

### Added

- n/a

### Changed

- changed lint

### Fixed

- fixed typo

## [1.0.3] - 2024-07-29

### Added

- n/a

### Changed

- n/a

### Fixed

- check fix for latest P/E url [#6]

## [1.0.2] - 2024-07-29

### Added

- n/a

### Changed

- n/a

### Fixed

- fixed latest P/E url [#6]

## [1.0.0] - 2024-03-04

### Added

- Updated docs

### Changed

- n/a

## [0.7.2] - 2024-03-04

### Added

- Updated docs

### Changed

- n/a

## [0.7.1] - 2024-03-04

### Added

- n/a

### Changed

- fixed market depth data api

## [0.7.0] - 2024-03-04

### Added

- n/a

### Changed

- n/a

## [0.6.0] - 2024-03-03

### Added

- n/a

### Changed

- n/a

## [0.5.1] - 2024-02-29

### Added

- n/a

### Changed

- n/a

## [0.5.0] - 2024-02-29

### Added

- fixed store datafrave to csv file method

### Changed

- n/a

## [0.4.0] - 2023-03-12

### Added

- n/a

### Changed

- changed package manager

## [0.3.2] - 2022-10-10

### Added

- n/a

### Changed

- n/a

## [0.3.1] - 2022-06-15

### Added

- n/a

### Changed

- n/a

## [0.2.1] - 2021-08-01

### Added

-

### Changed

- `get_current_trading_code()`

## [0.2.0] - 2021-06-01

### Added

- added get_market_depth_data
- added get_dsex_data
- added 'dse.com.bd' as redundant

### Changed

- Changed documentation
- changed get_agm_news
- changed get_all_news

## [0.1.4] - 2020-08-22

### Added

- added get_market_inf_more_data

### Changed

- Changed documentation

## [0.1.3] - 2020-08-20

### Added

- html5lib
- added get params

### Changed

- post request to get

## [0.1.2] - 2020-05-21

### Added

- modified index declaration

## [0.1.1] - 2020-05-20

### Added

- modified index declaration

## [0.1.0] - 2020-04-08

### Added

- added git tag
- `VERSION.txt`

### Changed

- `setup.py`
- `HISTORY.md` to `CHANGELOG.md`

## [0.0.1] - 2020-04-06

### Added

- `get_hist_data(), get_current_trade_data()`
- `HISTORY.md`

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bdshare",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "Crawling, DSE, Financial Data",
    "author": "Raisul Islam",
    "author_email": "raisul.me@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1f/d7/3674810ffc3e8374441b8b6dce764c105c4249333162d9d62568c1146ea9/bdshare-1.1.2.tar.gz",
    "platform": null,
    "description": "#Bdshare                                                             \n---\n\n![StyleCI](https://github.styleci.io/repos/253465924/shield?branch=main)\n[![Documentation Status](https://readthedocs.org/projects/bdshare/badge/?version=latest)](https://bdshare.readthedocs.io/en/latest/?badge=latest)\n![PyPI](https://img.shields.io/pypi/v/bdshare)\n\n\n\nA utility for crawling historical and Real-time data from stock exchanges of Bangladesh. At present this utility can collect data from Dhaka stock exchange.\n\n### <a name=\"contents\"></a>Contents\n- [Installation](#install)\n- [Example Use](#usage)\n- [List of functions](#functions)\n- [Todo's and Road Map:](#roadmap)\n\n\n## Quickstart\n\n### <a name=\"install\"></a>[Installation](#contents)\n\n```sh\n$ pip install bdshare\n```\nor upgrade\n```sh\n$ pip install -U bdshare\n```\n\n### <a name=\"usage\"></a>[Example Use](#contents)\n\n#### Get DSE last or current trading data\n```python\nfrom bdshare import get_current_trade_data\n\ndf = get_current_trade_data()\nprint(df.to_string())\n```\n```python\nfrom bdshare import get_current_trade_data\n\ndf = get_current_trade_data('GP') # get specific instrument data\nprint(df.to_string())\n```\n\n#### Get historical data\n```python\nfrom bdshare import get_hist_data\n\ndf = get_hist_data('2022-03-01','2022-03-02') # get all instrument data\nprint(df.to_string())\n```\nor\n```python\nfrom bdshare import get_hist_data\n\ndf = get_hist_data('2022-03-01','2022-03-02','ACI') # get specific instrument data\nprint(df.to_string())\n```\n\n#### Get OHLCV historical data\n```python\nfrom bdshare import get_basic_hist_data\n\ndf = get_basic_hist_data('2022-03-01','2022-03-02') # get all instrument data\nprint(df.to_string())\n```\nor\n```python\nimport datetime as dt\nfrom bdshare import get_basic_hist_data\n\nstart = dt.datetime.now().date() - dt.timedelta(days=2 * 365)\nend = dt.datetime.now().date()\ndf = get_basic_hist_data(start, end, 'GP') # get specific instrument data\nprint(df.to_string())\n```\n\n#### Get DSE Index data\n```python\nfrom bdshare import get_market_inf\n\ndf = get_market_inf() # get last 30 days market data\nprint(df.to_string())\n```\n\n```python\nfrom bdshare import get_market_inf_more_data\n\ndf = get_market_inf_more_data('2022-03-01','2022-03-02') # get historical market data\nprint(df.to_string())\n```\n\n#### Get DSE Market Depth data\n```python\nfrom bdshare import get_market_depth_data\n\ndf = get_market_depth_data('ACI') # get current buy and sell data\nprint(df.to_string())\n```\n\n#### Save data to csv file\n```python\nimport datetime as dt\nfrom bdshare import get_basic_hist_data, Store\n\nstart = dt.datetime.now().date() - dt.timedelta(days=2 * 365)\nend = dt.datetime.now().date()\ndf = get_basic_hist_data(start, end) # get all instrument data\nStore(df).save()\n```\n\n### <a name=\"functions\"></a> [List of functions](#contents)\n\n#### Trading data\n|Function|Params|Description|\n|---|---|---|\n|get_current_trade_data()|symbol:str|get last stock price|\n|get_dsex_data()|symbol:str|get dseX share price|\n|get_current_trading_code()||get last stock codes|\n|get_hist_data()|start:str, end:str|get historical stock price|\n|get_basic_hist_data()|start:str, end:str, code:str|get historical stock price|\n|get_close_price_data()|start:str, end:str, code:str|get stock close price|\n|get_last_trade_price_data()|||\n\n#### Trading news\n|Function|Params|Description|\n|---|---|---|\n|get_agm_news()||get stock agm declarations|\n|get_all_news()|start:str, end:str, code:str|get dse news|\n\n#### Market data\n|Function|Params|Description|\n|---|---|---|\n|get_market_inf()||get stock market information|\n|get_latest_pe()||get last stock P/E|\n|get_market_inf_more_data()|start:str, end:str|get historical stock price|\n|get_market_depth_data()|index:str|get_market_depth_data('ACI')|\n\n### <a name=\"roadmap\"></a> [TODO's and Road Map:](#contents)\n - [x] refine logic for parameters \n - [x] Demo example;\n - [x] DSE daily data and historical data crawling\n - [x] DSE news,p/e crawling\n - [x] Add DSEX Index data support\n - [x] Create tests\n - [x] Store dat to csv\n - [x] DSE market depth data\n - [x] Add docker support in demo example\n\n\n### Documentation\n\nComplete documentation can be found at [Readthedocs](http://bdshare.readthedocs.io/en/latest/ \"bdshare's readthedocs\") .\n\n\n## Contributing to this project\n\nAnyone and everyone is welcome to contribute. Please take a moment to\nreview the [guidelines for contributing](CONTRIBUTING.md).\n\n* [Bug reports](CONTRIBUTING.md#bugs)\n* [Feature requests](CONTRIBUTING.md#features)\n* [Pull requests](CONTRIBUTING.md#pull-requests)\n\n# Change log\n\n## [1.1.2] - 2024-12-31\n\n### Added\n\n- n/a\n\n### Changed\n\n- update tests\n\n### Fixed\n\n- n/a\n\n## [1.1.1] - 2024-12-31\n\n### Added\n\n- n/a\n\n### Changed\n\n- update runner\n\n### Fixed\n\n- n/a\n\n## [1.1.0] - 2024-12-31\n\n### Added\n\n- new function for getting company info\n\n### Changed\n\n- n/a\n\n### Fixed\n\n- n/a\n\n## [1.0.4] - 2024-12-30\n\n### Added\n\n- n/a\n\n### Changed\n\n- changed lint\n\n### Fixed\n\n- fixed typo\n\n## [1.0.3] - 2024-07-29\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n### Fixed\n\n- check fix for latest P/E url [#6]\n\n## [1.0.2] - 2024-07-29\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n### Fixed\n\n- fixed latest P/E url [#6]\n\n## [1.0.0] - 2024-03-04\n\n### Added\n\n- Updated docs\n\n### Changed\n\n- n/a\n\n## [0.7.2] - 2024-03-04\n\n### Added\n\n- Updated docs\n\n### Changed\n\n- n/a\n\n## [0.7.1] - 2024-03-04\n\n### Added\n\n- n/a\n\n### Changed\n\n- fixed market depth data api\n\n## [0.7.0] - 2024-03-04\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n## [0.6.0] - 2024-03-03\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n## [0.5.1] - 2024-02-29\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n## [0.5.0] - 2024-02-29\n\n### Added\n\n- fixed store datafrave to csv file method\n\n### Changed\n\n- n/a\n\n## [0.4.0] - 2023-03-12\n\n### Added\n\n- n/a\n\n### Changed\n\n- changed package manager\n\n## [0.3.2] - 2022-10-10\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n## [0.3.1] - 2022-06-15\n\n### Added\n\n- n/a\n\n### Changed\n\n- n/a\n\n## [0.2.1] - 2021-08-01\n\n### Added\n\n-\n\n### Changed\n\n- `get_current_trading_code()`\n\n## [0.2.0] - 2021-06-01\n\n### Added\n\n- added get_market_depth_data\n- added get_dsex_data\n- added 'dse.com.bd' as redundant\n\n### Changed\n\n- Changed documentation\n- changed get_agm_news\n- changed get_all_news\n\n## [0.1.4] - 2020-08-22\n\n### Added\n\n- added get_market_inf_more_data\n\n### Changed\n\n- Changed documentation\n\n## [0.1.3] - 2020-08-20\n\n### Added\n\n- html5lib\n- added get params\n\n### Changed\n\n- post request to get\n\n## [0.1.2] - 2020-05-21\n\n### Added\n\n- modified index declaration\n\n## [0.1.1] - 2020-05-20\n\n### Added\n\n- modified index declaration\n\n## [0.1.0] - 2020-04-08\n\n### Added\n\n- added git tag\n- `VERSION.txt`\n\n### Changed\n\n- `setup.py`\n- `HISTORY.md` to `CHANGELOG.md`\n\n## [0.0.1] - 2020-04-06\n\n### Added\n\n- `get_hist_data(), get_current_trade_data()`\n- `HISTORY.md`\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A utility for crawling historical and Real-time Quotes of DSE(Dhaka Stock Exchange)",
    "version": "1.1.2",
    "project_urls": null,
    "split_keywords": [
        "crawling",
        " dse",
        " financial data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "33c445997e53122bb1aa28a608a205ba6fb94a1122b95ac54b0fed02c6c64a81",
                "md5": "01de4d0df9a254f902f26d6d70284531",
                "sha256": "59ee32a659faee8f1d93ffd53a910ed073de137cfdf4dc7829d6f17850c03fb2"
            },
            "downloads": -1,
            "filename": "bdshare-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "01de4d0df9a254f902f26d6d70284531",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 15664,
            "upload_time": "2024-12-31T10:50:15",
            "upload_time_iso_8601": "2024-12-31T10:50:15.189771Z",
            "url": "https://files.pythonhosted.org/packages/33/c4/45997e53122bb1aa28a608a205ba6fb94a1122b95ac54b0fed02c6c64a81/bdshare-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1fd73674810ffc3e8374441b8b6dce764c105c4249333162d9d62568c1146ea9",
                "md5": "a0354663782dc1e45062bb57f8c1e7ae",
                "sha256": "ff9b157aa4e78faa58a1c95bb31696e4169849d456a5231672352bcd1f2a3580"
            },
            "downloads": -1,
            "filename": "bdshare-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "a0354663782dc1e45062bb57f8c1e7ae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 12348,
            "upload_time": "2024-12-31T10:50:17",
            "upload_time_iso_8601": "2024-12-31T10:50:17.354702Z",
            "url": "https://files.pythonhosted.org/packages/1f/d7/3674810ffc3e8374441b8b6dce764c105c4249333162d9d62568c1146ea9/bdshare-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-31 10:50:17",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "bdshare"
}
        
Elapsed time: 0.69198s