Skip to main content

a library to retrieve data from tsetmc.com website

Project description

A Python library to fetch data from http://tsetmc.com.

Installation

Requires Python 3.9+.

pip install --user tsetmc

Overview

There are four main functions that return pandas DataFrame s:

  • get_market_watch_init

  • get_closing_price_all

  • get_client_type_all

  • get_key_stats

Together, they return all the information available for creating filters on tsetmc.com.

There is also an Instrument class which provides methods for getting the information on page of the given instrument (get_page_info), its instantaneous information (get_info), and its trading history (get_trade_history).

>>> from tsetmc import Instrument
>>> inst = Instrument('فملی')
>>> inst.get_trade_history(top=2)
             pmax     pmin       pc  ...          tval       tvol    tno
date                                 ...
20210120  10400.0  10120.0  10380.0  ...  4.984848e+11   48013394   7284
20210119  10380.0   9400.0   9910.0  ...  2.649416e+12  267389256  36765
[2 rows x 9 columns]

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsetmc-0.24.1.tar.gz (78.7 kB view hashes)

Uploaded Source

Built Distribution

tsetmc-0.24.1-py3-none-any.whl (70.5 kB view hashes)

Uploaded Python 3

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