# TSETMC-API
This library is for getting data from [tsetmc](http://tsetmc.com) website. It is divided into 5 subcomponents:
## Installation
You can install this library using the following command:
`pip install tsetmc-api`
## Examples
You can find examples of using each component in `examples` directory.
| Component | Example File |
|--------------|--------------------------------------------------------------------------------------------------------------|
| Symbol | [symbol_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/symbol_example.py) |
| Market Watch | [market_watch_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/market_watch_example.py) |
| Day Details | [day_details_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/day_details_example.py) |
| Market Map | [market_map_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/market_map_example.py) |
| Group | [group_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/group_example.py) |
| Async | [async_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/async_example.py) |
## Usage
- **symbol:** working with main symbol page and live data (
e.g. [this page](http://www.tsetmc.com/loader.aspx?ParTree=151311&i=43362635835198978))
- **market_watch:** getting data visible from [market watch page](http://www.tsetmc.com/Loader.aspx?ParTree=15131F)
- **day_details:** working with details of a symbol in a single day of history (
e.g. [this page](http://cdn.tsetmc.com/History/43362635835198978/20221029))
- **market_map:** getting data visible in [market map page](http://main.tsetmc.com/marketmap)
- **group:** getting list of available symbol groups
### Symbol Component (tsetmc_api.symbol)
![Symbol Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/Symbol.png?raw=true)
### Market Watch Component (tsetmc_api.market_watch)
![Market Watch Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/MarketWatch.png?raw=true)
### Day Details Component (tsetmc_api.day_details)
![Day Details Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/DayDetails.png?raw=true)
### Market Map Component (tsetmc_api.market_map)
![Market Map Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/MarketMap.png?raw=true)
### Group Component (tsetmc_api.group)
Group component currently only has one function (`get_all_groups`) which returns all the symbol groups.
### Errors
Tsetmc sometimes returns 403 and you should retry.
### Async Support
Each method in the library has an async counterpart with the same name and a `_async` suffix.
These methods use the sync functions behind the scene in an asyncio pool executor.
### TODO
- [ ] Migrate `symbol` component to use new tsetmc.
- [ ] Migrate `market_watch` component to use new tsetmc.
- [x] Migrate `day_details` component to use new tsetmc.
- [x] Migrate `market_map` component to use new tsetmc.
- [x] Migrate `group` component to use new tsetmc.
- [x] Support asyncio.
## Support and Donation
If this repository helped you, please support it by giving a star (:star:).
For contacting me about this project please use the following email:
[mahdi74sadeghi+tsetmc_api@gmail.com](mailto:mahdi74sadeghi+tsetmc_api@gmail.com)
Raw data
{
"_id": null,
"home_page": "https://github.com/mahs4d/tsetmc-api",
"name": "tsetmc-api",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "tsetmc,stocks,tehran stock exchange",
"author": "Mahdi Sadeghi",
"author_email": "mahdi74sadeghi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/cf/61/0e473c706f21a33632954fd9cc8fe239abae725357066e93f271c4f231d5/tsetmc_api-5.3.0.tar.gz",
"platform": null,
"description": "# TSETMC-API\n\nThis library is for getting data from [tsetmc](http://tsetmc.com) website. It is divided into 5 subcomponents:\n\n## Installation\n\nYou can install this library using the following command:\n\n`pip install tsetmc-api`\n\n## Examples\n\nYou can find examples of using each component in `examples` directory.\n\n| Component | Example File |\n|--------------|--------------------------------------------------------------------------------------------------------------|\n| Symbol | [symbol_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/symbol_example.py) |\n| Market Watch | [market_watch_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/market_watch_example.py) |\n| Day Details | [day_details_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/day_details_example.py) |\n| Market Map | [market_map_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/market_map_example.py) |\n| Group | [group_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/group_example.py) |\n| Async | [async_example.py](https://github.com/mahs4d/tsetmc-api/blob/master/examples/async_example.py) |\n\n## Usage\n\n- **symbol:** working with main symbol page and live data (\n e.g. [this page](http://www.tsetmc.com/loader.aspx?ParTree=151311&i=43362635835198978))\n- **market_watch:** getting data visible from [market watch page](http://www.tsetmc.com/Loader.aspx?ParTree=15131F)\n- **day_details:** working with details of a symbol in a single day of history (\n e.g. [this page](http://cdn.tsetmc.com/History/43362635835198978/20221029))\n- **market_map:** getting data visible in [market map page](http://main.tsetmc.com/marketmap)\n- **group:** getting list of available symbol groups\n\n### Symbol Component (tsetmc_api.symbol)\n\n![Symbol Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/Symbol.png?raw=true)\n\n### Market Watch Component (tsetmc_api.market_watch)\n\n![Market Watch Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/MarketWatch.png?raw=true)\n\n### Day Details Component (tsetmc_api.day_details)\n\n![Day Details Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/DayDetails.png?raw=true)\n\n### Market Map Component (tsetmc_api.market_map)\n\n![Market Map Component](https://github.com/mahs4d/tsetmc-api/blob/master/docs/images/MarketMap.png?raw=true)\n\n### Group Component (tsetmc_api.group)\n\nGroup component currently only has one function (`get_all_groups`) which returns all the symbol groups.\n\n### Errors\n\nTsetmc sometimes returns 403 and you should retry.\n\n### Async Support\n\nEach method in the library has an async counterpart with the same name and a `_async` suffix.\nThese methods use the sync functions behind the scene in an asyncio pool executor.\n\n### TODO\n\n- [ ] Migrate `symbol` component to use new tsetmc.\n- [ ] Migrate `market_watch` component to use new tsetmc.\n- [x] Migrate `day_details` component to use new tsetmc.\n- [x] Migrate `market_map` component to use new tsetmc.\n- [x] Migrate `group` component to use new tsetmc.\n- [x] Support asyncio.\n\n## Support and Donation\n\nIf this repository helped you, please support it by giving a star (:star:).\n\nFor contacting me about this project please use the following email:\n\n[mahdi74sadeghi+tsetmc_api@gmail.com](mailto:mahdi74sadeghi+tsetmc_api@gmail.com)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "simple package to communicate and crawl data from tsetmc.com (Tehran Stock Exchange Website)",
"version": "5.3.0",
"project_urls": {
"Homepage": "https://github.com/mahs4d/tsetmc-api",
"Repository": "https://github.com/mahs4d/tsetmc-api"
},
"split_keywords": [
"tsetmc",
"stocks",
"tehran stock exchange"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c43f391c961ee5164841583471732fb73846f223f1f63cf960459d0af5cdb213",
"md5": "a358816ccb87ac2e7d83cffb7947e311",
"sha256": "26fdffb242a6a249e80d9d4d6d831a48395558c8ae19bcd48077dc657453a5f0"
},
"downloads": -1,
"filename": "tsetmc_api-5.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a358816ccb87ac2e7d83cffb7947e311",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 27774,
"upload_time": "2023-06-14T21:22:09",
"upload_time_iso_8601": "2023-06-14T21:22:09.317319Z",
"url": "https://files.pythonhosted.org/packages/c4/3f/391c961ee5164841583471732fb73846f223f1f63cf960459d0af5cdb213/tsetmc_api-5.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cf610e473c706f21a33632954fd9cc8fe239abae725357066e93f271c4f231d5",
"md5": "41043842e53c99b99e67e941e7c371bd",
"sha256": "333948d0ed7ac71a3b72639bf06b8e49340f0199ec632519e08aa463d13aa97e"
},
"downloads": -1,
"filename": "tsetmc_api-5.3.0.tar.gz",
"has_sig": false,
"md5_digest": "41043842e53c99b99e67e941e7c371bd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 18582,
"upload_time": "2023-06-14T21:22:11",
"upload_time_iso_8601": "2023-06-14T21:22:11.007745Z",
"url": "https://files.pythonhosted.org/packages/cf/61/0e473c706f21a33632954fd9cc8fe239abae725357066e93f271c4f231d5/tsetmc_api-5.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-14 21:22:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mahs4d",
"github_project": "tsetmc-api",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "tsetmc-api"
}