Skip to main content

A python API for Money Control Forum

Project description

moneycontrolPy

Moneycontrol.com is an Indian online business news website owned by E-EIGHTEEN Dot Com Ltd., a subsidiary of the media house TV18. moneycontrolPy is a python API for Money Control Forum.

Features

  • Get User Information
  • Get Post Information
  • Get Stock Information
  • Get top boarders
  • Get stock in the news

Dependencies

Before running the the package make sure you already have these pip packages.

  • datetime
  • json
  • re
  • time
  • dateparser
  • bs4
  • selenium

and the same chromedriver version of your current Google Chrome Browser. You can download the respective chromedriver from here.

Installation

moneycontrolPy requires python3.6 and above to run. Install the dependencies and moneycontrolPy from pip.

pip install moneycontrolPy

Documentation

After installing, you can import the package by

import moneycontrolPy.mcp as mcp

api = mcp.API()
api.DRIVER_PATH = 'path_to_your_chromedriver_file/chromedriver'

url_user = "https://mmb.moneycontrol.com/arvind151-user-profile-617276696e64313531.html"
url_post = "https://mmb.moneycontrol.com/forum-topics/stocks/hero-motocorp/thread-message-81248383-83073237.html"
url_stock = 'https://mmb.moneycontrol.com/forum-topics/stocks/ab-money-246165.html'

"""
You could change the urls if you want to search 
for a specific user/post/stock from the moneycontol forum.
"""

user_info = api.get_user_info(url_user)                 #To extract the user information
post_info = api.get_post_info(url_post)                 #To extract the post information
stock_info = api.get_stock_info(url_stock)              #To extract the stock information
top_boarders = api.get_top_boarders()                   #To extract the top boarders
hot_stocks = api.get_stock_in_the_news()                #To extract the stock in the news

"""
There are numerous options/parameters available for each of the above functions functions. 
Please refer the docstring to find them all or you could see the source code & try to understand them.
All these functions returns a dict.
You can same them as json by passing the following parameter

Eg.

user_info = api.get_user_info(url_user,save_as_json=True)
"""

Development

Want to contribute? Great! Find moneycontrolPy Github repo and feel free to fork and modify to your need.

Todos

  • Better scrolling methods.
  • Code standardization.
  • Including other web browser drivers.

License

MIT

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

moneycontrolPy-0.0.2.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

moneycontrolPy-0.0.2-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: moneycontrolPy-0.0.2.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for moneycontrolPy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 64e84e8c5bbd9a9b06e24dac7f72067b3ca3e681a20625b1a6c26af29d37474f
MD5 c19813a728504b4f9a5f1eead58cdeb5
BLAKE2b-256 20db38adef778a9d7cf96e176fbefca60bd6204d56d8b12cb7f2674eb4f92c1f

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: moneycontrolPy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for moneycontrolPy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3dd0889665d1f19674def6ffa9648e542f0a013aaad2efeb33febf2a0e12e98
MD5 807ca10a7ea35b0479eec83c2705933e
BLAKE2b-256 24e59b147af8d4093c7d5fde330f9724c774b0244e7211632f747ac139b2b2ab

See more details on using hashes here.

Provenance

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