Skip to main content

tfinance - Tehran Stock Exchange OSINT Tool for Python

Python version PyPi version PyPi downloads

This is just an Alpha release, So If you find it interesting or you encounter any bugs, I would appreciate if you let me know!

Overview

Currently there is no active well-documented API for TSE capital market out there. And this is a big obstacle to development of projects and studies based on this data. tfinance aimes to solve this problem by developing an OSINT tool to provide a reliable, threaded, and Pythonic way to access TSE’s historical data.

>> import tfinance as tfin
>> market = tfin.Market() # Initializes your local database - The first run on your system may take a few minutes(~It will download ~90MB of data.)

>> market.tickers.head()
                  id                    name  ...   sub_market   ticker_code
0  37661500521100963  توليد نيروي برق آبادان  ...  فهرست اوليه  IRO1NBAB0001
1  55254206302462116       آسان پرداخت پرشين  ...  فهرست اوليه  IRO1APPE0001
2  51106317433079213               بيمه آسيا  ...   تابلو اصلي  IRO1ASIA0001
3  14079693677610396  انتقال داده هاي آسياتك  ...  فهرست اوليه  IRO1ASTC0001
4  44834847569322522        كنتورسازي‌ايران‌  ...   تابلو فرعي  IRO1CONT0001

>>foolad = tfin.Ticker(ticker="فولاد")
>> foolad.name
'فولاد مباركه اصفهان'
>> foolad.sector
'فلزات اساسي'

>> foolad.history.head()
            <TICKER> <DTYYYYMMDD>  <FIRST>  ...  <PER>   <OPEN>   <LAST>
0  S*Mobarakeh.Steel   2020-10-06  17700.0  ...      D  17860.0  18240.0
1  S*Mobarakeh.Steel   2020-10-05  17610.0  ...      D  18210.0  17700.0
2  S*Mobarakeh.Steel   2020-10-04  18760.0  ...      D  18710.0  18090.0
3  S*Mobarakeh.Steel   2020-10-03  18290.0  ...      D  17920.0  18810.0
4  S*Mobarakeh.Steel   2020-09-30  18170.0  ...      D  17500.0  18290.0
[5 rows x 12 columns]

Installation

The easiest way to install tfinance is from the Python Package Index using pip or easy_install:

$ pip install tfinance

License

https://img.shields.io/pypi/l/tfinance?color=green

Metadata

Release files for tfinance 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfinance 0.1.4
File Size Uploaded Provenance Actions
tfinance-0.1.4.tar.gz 21.2 kB Without provenance Details for tfinance-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tfinance 0.1.4
File Interpreter ABI Platform Actions
tfinance-0.1.4-py3-none-any.whl Python 3 none any Details for tfinance-0.1.4-py3-none-any.whl

Total release size: 43.1 kB

Release files / tfinance-0.1.4.tar.gz

Download URL tfinance-0.1.4.tar.gz
Size 21.2 kB
Tags Source
SHA-256 checksum
How to use checksums
acabbe0b1352a6446e6c3e2ae4d9f838670faec40c5825a66bf14bcba0723024
BLAKE2b-256 checksum
How to use checksums
0ced553e577b8b8119c0c8cff715b5f6884268a42d9055951ebe0b465209dfe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / tfinance-0.1.4-py3-none-any.whl

Download URL tfinance-0.1.4-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c8bf9eb9a806d6398944c8b4df8c3d6ae8ac0cc1e7b3a777ae9bb77547f4d21
BLAKE2b-256 checksum
How to use checksums
2a72829b423044c249523c988d2dc2b569af6da7a2198ef91f67d0b758604a5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Security for tfinance 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page