Skip to main content

A Python-based web scraping tool for collecting financial data from multiple sources

Project description

Financial Scraper

A Python-based web scraping tool for collecting and analyzing financial data from multiple sources. This project helps you gather information about stocks from various financial websites.

Features

  • Scrapes financial data from multiple sources:
    • FundsExplorer
    • StatusInvest
  • Collects information about:
    • Stocks
  • Automatically saves data in organized CSV format
  • Modular architecture for easy extension

Disclaimer: This tool relies on web scraping techniques to collect data from financial websites. If any of the algorithms stop working, it may be due to changes in the structure or content of the websites being scraped. Web scraping is inherently fragile and dependent on website stability. Regular maintenance may be required to adapt to website changes.

Prerequisites

  • Python 3.10 or higher
  • Poetry (for dependency management)

Installation

  1. Clone the repository:
git clone https://github.com/johnazedo/financial-scraper.git
cd financial-scraper
  1. Install dependencies using Poetry:
poetry install

Usage

Collect Stock Data

Get stocks financial data from status invest site or fundamentus site

poetry run example_status_invest
poetry run example_fundamentus

Python API

You can also use Financial Scraper as a Python library in your own code:

Using the Status Invest Provider

from financial_scraper import StatusInvestProvider
import os

# Set the download path
download_path = os.path.dirname(os.path.abspath(__file__))

# Initialize the provider
provider = StatusInvestProvider(
    download_path=download_path,
)

# Fetch all stocks
provider.run()

# Fetch stocks from a specific sector
provider.run(sector=StatusInvestProvider.Sector.FINANCIAL_AND_OTHERS)

Using the Fundamentus Provider

from financial_scraper import FundamentusProvider
import os

# Set the download path
download_path = os.path.dirname(os.path.abspath(__file__))

# Initialize the provider
provider = FundamentusProvider(
    download_path=download_path,
)

# Fetch and save data
provider.run()

Project Structure

├── LICENSE
├── poetry.lock
├── pyproject.toml
├── README.md
├── CONTRIBUTING.md
├── mkdocs.yml
├── docs/               # Documentation files
│   ├── index.md        # Main documentation page
│   ├── examples.md     # Usage examples
│   ├── getting-started/# Installation and basic usage
│   └── modules/        # Module-specific documentation
├── examples/           # Example usage scripts
│   └── usage.py        # Example implementation
├── financial_scraper/  # Core package
│   ├── __init__.py     # Package exports
│   ├── config/         # Configuration utilities
│   │   ├── __init__.py
│   │   ├── selenium.py # Selenium configuration
│   │   └── utils.py    # Utility functions and logging
│   └── providers/      # Data providers
│       ├── __init__.py
│       ├── fundamentus.py      # Fundamentus scraper
│       └── status_invest.py    # StatusInvest scraper

Dependencies

  • beautifulsoup4 - Web scraping and parsing
  • requests - HTTP requests
  • selenium - Web browser automation
  • pandas - Data manipulation and analysis

Author

License

This project is licensed under the terms of the LICENSE file included in the repository.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

financial_scraper-1.0.3.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

financial_scraper-1.0.3-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file financial_scraper-1.0.3.tar.gz.

File metadata

  • Download URL: financial_scraper-1.0.3.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.18 Linux/6.11.0-1018-azure

File hashes

Hashes for financial_scraper-1.0.3.tar.gz
Algorithm Hash digest
SHA256 d6287a897606ee8d69639adfbd1df27e20fd94e7721888feadae7e91215c7809
MD5 6478370a1283045cedd81b302ddce76c
BLAKE2b-256 6d39577f467374f79ee497134a1cc5bfef390c4cc0eb34c0d8f49dc5a6500ff9

See more details on using hashes here.

File details

Details for the file financial_scraper-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: financial_scraper-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.18 Linux/6.11.0-1018-azure

File hashes

Hashes for financial_scraper-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 85b4e9264d20602eaa35f77bfc6abea111a121773383aa210f57aa894f58d1f3
MD5 d6b7f8828c58ccd9db4127eeaa2a6412
BLAKE2b-256 08e41aa3aeb8201a5458fedcaa03f901c259aec4b49493a95e4af632f7b62417

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