### Install oxtapus on Windows Source: https://github.com/yghaderi/oxtapus/blob/master/README.md Use this command to install the library on Windows systems. ```bash python -m pip install oxtapus ``` -------------------------------- ### Install oxtapus on macOS and Linux Source: https://github.com/yghaderi/oxtapus/blob/master/README.md Use this command to install the library on Unix-based systems. ```bash python3 -m pip install oxtapus ``` -------------------------------- ### Retrieve Intraday Trades from TSETMC Source: https://github.com/yghaderi/oxtapus/blob/master/README.md Example showing how to initialize the TSETMC client and fetch intraday trade data for a specific symbol. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.intraday_trades("دکپسول") shape: (190, 4) ┌─────────────────────┬───────────┬─────────┬────────┐ │ datetime ┆ trade_nbr ┆ price ┆ volume │ │ --- ┆ --- ┆ --- ┆ --- │ │ datetime[μs] ┆ i64 ┆ f64 ┆ i64 │ ╞═════════════════════╪═══════════╪═════════╪════════╡ │ 2023-11-01 09:10:01 ┆ 1 ┆ 75100.0 ┆ 250 │ │ 2023-11-01 09:10:05 ┆ 2 ┆ 75100.0 ┆ 625 │ │ 2023-11-01 09:10:05 ┆ 3 ┆ 75100.0 ┆ 48 │ │ 2023-11-01 09:11:57 ┆ 4 ┆ 75150.0 ┆ 100 │ │ … ┆ … ┆ … ┆ … │ │ 2023-11-01 12:28:47 ┆ 187 ┆ 77000.0 ┆ 510 │ │ 2023-11-01 12:28:47 ┆ 188 ┆ 77000.0 ┆ 89 │ │ 2023-11-01 12:29:06 ┆ 189 ┆ 77000.0 ┆ 411 │ │ 2023-11-01 12:29:06 ┆ 190 ┆ 77000.0 ┆ 500 │ └─────────────────────┴───────────┴─────────┴────────┘ ``` -------------------------------- ### Get Complimentary Option Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Retrieve specific option information using a list of 12-digit instrument IDs. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.specific_option_data(["IRO9IKCO2851", "IRO9IKCO20K1"]) ``` -------------------------------- ### Retrieve Order Book Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Example of using the TSETMC class to fetch order book data for specific instrument codes. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tse.order_book(ins_code=["65883838195688438","22645269567765904"]) ``` -------------------------------- ### Get Last Market Activity Datetime Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieve the timestamp of the most recent market event. ```python >>> from datetime import datetime >>> from oxtapus import TSETMC >>> datetime.now() datetime.datetime(2023, 11, 3, 20, 7, 36, 378137) >>> TSETMC().last_market_activity_datetime() datetime.datetime(2023, 11, 1, 19, 21, 24) ``` -------------------------------- ### Retrieve Client Type Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Demonstrates how to initialize the TSETMC client and fetch client type data for a specific symbol. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.client_type(symbol="خودرو") ``` -------------------------------- ### Retrieve Income Statements with Rahavard Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/rahavard/index.rst.txt Demonstrates initializing the Rahavard client and fetching income statement data for a given symbol. ```python >>> from oxtapus import Rahavard >>> rah = Rahavard() >>> ist = rah.income_statements("آسیا") >>> ist.data shape: (3, 34) ┌───────────┬───────────┬───────────┬───────────┬───┬───────────┬───────────┬───────────┬──────────┐ │ date ┆ fiscal_ye ┆ 49 ┆ 51 ┆ … ┆ 33 ┆ 34 ┆ capital ┆ pure_eps │ │ --- ┆ ar ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ date ┆ --- ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ │ ┆ date ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ ╞═══════════╪═══════════╪═══════════╪═══════════╪═══╪═══════════╪═══════════╪═══════════╪══════════╡ │ 2023-07-1 ┆ 2023-03-2 ┆ 1.4780e14 ┆ 1.4780e14 ┆ … ┆ 5.8900e11 ┆ 4.8937e12 ┆ 3.1000e13 ┆ 1.8703e8 │ │ 7 ┆ 0 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ 2022-07-1 ┆ 2022-03-2 ┆ 9.6046e13 ┆ 9.6046e13 ┆ … ┆ 2.8958e12 ┆ 7.3677e12 ┆ 2.4132e13 ┆ 2.5000e8 │ │ 3 ┆ 0 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ 2021-07-0 ┆ 2021-03-1 ┆ 6.8418e13 ┆ 6.8418e13 ┆ … ┆ 2.4132e12 ┆ 5.1905e12 ┆ 2.4132e13 ┆ 3.1084e8 │ │ 5 ┆ 9 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ └───────────┴───────────┴───────────┴───────────┴───┴───────────┴───────────┴───────────┴──────────┘ >>> ist.base_info BaseInfo(announcement_type='1', financial_view_type='3') ``` -------------------------------- ### Extract Historical Price Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Demonstrates how to initialize the TSETMC client and retrieve historical price data for specific symbols. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC(async_req=True) >>> tsetmc.hist_price(symbol = ["شپنا", "فملی"]) ``` -------------------------------- ### Retrieve TSE Options Market Watch Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/index.html Initializes the TSETMC client and fetches the market watch data for TSE options. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.tse_options_mw() ``` -------------------------------- ### Retrieve IFB Options Market Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Fetches options market data for the IFB (Iran Fara Bourse) using the TSETMC client. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.ifb_options_mw() ``` -------------------------------- ### Retrieve USD/IRR data with TGJU Source: https://github.com/yghaderi/oxtapus/blob/master/README.md Initializes the TGJU client and fetches historical USD/IRR exchange rate data. ```python >>> from oxtapus import TGJU >>> tgju = TGJU() >>> tgju.usd_irr() shape: (3_688, 6) ┌────────────┬────────────┬──────────┬──────────┬──────────┬──────────┐ │ date ┆ jdate ┆ open ┆ high ┆ low ┆ close │ │ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │ │ date ┆ str ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ ╞════════════╪════════════╪══════════╪══════════╪══════════╪══════════╡ │ 2023-11-01 ┆ 1402-08-10 ┆ 514870.0 ┆ 517900.0 ┆ 513380.0 ┆ 516830.0 │ │ 2023-10-31 ┆ 1402-08-09 ┆ 516770.0 ┆ 518060.0 ┆ 515370.0 ┆ 516600.0 │ │ 2023-10-30 ┆ 1402-08-08 ┆ 511950.0 ┆ 514600.0 ┆ 510650.0 ┆ 514500.0 │ │ 2023-10-29 ┆ 1402-08-07 ┆ 519550.0 ┆ 519560.0 ┆ 513350.0 ┆ 513560.0 │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 2011-11-29 ┆ 1390-09-08 ┆ 13400.0 ┆ 13400.0 ┆ 13400.0 ┆ 13400.0 │ │ 2011-11-28 ┆ 1390-09-07 ┆ 13350.0 ┆ 13350.0 ┆ 13350.0 ┆ 13350.0 │ │ 2011-11-27 ┆ 1390-09-06 ┆ 13440.0 ┆ 13440.0 ┆ 13440.0 ┆ 13440.0 │ │ 2011-11-26 ┆ 1390-09-05 ┆ 13700.0 ┆ 13700.0 ┆ 13700.0 ┆ 13700.0 │ └────────────┴────────────┴──────────┴──────────┴──────────┴──────────┘ ``` -------------------------------- ### TSETMC.ifb_options_mw() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Retrieves the market watch data for IFB (Iran Fara Bourse) options. ```APIDOC ## TSETMC.ifb_options_mw() ### Description Fetches the current market watch data for options traded on the Iran Fara Bourse (IFB). ### Returns - **polars.DataFrame** - A DataFrame containing option market data including instrument codes, symbols, and pricing information. ``` -------------------------------- ### Fetch Historical Prices Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Demonstrates how to disable asynchronous requests and retrieve historical price data for specific instrument codes. ```python >>> tsetmc.async_req = False >>> tsetmc.hist_price(ins_code = ["7745894403636165", "35425587644337450"]) ``` -------------------------------- ### Extracting Historical Price Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Demonstrates how to fetch historical price data using symbol names with asynchronous requests enabled, and how to fetch data using instrument codes with synchronous requests. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC(async_req=True) >>> tsetmc.hist_price(symbol = ["شپنا", "فملی"]) shape: (7_629, 11) ┌───────────────────┬────────────┬────────┬────────┬───┬─────────┬──────────────┬───────────┬─────────────┐ │ ins_code ┆ date ┆ open ┆ high ┆ … ┆ y_final ┆ volume ┆ value ┆ trade_count │ │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ date ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ ╞═══════════════════╪════════════╪════════╪════════╪═══╪═════════╪══════════════╪═══════════╪═════════════╡ │ 7745894403636165 ┆ 2008-06-29 ┆ 5800.0 ┆ 5800.0 ┆ … ┆ 0.0 ┆ 1.89389047e8 ┆ 1.0985e12 ┆ 5685.0 │ │ 7745894403636165 ┆ 2008-06-30 ┆ 5974.0 ┆ 5974.0 ┆ … ┆ 5800.0 ┆ 1.9643005e7 ┆ 1.1685e11 ┆ 2021.0 │ │ 7745894403636165 ┆ 2008-07-01 ┆ 5829.0 ┆ 5839.0 ┆ … ┆ 5948.0 ┆ 2.2646072e7 ┆ 1.3157e11 ┆ 805.0 │ │ 7745894403636165 ┆ 2008-07-02 ┆ 5869.0 ┆ 5982.0 ┆ … ┆ 5808.0 ┆ 3.591428e6 ┆ 2.1308e10 ┆ 551.0 │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 35425587644337450 ┆ 2023-10-29 ┆ 6810.0 ┆ 6950.0 ┆ … ┆ 6830.0 ┆ 4.195696e7 ┆ 2.8863e11 ┆ 2388.0 │ │ 35425587644337450 ┆ 2023-10-30 ┆ 6880.0 ┆ 6990.0 ┆ … ┆ 6880.0 ┆ 2.1627873e7 ┆ 1.4942e11 ┆ 2211.0 │ │ 35425587644337450 ┆ 2023-10-31 ┆ 6920.0 ┆ 6950.0 ┆ … ┆ 6910.0 ┆ 3.6062861e7 ┆ 2.4930e11 ┆ 1956.0 │ │ 35425587644337450 ┆ 2023-11-01 ┆ 6890.0 ┆ 6920.0 ┆ … ┆ 6910.0 ┆ 4.663197e7 ┆ 3.2148e11 ┆ 2028.0 │ └───────────────────┴────────────┴────────┴────────┴───┴─────────┴──────────────┴───────────┴─────────────┘ ``` ```python >>> tsetmc.async_req = False >>> tsetmc.hist_price(ins_code = ["7745894403636165", "35425587644337450"]) shape: (7_629, 11) ┌───────────────────┬────────────┬────────┬────────┬───┬─────────┬──────────────┬───────────┬─────────────┐ │ ins_code ┆ date ┆ open ┆ high ┆ … ┆ y_final ┆ volume ┆ value ┆ trade_count │ │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ date ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ ╞═══════════════════╪════════════╪════════╪════════╪═══╪═════════╪══════════════╪═══════════╪═════════════╡ │ 7745894403636165 ┆ 2008-06-29 ┆ 5800.0 ┆ 5800.0 ┆ … ┆ 0.0 ┆ 1.89389047e8 ┆ 1.0985e12 ┆ 5685.0 │ │ 7745894403636165 ┆ 2008-06-30 ┆ 5974.0 ┆ 5974.0 ┆ … ┆ 5800.0 ┆ 1.9643005e7 ┆ 1.1685e11 ┆ 2021.0 │ │ 7745894403636165 ┆ 2008-07-01 ┆ 5829.0 ┆ 5839.0 ┆ … ┆ 5948.0 ┆ 2.2646072e7 ┆ 1.3157e11 ┆ 805.0 │ │ 7745894403636165 ┆ 2008-07-02 ┆ 5869.0 ┆ 5982.0 ┆ … ┆ 5808.0 ┆ 3.591428e6 ┆ 2.1308e10 ┆ 551.0 │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 35425587644337450 ┆ 2023-10-29 ┆ 6810.0 ┆ 6950.0 ┆ … ┆ 6830.0 ┆ 4.195696e7 ┆ 2.8863e11 ┆ 2388.0 │ │ 35425587644337450 ┆ 2023-10-30 ┆ 6880.0 ┆ 6990.0 ┆ … ┆ 6880.0 ┆ 2.1627873e7 ┆ 1.4942e11 ┆ 2211.0 │ │ 35425587644337450 ┆ 2023-10-31 ┆ 6920.0 ┆ 6950.0 ┆ … ┆ 6910.0 ┆ 3.6062861e7 ┆ 2.4930e11 ┆ 1956.0 │ │ 35425587644337450 ┆ 2023-11-01 ┆ 6890.0 ┆ 6920.0 ┆ … ┆ 6910.0 ┆ 4.663197e7 ┆ 3.2148e11 ┆ 2028.0 │ └───────────────────┴────────────┴────────┴────────┴───┴─────────┴──────────────┴───────────┴─────────────┘ ``` -------------------------------- ### Retrieve Balance Sheet Data Source: https://github.com/yghaderi/oxtapus/blob/master/README.md Initializes the Rahavard client and fetches balance sheet information for a specified company name. ```python >>> from oxtapus import Rahavard >>> rah = Rahavard() >>> bsh = rah.balance_sheet("آسیا") >>> bsh.data shape: (5, 48) ┌───────────┬───────────┬───────────┬───────────┬───┬───────────┬───────────┬───────────┬──────────┐ │ date ┆ fiscal_ye ┆ 1 ┆ 2 ┆ … ┆ 120 ┆ 8 ┆ 10 ┆ 25 │ │ --- ┆ ar ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ date ┆ --- ┆ f64 ┆ f64 ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │ │ ┆ date ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ ╞═══════════╪═══════════╪═══════════╪═══════════╪═══╪═══════════╪═══════════╪═══════════╪══════════╡ │ 2023-07-1 ┆ 2023-03-2 ┆ 1.6475e12 ┆ 9.4735e13 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ │ 7 ┆ 0 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ 2022-07-1 ┆ 2022-03-2 ┆ 9.7369e11 ┆ 6.8886e13 ┆ … ┆ 1.3831e13 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ │ 3 ┆ 0 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ 2021-07-0 ┆ 2021-03-1 ┆ 1.4242e12 ┆ 5.8496e13 ┆ … ┆ 0.0 ┆ 0.0 ┆ 0.0 ┆ 0.0 │ │ 5 ┆ 9 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ 2020-07-1 ┆ 2020-03-1 ┆ 7.1692e11 ┆ 0.0 ┆ … ┆ 0.0 ┆ 9.7560e11 ┆ 3.2546e13 ┆ 0.0 │ │ 8 ┆ 9 ┆ ┆ ┆ ┆ ┆ ┆ ┆ │ │ 2019-07-1 ┆ 2019-03-2 ┆ 6.4080e11 ┆ 1.0119e13 ┆ … ┆ 0.0 ┆ 0.0 ┆ 9.8519e12 ┆ 1.5801e1 │ │ 6 ┆ 0 ┆ ┆ ┆ ┆ ┆ ┆ ┆ 2 │ └───────────┴───────────┴───────────┴───────────┴───┴───────────┴───────────┴───────────┴──────────┘ >>> bsh.base_info BaseInfo(announcement_type='1', financial_view_type='3') ``` -------------------------------- ### Retrieve Options Market Watch Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Initializes the TSETMC client and fetches the current options market watch data as a Polars DataFrame. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.options_mw() ``` -------------------------------- ### TSETMC.options_mw Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Fetches market watch data specifically for options. ```APIDOC ## TSETMC.options_mw() ### Description Retrieves the market watch data for options instruments. ### Returns - **polars.DataFrame** - A DataFrame containing the options market data. ``` -------------------------------- ### Retrieve Options Market Watch Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Fetches market watch data specifically for options. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.options_mw() shape: (1_043, 41) ┌───────────────────┬───────────┬──────────┬────────────┬───┬────────────────┬────────────────────────────────┬──────────┬───────────────────┐ │ ins_code_ua ┆ symbol_ua ┆ final_ua ┆ y_final_ua ┆ … ┆ notional_val_p ┆ name_p ┆ symbol_p ┆ ins_code_p │ │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ str ┆ i64 ┆ i64 ┆ ┆ i64 ┆ str ┆ str ┆ str │ ╞═══════════════════╪═══════════╪══════════╪════════════╪═══╪════════════════╪════════════════════════════════╪══════════╪═══════════════════╡ │ 17914401175772326 ┆ اهرم ┆ 21350 ┆ 21450 ┆ … ┆ 0 ┆ اختيارف اهرم-20000-1403/02/26 ┆ طهرم2006 ┆ 13426704534326039 │ │ 42799209630949274 ┆ بهين رو ┆ 10620 ┆ 10750 ┆ … ┆ 0 ┆ اختيارف بهين رو-9000-03/03/30 ┆ طهين0303 ┆ 5563327722355764 │ │ 26824673819862694 ┆ خبهمن ┆ 1876 ┆ 1887 ┆ … ┆ 0 ┆ اختيارف خبهمن-2200-1403/01/29 ┆ طهمن0107 ┆ 33331632159155756 │ │ 28320293733348826 ┆ وبصادر ┆ 1777 ┆ 1799 ┆ … ┆ 0 ┆ اختيارف وبصادر-1538-1403/01/26 ┆ طصاد0103 ┆ 55072364240589915 │ │ 62235397452612911 ┆ دارا يكم ┆ 171090 ┆ 173320 ┆ … ┆ 0 ┆ اختيارف ص.دارا-260000-02/12/23 ┆ طدار1222 ┆ 12864975631063372 │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 35425587644337450 ┆ فملي ┆ 7400 ┆ 7420 ┆ … ┆ 0 ┆ اختيارف فملي-5500-1403/01/19 ┆ طملي0102 ┆ 43306098146722345 │ │ 51617145873056483 ┆ شتران ┆ 4064 ┆ 4064 ┆ … ┆ 0 ┆ اختيارف شتران-7000-1403/01/29 ┆ طترا0110 ┆ 2414774786667555 │ │ 2400322364771558 ┆ شستا ┆ 1166 ┆ 1177 ┆ … ┆ 0 ┆ اختيارف شستا-512-1402/12/09 ┆ طستا1209 ┆ 4273781978909014 │ │ 2400322364771558 ┆ شستا ┆ 1166 ┆ 1177 ┆ … ┆ 0 ┆ اختيارف شستا-1100-1402/11/11 ┆ طستا1112 ┆ 37402330157677226 │ │ 71483646978964608 ┆ ذوب ┆ 4058 ┆ 4225 ┆ … ┆ 0 ┆ اختيارف ذوب-3750-1403/03/23 ┆ طذوب3029 ┆ 45991541533193147 │ └───────────────────┴───────────┴──────────┴────────────┴───┴────────────────┴────────────────────────────────┴──────────┴───────────────────┘ ``` -------------------------------- ### ifb_options_mw() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieves market data for options trading on the Iran Fara Bourse (IFB). ```APIDOC ## Method: ifb_options_mw() ### Description Fetches the market watch data for options traded on the Iran Fara Bourse. ### Returns - **polars.DataFrame** - A DataFrame containing market data for Fara Bourse options. ``` -------------------------------- ### Fipiran.funds() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/fipiran/index.html Retrieves a collection of investment fund data. ```APIDOC ## Method: Fipiran.funds() ### Description Retrieves a dataset containing information about various investment funds. ### Signature `funds() -> polars.DataFrame` ### Returns - **polars.DataFrame** - A DataFrame containing the investment fund data. ``` -------------------------------- ### Retrieve USD/IRR historical data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tgju/index.rst.txt Fetches historical exchange rate data for USD/IRR. ```python >>> from oxtapus import TGJU >>> tgju = TGJU() >>> tgju.usd_irr() ``` -------------------------------- ### Retrieve Share Change Flow Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/index.html Retrieves the capital increase or share change history for all companies. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.ins_share_change_flow() ``` -------------------------------- ### TSETMC.order_book(symbol=None, ins_code=None) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Retrieves the order book data for the provided symbol or instrument code. Using ins_code is recommended for better performance. If both are provided, symbol is ignored. ```APIDOC ## Method: TSETMC.order_book ### Description Fetches the current order book (bid/ask data) for one or more financial symbols. It is highly recommended to use `ins_code` for faster data extraction compared to using `symbol`. ### Parameters - **symbol** (str | list[str] | None) - Optional - The symbol name. Ignored if `ins_code` is provided. - **ins_code** (str | list[str] | None) - Optional - The unique instrument code for the symbol. ### Returns - **polars.DataFrame** - A DataFrame containing the order book details including datetime, ins_code, bid/ask counts, volumes, and prices. ### Example ```python from oxtapus import TSETMC tsetmc = TSETMC() tse.order_book(ins_code=["65883838195688438","22645269567765904"]) ``` ``` -------------------------------- ### Implementation of tse_options_mw Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_modules/oxtapus/tsetmc.html The internal implementation of the tse_options_mw method, showing how it fetches data from the API and converts it into a Polars DataFrame. ```python def tse_options_mw(self): r = self.requests(self.url.tse_options_mw()) df = pl.from_dicts([OptionsMW(**i).model_dump() for i in r[0]["instrumentOptMarketWatch"]]) return df ``` -------------------------------- ### ifb_options_mw() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Retrieves the market watch data for IFB options. ```APIDOC ## Method: ifb_options_mw() ### Description Fetches the market watch data for IFB options as a polars DataFrame. ### Returns - **DataFrame** (polars.DataFrame) - A table containing instrument details including symbol, final price, and notional values. ``` -------------------------------- ### TSETMC.ins_info(symbol=None, ins_code=None) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieves basic information for one or more instruments using either their symbol or instrument code. ```APIDOC ## TSETMC.ins_info(symbol=None, ins_code=None) ### Description Fetches basic instrument data. Using ins_code is recommended for better performance as it is faster than searching by symbol. ### Parameters - **symbol** (str | list[str] | None) - Optional. The trading symbol(s). - **ins_code** (str | list[str] | None) - Optional. The instrument code(s). If provided, symbol is ignored. ### Returns - **DataFrame** (polars.DataFrame) - A DataFrame containing the requested instrument information. ``` -------------------------------- ### client_type(symbol=None, ins_code=None) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Retrieves client type data for a given stock symbol or instrument code. If both are provided, the instrument code takes precedence. ```APIDOC ## Method: client_type ### Description Retrieves historical client type data for a specific stock symbol or instrument code. Using `ins_code` is recommended for better performance. ### Parameters - **symbol** (str | list[str] | None) - Optional - The stock symbol name. - **ins_code** (str | list[str] | None) - Optional - The unique instrument code for the symbol. ### Returns - **polars.DataFrame** - A DataFrame containing the client type data. ### Example ```python from oxtapus import TSETMC tsetmc = TSETMC() tsetmc.client_type(symbol="خودرو") ``` ``` -------------------------------- ### ins_share_change_flow() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieves the capital increase/change history for all companies. ```APIDOC ## ins_share_change_flow ### Description Retrieves the capital increase or share change history for all companies listed in the market. ### Response - **Returns** (polars.DataFrame) - A DataFrame containing columns: ins_code, symbol, date, current_shares, previous_shares. ``` -------------------------------- ### Retrieving Income Statements Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/rahavard/index.rst.txt Fetches income statement data for a specific symbol, with an optional parameter to toggle quarterly reporting. ```python .. py:method:: income_statements(symbol: str, quarterly: bool = False) ``` -------------------------------- ### Retrieve Emami coin historical data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tgju/index.rst.txt Fetches historical price data for Emami gold coins. ```python >>> from oxtapus import TGJU >>> tgju = TGJU() >>> tgju.sekke_emami().head(3) ``` -------------------------------- ### Extract Historical Price Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/index.html Demonstrates retrieving historical price data using symbols with asynchronous requests enabled, and using instrument codes with synchronous requests. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC(async_req=True) >>> tsetmc.hist_price(symbol = ["شپنا", "فملی"]) ``` ```python >>> tsetmc.async_req = False >>> tsetmc.hist_price(ins_code = ["7745894403636165", "35425587644337450"]) ``` -------------------------------- ### order_book(symbol, ins_code) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieves the order book for specific symbols or instrument codes. ```APIDOC ## order_book ### Description Retrieves the order book for the specified symbol(s) or instrument code(s). Using ins_code is recommended for faster data retrieval. ### Parameters - **symbol** (str | list[str] | None) - Optional - The market symbol. - **ins_code** (str | list[str] | None) - Optional - The unique instrument code for the symbol. ### Note If both symbol and ins_code are provided, the symbol is ignored and only the ins_code is used. ### Response - **Returns** (polars.DataFrame) - A DataFrame containing the order book data. ``` -------------------------------- ### Accessing Field Information Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/rahavard/index.rst.txt Displays the structure and schema of the field information object. ```python >>> bsh.field_info ``` -------------------------------- ### Retrieve Share Change Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Fetches historical share change data. Using ins_code is recommended for faster performance. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.share_change(ins_code = "35425587644337450") ``` -------------------------------- ### TGJU.sekke_emami() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Retrieves historical data for Emami gold coins. ```APIDOC ## TGJU.sekke_emami() ### Description Returns historical data for Emami gold coins as a pandas DataFrame. ### Returns - **pandas.DataFrame** - Historical price data for Emami gold coins. ``` -------------------------------- ### Retrieve Market Indices Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Fetches the list of all indices along with their values and changes for the last trading day. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.indexes() ``` -------------------------------- ### Fetch Market Watch Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Retrieves and cleans market watch data for specified sections using the TSETMC client. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.mw(["stock", "etf", "options"]) ``` -------------------------------- ### Retrieve Last Instrument Data Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Fetches the latest data for one or more symbols. Using ins_code is recommended for better performance. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.last_ins_data(symbol=["خودرو","خساپا"]) ``` -------------------------------- ### ins_info(symbol: str | list[str] | None, ins_code: str | list[str] | None) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Retrieves base information for a trading symbol or instrument code. ```APIDOC ## Method: ins_info(symbol, ins_code) ### Description Extracts base data for a trading symbol or instrument. Using ins_code is recommended for better performance. ### Parameters - **symbol** (str | list[str] | None) - Optional - The trading symbol. - **ins_code** (str | list[str] | None) - Optional - The unique instrument code. If both are provided, ins_code takes precedence. ### Returns - **polars.DataFrame** - A DataFrame containing the base information for the requested instrument(s). ``` -------------------------------- ### TSETMC.tse_options_mw() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/index.html Retrieves the market watch data for TSE options. ```APIDOC ## TSETMC.tse_options_mw() ### Description Retrieves the market watch data for TSE (Tehran Stock Exchange) options as a polars DataFrame. ### Returns - **polars.DataFrame** - A DataFrame containing the market watch data for TSE options. ``` -------------------------------- ### Access Base Information Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/rahavard/index.html Retrieve the base information object associated with the income statement data. ```python >>> ist.base_info ``` -------------------------------- ### Track Symbols by Index Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieve a list of symbols associated with specific index codes. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC() >>> tsetmc.symbols_that_index_tracks(["21948907150049163", "3615666621538524"]) ``` -------------------------------- ### Fipiran.funds() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/fipiran/index.rst.txt Retrieves a collection of investment fund data as a Polars DataFrame. ```APIDOC ## Fipiran.funds() ### Description Retrieves a set of investment fund data. Returns the data as a polars.DataFrame. ### Method Method call on Fipiran instance ### Returns - **polars.DataFrame** - A DataFrame containing investment fund information. ``` -------------------------------- ### TSETMC.mw(sections) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieves cleaned market watch data based on the specified sections. ```APIDOC ## Method: TSETMC.mw(sections) ### Description Extracts and cleans market watch data for the specified sections. ### Parameters - **sections** (List[MWSections] or MWSections) - Required - The market sections to retrieve (e.g., 'stock', 'etf', 'options', 'bond', etc.). ### Returns - **polars.DataFrame** - The cleaned market watch data. ### Example ```python from oxtapus import TSETMC tsetmc = TSETMC() tsetmc.mw(["stock", "etf", "options"]) ``` ``` -------------------------------- ### TSETMC.mw(sections) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Extracts and cleans market watch data. ```APIDOC ## TSETMC.mw(sections) ### Description Extracts market watch data based on the specified sections and returns a cleaned polars DataFrame. ### Parameters - **sections** (List[MWSections] | MWSections) - Required - The market watch sections to extract. ### Returns - **polars.DataFrame** - Cleaned market watch data. ``` -------------------------------- ### TGJU.usd_irr() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Retrieves historical USD/IRR exchange rate data. ```APIDOC ## TGJU.usd_irr() ### Description Returns historical data for the USD/IRR exchange rate as a pandas DataFrame. ### Returns - **pandas.DataFrame** - Historical exchange rate data including date, jdate, open, high, low, and close values. ``` -------------------------------- ### income_statements(symbol: str, quarterly: bool = False) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/rahavard/index.rst.txt Retrieves income statement data for a given symbol. The quarterly parameter allows toggling between annual and quarterly reports. ```APIDOC ## income_statements ### Description Retrieves the income statement data for a specified financial symbol. ### Method Python Method ### Parameters - **symbol** (str) - Required - The ticker symbol of the company. - **quarterly** (bool) - Optional - If True, returns quarterly data; otherwise, returns annual data. Defaults to False. ``` -------------------------------- ### specific_option_data(ins_id) Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_modules/oxtapus/tsetmc.html Retrieves complimentary option information for a given instrument ID or list of IDs. ```APIDOC ### Method `specific_option_data(ins_id: str | list[str]) -> polars.DataFrame` ### Description Fetches detailed option data for specified 12-digit instrument IDs. Returns a Polars DataFrame containing fields such as instrument code, underlying instrument code, begin date, expiration date, lot size, strike price (k), and open interest. ### Parameters - **ins_id** (str | list[str]) - Required - The 12-digit instrument code(s) to retrieve data for. ### Returns - **polars.DataFrame** - A DataFrame containing the option details. ``` -------------------------------- ### TGJU.silver() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tgju/index.html Retrieves historical data for silver ounces. ```APIDOC ## TGJU.silver() ### Description Returns historical data for silver ounces as a pandas DataFrame. ### Returns - **pandas.DataFrame** - Historical data for silver. ``` -------------------------------- ### tse_options_mw() Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/tsetmc/index.rst.txt Retrieves the market watch data for options traded on the Tehran Stock Exchange. ```APIDOC ## tse_options_mw() ### Description Retrieves the market watch data for options traded on the Tehran Stock Exchange as a polars DataFrame. ### Returns - **polars.DataFrame** - A DataFrame containing the market watch data for options. ``` -------------------------------- ### TSETMC.ins_share_change_flow Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/index.html Retrieves the share capital change history for all companies. ```APIDOC ## TSETMC.ins_share_change_flow ### Description Provides the history of share capital changes for all companies listed in the market. ### Response - **Returns** (polars.DataFrame) - A DataFrame containing columns: ins_code, symbol, date, current_shares, previous_shares. ``` -------------------------------- ### last_market_activity_datetime Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/autoapi/oxtapus/tsetmc/index.html Retrieves the date and time of the last market event. ```APIDOC ## last_market_activity_datetime() ### Description Returns the date and time based on the most recent market activity event. ### Returns - **datetime.datetime** - The timestamp of the last market activity. ``` -------------------------------- ### Retrieve Instrument Information Source: https://github.com/yghaderi/oxtapus/blob/master/docs/_build/_sources/autoapi/oxtapus/index.rst.txt Fetch instrument details using either instrument codes or symbols. The async_req parameter can be enabled for asynchronous requests. ```python >>> from oxtapus import TSETMC >>> tsetmc = TSETMC(async_req=True) >>> tsetmc.ins_info(ins_code = ["7745894403636165", "65883838195688438"]) ``` ```python >>> tsetmc.ins_info(symbol = ["شپنا", "خودرو"]) ```