Skip to main content

it is a lightweight Python library for extracting financial data from structured, publicly accessible stock information pages

Project description

https://img.shields.io/pypi/v/sfinance.svg Documentation Status

sfinance is a lightweight Python library for automating the extraction of financial tables from publicly accessible, structured HTML pages.

It uses Selenium and BeautifulSoup under the hood to simulate browser behavior and extract data into pandas DataFrames for further analysis.

This tool is intended for personal and educational use only.

Usage

Install the package (once published on PyPI):

pip install sfinance

Use it like this:

from sfinance.sfinance import StockDataFetcher

url = "https://www.screener.in/company/INFY/consolidated/"  # Full URL is required
fetcher = StockDataFetcher(url)

overview = fetcher.get_company_overview()
income = fetcher.get_income_statement()
balance = fetcher.get_balance_sheet()
cashflow = fetcher.get_cash_flow()
shareholding = fetcher.get_shareholding()

print(overview, income, balance, cashflow, shareholding)

fetcher.close()

This will return clean, structured pandas DataFrames from dynamically rendered pages. You are expected to supply valid URLs yourself. The package does not suggest or pre-configure any third-party endpoints.

Features

  • Uses Selenium to render dynamic content

  • Parses financial tables with BeautifulSoup

  • Extracts income statement, balance sheet, cash flow, shareholding, and company overview

  • Outputs pandas DataFrames for analysis

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

sfinance-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

sfinance-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file sfinance-0.1.1.tar.gz.

File metadata

  • Download URL: sfinance-0.1.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for sfinance-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ce2560459f9d366a066ba7c7eed60cd3fd315564d98757ff797f258d0ef165ac
MD5 864d075005c48bc8482e771004ad971d
BLAKE2b-256 716cca3290808d41f02013c6b1976ab4f9456ad5b07f62aaa570a3503709d4a2

See more details on using hashes here.

File details

Details for the file sfinance-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sfinance-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for sfinance-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49134cd1dbb89d7dd03fa23271ca22081d185af355d217373329f408c68e4f0f
MD5 1a6fe4b8c02c87cfca5b042063aafe98
BLAKE2b-256 13f224a8b5b5f14807ffff450210c8f2a7fc2e327ac5300197442b672dde5011

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