Skip to main content

Indian Financial Markets

Project description

indianfinance

Get real-time information about companies listed in indian stock market.

Table of Contents

Installation

pip install indianfinance

Methods

To start getting data from companies, call company(x) where x can be

  • A company symbol like INFY (for Infosys Limited)
  • A list of company symbols separated by space like INFY WIPRO TECHM (For Infosys Limited, Wipro and Tech Mahindra)

company is the class and there are currenty three methods attached with it:

  • market_info() - gives general information about the company and data is presented in the foem of json with the following fields :

    • FullName: Full Name of the company incorporated in the stock market
    • Industry - industry it belongs to
    • ISIN - mentions the International Securities Identification Number
    • LastPrice - the last pice the company share was traded at in indian rupees
    • MCap - the total free float market capitalization of the company (in lakh crores)
  • historical_data(fromDate, toDate): presents the historical data of share market from fromDate to toDate. The date format for the input are DDMMYYYY. The json data returned contained following fields:

    • Date
    • Open - opening price
    • Close - closing price
    • High - intraday highest price
    • Low - intraday lowest price
  • annual_report(years): this method downloads the annual report for the companies for the years mentioned. the years must be separated with space (ex: 2021 2020). This method creates a directory AnnualReport in the current directory. Following is the tree structure.

AnnualReport
|
|--- PDFFiles 
|    |
|    |--Company1
|    |   |
|    |   |-year1.pdf
|    |   |-year2.pdf
|    |     -------
|    |--Company2
|        |
|        |-year1.pdf
|        |-year2.pdf
|          -------
|--- ZipFiles (----> annual reports are in  
|    |            zipfiles and extracted to 
|    |             PDF folder)
|    |
|    |--Company1
|    |   |
|    |   |-year1.zip
|    |   |-year2.zip
|    |     -------
|    |--Company2
|        |
|        |-year1.zip
|        |-year2.zip
|          -------

Basic Examples

import indianfinance

>>> c = indianfinance.company("WIPRO")

>>>> print(c.market_info())

{"WIPRO": {"FullName": "Wipro Limited", "Industry": "COMPUTERS - SOFTWARE", "ISIN": "INE075A01022", "LastPrice": 599.55, "MCap": 3.285}

>>> print(c.historical_data("04082021", "06082021"))

{"WIPRO": {"Date": ["2021-08-06", "2021-08-05", "2021-08-04"], "Open": [603.75, 597.5, 603.5], "Close": [598, 600.9, 596.8], "High": [606.4, 614.5, 604], "Low": [596.3, 597.5, 594.3]}}

Wrong company symbol will give error but at the same time give closest symbols also

>>> import indianfinance
>>> c = indianfinance.company("AIRTEL")

Couldn't find the symbol:  AIRTEL
============ Did you mean these ==============
Symbol: BHARTIARTL, Company name: Bharti Airtel Limited (----> gives the most relevant company symbol)
Traceback (most recent call last):
    line 10, in <module>
    c = indianfinance.company("AIRTEL")
  File "\indianfinance\indianfinance\company.py", line 36, in __init__
    raise ValueError
ValueError

Acknowlegements

The following package has been only possible due to the APIs of NSE

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

indianfinance-0.0.2.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

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

indianfinance-0.0.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file indianfinance-0.0.2.tar.gz.

File metadata

  • Download URL: indianfinance-0.0.2.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for indianfinance-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f8bf71ded2efe91e7ef54fd1696948cdddf34c589e0e4f81d772a804d54b86f2
MD5 29275e19f180a6132bbd50325c3ae601
BLAKE2b-256 08d140802f2918dd00f84b52fc3b6f373b8b6d86196a02f5cdf8b1ee6a642773

See more details on using hashes here.

File details

Details for the file indianfinance-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: indianfinance-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for indianfinance-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 effc6e7240f7be2df7845a1c2162e9be7f45829676217e7f24ea04f912ac3ed9
MD5 0934af88b0e28cd01f7699025f065662
BLAKE2b-256 046e20850e6beb2fcfdf84d255f6a0619b5a1e830560767c239ea4a5b543973c

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