moneycontrol_scraper_safe
A polite Moneycontrol data collector intended for trading research.
Principles
- Respects
robots.txtfor every request viaurllib.robotparser. - No bypassing of Cloudflare, login walls, paywalls, captchas, or rate limits.
- Prefers official RSS feeds over HTML scraping.
- Adds delay between requests (default 3s, honors any declared
Crawl-delay). - Stores both raw and clean data so research is reproducible.
- Outputs pandas DataFrames plus JSON / CSV files.
If a page is disallowed by robots.txt, or the server returns 401 / 403 / 429,
the scraper stops and does not retry with tricks.
Install
pip install -r requirements.txt
Usage
# Fetch all configured RSS feeds and write clean output
python main.py rss --sentiment
# Limit to specific categories
python main.py rss --category latest_news ipo mutual_funds
# Fetch the public homepage / markets page (only if robots.txt allows)
python main.py html
# Both
python main.py all --sentiment
Set a contact email so site operators can reach you:
export MC_CONTACT="you@example.com"
Modules
| Module | Purpose |
|---|---|
config.py |
URLs, feed list, delays, paths |
robots_checker.py |
is_allowed() / crawl_delay() via urllib.robotparser |
rss_collector.py |
Polite feed fetcher using requests + feedparser |
html_collector.py |
Polite public-page fetcher (no auth, no bypass) |
parser.py |
RSS + HTML → clean pandas DataFrames |
sentiment.py |
Lightweight finance-flavoured sentiment scoring |
storage.py |
Save raw payloads (data/raw/) and clean output (data/clean/) |
cli.py |
argparse CLI: rss, html, all |
Data layout
data/
├── raw/ # JSON payloads of feeds, raw HTML pages
└── clean/ # CSV + JSON of parsed/clean DataFrames
Categories collected
Latest market news, stock news, IPO news, economy news, business news, commodity
news, personal finance news, mutual fund news, results / company headlines, and
a best-effort market overview from the public homepage / markets page (only if
robots.txt permits).
Disclaimer
This project is for personal research. Use the data in compliance with Moneycontrol's terms of service. Do not redistribute scraped content.
Metadata
Release files for moneycontrol-datascraper 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| moneycontrol_datascraper-0.2.0.tar.gz | 11.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| moneycontrol_datascraper-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.5 kB
Release files / moneycontrol_datascraper-0.2.0.tar.gz
| Download URL | moneycontrol_datascraper-0.2.0.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69e019ee3eb7f6c813ac37ae9ce2fb63621737e7300ef82387723ce42ac5b0b6
|
|
BLAKE2b-256 checksum How to use checksums |
24693df4f50f9128ed795a55dde68874e685edfd0b9feb0386b3a8286867418e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / moneycontrol_datascraper-0.2.0-py3-none-any.whl
| Download URL | moneycontrol_datascraper-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4bde59ca69c4f0610fde8a171dc1d6f7d3d79c688875d8da139b420ba78f9bf6
|
|
BLAKE2b-256 checksum How to use checksums |
4a737e43ac648548bdee47b957d85d9d822fa5c9d0c55b04eec9b0b7dc9f3655
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for moneycontrol-datascraper 0.2.0
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.