Skip to main content

a library to retrieve data from fipiran.com website

Project description

An async python library to fetch data from https://www.fipiran.com/ .

Note: This is package is incomplete and still in initial development phase. The API may change without deprecation.

Installation

Requires Python 3.10+.

$ pip install fipiran

Usage

For any async operation fipiran.SESSION needs to be set to an aiohttp.ClientSession instance:

import asyncio
import aiohttp
import fipiran
from fipiran.symbols import Symbol

async def main():
    async with aiohttp.ClientSession() as fipiran.SESSION:
        company_info = await Symbol('فملی').company_info()
    print(company_info)

asyncio.run(main())

fipiran.Session() provides a shorter alternative for the above:

import asyncio
import fipiran
from fipiran.symbols import Symbol

async def main():
    async with fipiran.Session():
        company_info = await Symbol('فملی').company_info()
    print(company_info)

asyncio.run(main())

There are three modules:

  • data_service

  • funds

  • symbols

Use and asyncio-aware REPL, like python -m asyncio, to run these code samples.

Prepare the session:

>>> import fipiran
>>> fipiran.SESSION = fipiran.Session()

Example 1:

>>> from fipiran.symbols import Symbol
>>> await Symbol('فملی').company_info()
{'نام نماد': 'فملی',
 'نام شرکت': 'ملی صنایع مس ایران',
 'مدیر عامل': 'اردشیر سعدمحمدی',
 'تلفن': '021-88724410',
 'فکس': '021-88729014',
 'آدرس': 'مجتمع مس سرچشمه و مجتمع مس میدوک در استان کرمان و مجتمع مس سونگون در تبریز شهرستان ورزقان واقع شده اند.',
 'وب سایت': 'www.nicico.com',
 'ایمیل': 'office@nicico.com',
 'سال مالی': '12/29',
 'موضوع فعالیت': 'اکتشافات،  استخراج و  بهره برداری از معادن  مس  ایران'}

Example 2:

Getting list of funds as a pandas DataFrame object.

>>> from fipiran.funds import funds
>>> await funds()
     regNo                                  name  ...      isCompleted  fundWatch
0    11726                        جسورانه فیروزه  ...         True       None
1    11603              جسورانه فناوری بازنشستگی  ...         True       None
2    11780                    گروه زعفران سحرخیز  ...         True       None
3    11772                      طلای سرخ نو ویرا  ...         True       None
4    11480                 جسورانه یکم آرمان آتی  ...         True       None
..     ...                                   ...  ...          ...        ...
308  11916                    با درآمد ثابت آریا  ...        False       None
309  11922                      آوای تاراز زاگرس  ...        False       None
310  11927                    صندوق در صندوق صنم  ...        False       None
311  11931  اختصاصی بازارگردانی توسعه سهام عدالت  ...        False       None
312  11933       اختصاصی بازارگردانی تثبیت پاداش  ...        False       None
[313 rows x 37 columns]

There are many other functions and methods. Please explore the code-base for more info.

If you are interested in other information that are available on fipiran.com but this library has no API for, please open an issue for them on github.

See also

Project details


Download files

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

Source Distribution

fipiran-0.11.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fipiran-0.11.0-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file fipiran-0.11.0.tar.gz.

File metadata

  • Download URL: fipiran-0.11.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for fipiran-0.11.0.tar.gz
Algorithm Hash digest
SHA256 ceb3b0c6b8498c977156bb705c30253b4e7c1e9065772b5f268ac8d9661d4775
MD5 d5bd81cc9c6e72a1677f2a19c699997f
BLAKE2b-256 bb816eee3597b305101f557f4ceb195a6cf696bf013ce5b919aeb48c1d1325ac

See more details on using hashes here.

File details

Details for the file fipiran-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: fipiran-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.3

File hashes

Hashes for fipiran-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54d44a4132119e60886e7cf91d2748e12690242b28ee9cb687c54203f567c649
MD5 650e8e1e4921daa99cae0072ea254e82
BLAKE2b-256 410815455d347d647979470367798c55d7be83ea11ec1a2cd19f589a23369af6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page